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