]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-77982.stderr
Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`.
[rust.git] / src / test / ui / traits / issue-77982.stderr
1 error[E0283]: type annotations needed
2   --> $DIR/issue-77982.rs:8:10
3    |
4 LL |     opts.get(opt.as_ref());
5    |          ^^^ ------------ this method call resolves to `&T`
6    |          |
7    |          cannot infer type for type parameter `Q` declared on the associated function `get`
8    |
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
12              where T: ?Sized;
13 note: required by a bound in `HashMap::<K, V, S>::get`
14   --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
15    |
16 LL |         K: Borrow<Q>,
17    |            ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
18 help: consider specifying the type argument in the function call
19    |
20 LL |     opts.get::<Q>(opt.as_ref());
21    |             +++++
22
23 error[E0283]: type annotations needed
24   --> $DIR/issue-77982.rs:8:18
25    |
26 LL |     opts.get(opt.as_ref());
27    |              ----^^^^^^--
28    |              |   |
29    |              |   cannot infer type for type parameter `T` declared on the trait `AsRef`
30    |              this method call resolves to `&T`
31    |
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
38    |
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
48 error[E0283]: type annotations needed
49   --> $DIR/issue-77982.rs:13:44
50    |
51 LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
52    |                                            ^^^^^^^^^ ----------- this method call resolves to `T`
53    |                                            |
54    |                                            cannot infer type for type parameter `T` declared on the trait `From`
55    |
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;
61            and 3 more
62
63 error[E0283]: type annotations needed for `Box<T>`
64   --> $DIR/issue-77982.rs:36:16
65    |
66 LL |     let _ = ().foo();
67    |         -      ^^^ cannot infer type for type parameter `T` declared on the trait `Foo`
68    |         |
69    |         consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
70    |
71 note: multiple `impl`s satisfying `(): Foo<'_, _>` found
72   --> $DIR/issue-77982.rs:29:1
73    |
74 LL | impl Foo<'static, u32> for () {}
75    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 LL | impl<'a> Foo<'a, i16> for () {}
77    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
79 error[E0283]: type annotations needed for `Box<T>`
80   --> $DIR/issue-77982.rs:40:19
81    |
82 LL |     let _ = (&()).bar();
83    |         -         ^^^ cannot infer type for type parameter `T` declared on the trait `Bar`
84    |         |
85    |         consider giving this pattern the explicit type `Box<T>`, where the type parameter `T` is specified
86    |
87 note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
88   --> $DIR/issue-77982.rs:32:1
89    |
90 LL | impl<'a> Bar<'static, u32> for &'a () {}
91    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92 LL | impl<'a> Bar<'a, i16> for &'a () {}
93    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
95 error: aborting due to 5 previous errors
96
97 For more information about this error, try `rustc --explain E0283`.