File: issue-77982.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (96 lines) | stat: -rw-r--r-- 3,604 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
error[E0283]: type annotations needed
  --> $DIR/issue-77982.rs:10:10
   |
LL |     opts.get(opt.as_ref());
   |          ^^^ ------------ type must be known at this point
   |          |
   |          cannot infer type of the type parameter `Q` declared on the method `get`
   |
   = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
           - impl Borrow<str> for String;
           - impl<T> Borrow<T> for T
             where T: ?Sized;
note: required by a bound in `HashMap::<K, V, S>::get`
  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
help: consider specifying the generic argument
   |
LL |     opts.get::<Q>(opt.as_ref());
   |             +++++

error[E0283]: type annotations needed
  --> $DIR/issue-77982.rs:10:10
   |
LL |     opts.get(opt.as_ref());
   |          ^^^     ------ type must be known at this point
   |          |
   |          cannot infer type of the type parameter `Q` declared on the method `get`
   |
   = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
           - impl AsRef<OsStr> for String;
           - impl AsRef<Path> for String;
           - impl AsRef<[u8]> for String;
           - impl AsRef<str> for String;
help: consider specifying the generic argument
   |
LL |     opts.get::<Q>(opt.as_ref());
   |             +++++

error[E0283]: type annotations needed
  --> $DIR/issue-77982.rs:15:59
   |
LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
   |                                            ---            ^^^^
   |                                            |
   |                                            type must be known at this point
   |
   = note: multiple `impl`s satisfying `u32: From<_>` found in the `core` crate:
           - impl From<Char> for u32;
           - impl From<Ipv4Addr> for u32;
           - impl From<bool> for u32;
           - impl From<char> for u32;
           - impl From<u16> for u32;
           - impl From<u8> for u32;
help: try using a fully qualified path to specify the expected types
   |
LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(<u32 as Into<T>>::into(0u32))).collect();
   |                                                      +++++++++++++++++++++++    ~

error[E0283]: type annotations needed for `Box<_>`
  --> $DIR/issue-77982.rs:38:9
   |
LL |     let _ = ().foo();
   |         ^      --- type must be known at this point
   |
note: multiple `impl`s satisfying `(): Foo<'_, _>` found
  --> $DIR/issue-77982.rs:31:1
   |
LL | impl Foo<'static, u32> for () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Foo<'a, i16> for () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL |     let _: Box<T> = ().foo();
   |          ++++++++

error[E0283]: type annotations needed for `Box<_>`
  --> $DIR/issue-77982.rs:42:9
   |
LL |     let _ = (&()).bar();
   |         ^         --- type must be known at this point
   |
note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
  --> $DIR/issue-77982.rs:34:1
   |
LL | impl<'a> Bar<'static, u32> for &'a () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Bar<'a, i16> for &'a () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL |     let _: Box<T> = (&()).bar();
   |          ++++++++

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0283`.