]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/issue-77982.stderr
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / 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    |          ^^^ ------------ type must be known at this point
6    |          |
7    |          cannot infer type of the 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 help: consider specifying the generic argument
16    |
17 LL |     opts.get::<Q>(opt.as_ref());
18    |             +++++
19
20 error[E0283]: type annotations needed
21   --> $DIR/issue-77982.rs:8:10
22    |
23 LL |     opts.get(opt.as_ref());
24    |          ^^^     ------ type must be known at this point
25    |          |
26    |          cannot infer type of the type parameter `Q` declared on the associated function `get`
27    |
28    = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
29            - impl AsRef<OsStr> for String;
30            - impl AsRef<Path> for String;
31            - impl AsRef<[u8]> for String;
32            - impl AsRef<str> for String;
33 help: consider specifying the generic argument
34    |
35 LL |     opts.get::<Q>(opt.as_ref());
36    |             +++++
37
38 error[E0283]: type annotations needed
39   --> $DIR/issue-77982.rs:13:59
40    |
41 LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
42    |                                            ---------      ^^^^
43    |                                            |
44    |                                            required by a bound introduced by this call
45    |
46    = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`:
47            - impl From<Ipv4Addr> for u32;
48            - impl From<NonZeroU32> for u32;
49            - impl From<bool> for u32;
50            - impl From<char> for u32;
51            - impl From<u16> for u32;
52            - impl From<u8> for u32;
53            - impl<T> From<!> for T;
54            - impl<T> From<T> for T;
55 help: try using a fully qualified path to specify the expected types
56    |
57 LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(<u32 as Into<T>>::into(0u32))).collect();
58    |                                                      +++++++++++++++++++++++    ~
59
60 error[E0283]: type annotations needed for `Box<T>`
61   --> $DIR/issue-77982.rs:36:9
62    |
63 LL |     let _ = ().foo();
64    |         ^      --- type must be known at this point
65    |
66 note: multiple `impl`s satisfying `(): Foo<'_, _>` found
67   --> $DIR/issue-77982.rs:29:1
68    |
69 LL | impl Foo<'static, u32> for () {}
70    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71 LL | impl<'a> Foo<'a, i16> for () {}
72    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73 help: consider giving this pattern a type, where the type for type parameter `T` is specified
74    |
75 LL |     let _: Box<T> = ().foo();
76    |          ++++++++
77
78 error[E0283]: type annotations needed for `Box<T>`
79   --> $DIR/issue-77982.rs:40:9
80    |
81 LL |     let _ = (&()).bar();
82    |         ^         --- type must be known at this point
83    |
84 note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
85   --> $DIR/issue-77982.rs:32:1
86    |
87 LL | impl<'a> Bar<'static, u32> for &'a () {}
88    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89 LL | impl<'a> Bar<'a, i16> for &'a () {}
90    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91 help: consider giving this pattern a type, where the type for type parameter `T` is specified
92    |
93 LL |     let _: Box<T> = (&()).bar();
94    |          ++++++++
95
96 error: aborting due to 5 previous errors
97
98 For more information about this error, try `rustc --explain E0283`.