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
{{ message }}
Repository navigation
rust_2021_prelude_collisions bad suggestion with lifetime generics #88470
This generates a suggestion to avoid the prelude collision with:
<UasPyTryFrom<_>>::try_from(self)
However, that does not compile because the generics for PyTryFrom is a lifetime parameter which should not be specified with _. I believe the correct suggestion would be <U as PyTryFrom>::try_from(self) without the generic args.
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> src/main.rs:16:5
|
16 | Foo::try_from(todo!());
| ^^^^^^^^^^^^^ help: disambiguate the associated function: `<Foo<_> as A>::try_from`
|
(The lifetime is now on the Self type, not on the trait.)
Activity
ehuss commentedon Aug 29, 2021
cc #88442 which is similar where
rust_2021_prelude_collisionsis having issues with generics.m-ou-se commentedon Aug 30, 2021
Similar problem (not found in the crater results):
(The lifetime is now on the Self type, not on the trait.)
m-ou-se commentedon Aug 30, 2021
The problem also exists for const generics. But I don't think we can solve that without
#![feature(generic_arg_infer)].Rollup merge of rust-lang#88496 - m-ou-se:prelude-collision-lifetime-…