error[E0283]: type annotations needed --> $DIR/issue-77982.rs:8:10 | LL | opts.get(opt.as_ref()); | ^^^ ------------ this method call resolves to `&T` | | | cannot infer type for type parameter `Q` declared on the associated function `get` | = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`: - impl Borrow for String; - impl Borrow for T where T: ?Sized; note: required by a bound in `HashMap::::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL | LL | K: Borrow, | ^^^^^^^^^ required by this bound in `HashMap::::get` help: consider specifying the type argument in the function call | LL | opts.get::(opt.as_ref()); | +++++ error[E0283]: type annotations needed --> $DIR/issue-77982.rs:8:18 | LL | opts.get(opt.as_ref()); | ----^^^^^^-- | | | | | cannot infer type for type parameter `T` declared on the trait `AsRef` | this method call resolves to `&T` | = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`: - impl AsRef for String; - impl AsRef for String; - impl AsRef<[u8]> for String; - impl AsRef for String; help: use the fully qualified path for the potential candidates | LL | opts.get(>::as_ref(opt)); | +++++++++++++++++++++++++++++++++ ~ LL | opts.get(>::as_ref(opt)); | ++++++++++++++++++++++++++++++++ ~ LL | opts.get(>::as_ref(opt)); | ++++++++++++++++++++++++++++++++ ~ LL | opts.get(>::as_ref(opt)); | +++++++++++++++++++++++++++++++ ~ and 4 other candidates error[E0283]: type annotations needed --> $DIR/issue-77982.rs:13:44 | LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect(); | ^^^^^^^^^ ----------- this method call resolves to `T` | | | cannot infer type for type parameter `T` declared on the trait `From` | = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`: - impl From for u32; - impl From for u32; - impl From for u32; - impl From for u32; and 3 more error[E0283]: type annotations needed for `Box` --> $DIR/issue-77982.rs:36:16 | LL | let _ = ().foo(); | - ^^^ cannot infer type for type parameter `T` declared on the trait `Foo` | | | consider giving this pattern the explicit type `Box`, where the type parameter `T` is specified | note: multiple `impl`s satisfying `(): Foo<'_, _>` found --> $DIR/issue-77982.rs:29:1 | LL | impl Foo<'static, u32> for () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> Foo<'a, i16> for () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0283]: type annotations needed for `Box` --> $DIR/issue-77982.rs:40:19 | LL | let _ = (&()).bar(); | - ^^^ cannot infer type for type parameter `T` declared on the trait `Bar` | | | consider giving this pattern the explicit type `Box`, where the type parameter `T` is specified | note: multiple `impl`s satisfying `&(): Bar<'_, _>` found --> $DIR/issue-77982.rs:32:1 | LL | impl<'a> Bar<'static, u32> for &'a () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LL | impl<'a> Bar<'a, i16> for &'a () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0283`.