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 | +++++++++++++++++++++++++++++++ ~
47 and 4 other candidates
49 error[E0283]: type annotations needed
50 --> $DIR/issue-77982.rs:13:44
52 LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
53 | ^^^^^^^^^ ----------- this method call resolves to `T`
55 | cannot infer type for type parameter `T` declared on the trait `From`
57 = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`:
58 - impl From<Ipv4Addr> for u32;
59 - impl From<NonZeroU32> for u32;
60 - impl From<bool> for u32;
61 - impl From<char> for u32;
64 error[E0283]: type annotations needed for `Box<T>`
65 --> $DIR/issue-77982.rs:36:16
67 LL | let _ = ().foo();
68 | - ^^^ cannot infer type for type parameter `T` declared on the trait `Foo`
70 | consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
72 note: multiple `impl`s satisfying `(): Foo<'_, _>` found
73 --> $DIR/issue-77982.rs:29:1
75 LL | impl Foo<'static, u32> for () {}
76 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77 LL | impl<'a> Foo<'a, i16> for () {}
78 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80 error[E0283]: type annotations needed for `Box<T>`
81 --> $DIR/issue-77982.rs:40:19
83 LL | let _ = (&()).bar();
84 | - ^^^ cannot infer type for type parameter `T` declared on the trait `Bar`
86 | consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
88 note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
89 --> $DIR/issue-77982.rs:32:1
91 LL | impl<'a> Bar<'static, u32> for &'a () {}
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 LL | impl<'a> Bar<'a, i16> for &'a () {}
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96 error: aborting due to 5 previous errors
98 For more information about this error, try `rustc --explain E0283`.