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