-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug
Description
This snippet of code trigger an error diagnostic from rust-analyzer.
But rustc compiles it fine.
When adding the dyn
keyword : the diagnostic disappears.
rustc 1.63.0 (4b91a6ea7 2022-08-08)
rust-analyzer version: 0.3.1170-standalone (b6d59f2 2022-08-14)
edition: 2018
[Ln 3, Col 9] expected &dyn Fn(usize), found &|{unknown}| -> ()
fn main() {
foo(
&(|number| {
// just use the parameter
let _ = number.min(0);
})
);
}
fn foo(_bar: &Fn(usize)) {}
Metadata
Metadata
Assignees
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug