rust/tests/ui/inference/need_type_info/issue-113264-incorrect-impl...

23 lines
819 B
Plaintext

error[E0283]: type annotations needed
--> $DIR/issue-113264-incorrect-impl-trait-in-path-suggestion.rs:10:16
|
LL | (S {}).owo(None)
| --- ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
| |
| required by a bound introduced by this call
|
= note: cannot satisfy `_: T`
note: required by a bound in `S::owo`
--> $DIR/issue-113264-incorrect-impl-trait-in-path-suggestion.rs:6:35
|
LL | fn owo(&self, _: Option<&impl T>) {}
| ^ required by this bound in `S::owo`
help: consider specifying the generic argument
|
LL | (S {}).owo(None::<&_>)
| ++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0283`.