Code
fn main() {
Default::default() == 1i32;
}
Current output
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> src/main.rs:2:5
|
2 | Default::default() == 1i32;
| ^^^^^^^^^^^^^^^^ cannot call associated function of trait
|
help: use a fully-qualified path to a specific available implementation (273 found)
|
2 | <&OsStr as Default>::default() == 1i32;
| ++++++++++ +
Desired output
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> src/main.rs:2:5
|
2 | Default::default() == 1i32;
| ^^^^^^^^^^^^^^^^ cannot call associated function of trait
|
help: use a fully-qualified path to a specific available implementation (273 found)
|
2 | </* self type */ as Default>::default() == 1i32;
| ++++++++++++++++++++ +
Rationale and extra context
if there are 273 possible self types to specify diagnostics should probably not arbitrarily decide what self type i meant since it actually has no idea.
Other cases
No response
Anything else?
Ideally it'd probably actually suggest i32::default() but it might be unreasonable to expect diagnostics to figure that out
Code
Current output
Desired output
Rationale and extra context
if there are 273 possible self types to specify diagnostics should probably not arbitrarily decide what self type i meant since it actually has no idea.
Other cases
No response
Anything else?
Ideally it'd probably actually suggest
i32::default()but it might be unreasonable to expect diagnostics to figure that out