You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the provided code in the Rust Playground, the expectation was for Clippy to produce a warning related to the usage of ok_or in accordance with the or_fun_call lint. However, Clippy did not generate any warning, contrary to the expected behavior.
Reproducer
I tried this code:
fnfoo() -> String{println!("Called foo");"foo".to_string()}fnbar(x:bool) -> Option<i32>{if x {Some(1)}else{None}}fnmain(){let v = bar(true).ok_or(foo());println!("v {:?}", v)}
Summary
When running the provided code in the Rust Playground, the expectation was for Clippy to produce a warning related to the usage of
ok_or
in accordance with theor_fun_call
lint. However, Clippy did not generate any warning, contrary to the expected behavior.Reproducer
I tried this code:
Playground demo: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1cc70f21798932cb2cae892524e8cb20
I expected to see this happen:
I expect clippy to fire a warning for the
ok_or
usage as per or_fun_call.Instead, this happened:
Clippy doesn't fire any warning
Version
No response
Additional Labels
No response
The text was updated successfully, but these errors were encountered: