1 error[E0283]: type annotations needed
2 --> $DIR/issue-77982.rs:8:10
4 LL | opts.get(opt.as_ref());
5 | ^^^ ------------ this method call resolves to `&T`
7 | cannot infer type for type parameter `Q` declared on the associated function `get`
9 = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
10 - impl Borrow<str> for String;
11 - impl<T> Borrow<T> for T
13 note: required by a bound in `HashMap::<K, V, S>::get`
14 --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
17 | ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
18 help: consider specifying the type argument in the function call
20 LL | opts.get::<Q>(opt.as_ref());
23 error[E0283]: type annotations needed
24 --> $DIR/issue-77982.rs:8:18
26 LL | opts.get(opt.as_ref());
29 | | cannot infer type for type parameter `T` declared on the trait `AsRef`
30 | this method call resolves to `&T`
32 = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
33 - impl AsRef<OsStr> for String;
34 - impl AsRef<Path> for String;
35 - impl AsRef<[u8]> for String;
36 - impl AsRef<str> for String;
37 help: use the fully qualified path for the potential candidates
39 LL | opts.get(<String as AsRef<OsStr>>::as_ref(opt));
40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 LL | opts.get(<String as AsRef<Path>>::as_ref(opt));
42 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 LL | opts.get(<String as AsRef<[u8]>>::as_ref(opt));
44 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 LL | opts.get(<String as AsRef<str>>::as_ref(opt));
46 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 error[E0283]: type annotations needed
49 --> $DIR/issue-77982.rs:13:44
51 LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
52 | ^^^^^^^^^ ----------- this method call resolves to `T`
54 | cannot infer type for type parameter `T` declared on the trait `From`
56 = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`:
57 - impl From<Ipv4Addr> for u32;
58 - impl From<NonZeroU32> for u32;
59 - impl From<bool> for u32;
60 - impl From<char> for u32;
63 error[E0283]: type annotations needed for `Box<T>`
64 --> $DIR/issue-77982.rs:36:16
66 LL | let _ = ().foo();
67 | - ^^^ cannot infer type for type parameter `T` declared on the trait `Foo`
69 | consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
71 note: multiple `impl`s satisfying `(): Foo<'_, _>` found
72 --> $DIR/issue-77982.rs:29:1
74 LL | impl Foo<'static, u32> for () {}
75 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 LL | impl<'a> Foo<'a, i16> for () {}
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79 error[E0283]: type annotations needed for `Box<T>`
80 --> $DIR/issue-77982.rs:40:19
82 LL | let _ = (&()).bar();
83 | - ^^^ cannot infer type for type parameter `T` declared on the trait `Bar`
85 | consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
87 note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
88 --> $DIR/issue-77982.rs:32:1
90 LL | impl<'a> Bar<'static, u32> for &'a () {}
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92 LL | impl<'a> Bar<'a, i16> for &'a () {}
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95 error: aborting due to 5 previous errors
97 For more information about this error, try `rustc --explain E0283`.