rust/tests/ui/traits/issue-77982.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
3.5 KiB
Plaintext
Raw Normal View History

error[E0283]: type annotations needed
--> $DIR/issue-77982.rs:9:10
|
LL | opts.get(opt.as_ref());
2022-08-16 06:27:22 +00:00
| ^^^ ------------ 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
2022-08-16 06:27:22 +00:00
help: consider specifying the generic argument
|
LL | opts.get::<Q>(opt.as_ref());
| +++++
error[E0283]: type annotations needed
--> $DIR/issue-77982.rs:9:10
|
LL | opts.get(opt.as_ref());
2022-08-17 00:21:40 +00:00
| ^^^ ------ 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;
2022-02-14 12:25:26 +00:00
help: consider specifying the generic argument
|
LL | opts.get::<Q>(opt.as_ref());
| +++++
error[E0283]: type annotations needed
--> $DIR/issue-77982.rs:14: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<Ipv4Addr> for u32;
- impl From<NonZeroU32> for u32;
- impl From<bool> for u32;
- impl From<char> for u32;
- impl From<u16> for u32;
- impl From<u8> for u32;
2022-02-14 12:25:26 +00:00
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<T>`
--> $DIR/issue-77982.rs:37:9
|
LL | let _ = ().foo();
2022-08-17 00:21:40 +00:00
| ^ --- type must be known at this point
|
note: multiple `impl`s satisfying `(): Foo<'_, _>` found
--> $DIR/issue-77982.rs:30:1
|
LL | impl Foo<'static, u32> for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Foo<'a, i16> for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-02-14 12:25:26 +00:00
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<T>`
--> $DIR/issue-77982.rs:41:9
|
LL | let _ = (&()).bar();
2022-08-17 00:21:40 +00:00
| ^ --- type must be known at this point
|
note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
--> $DIR/issue-77982.rs:33:1
|
LL | impl<'a> Bar<'static, u32> for &'a () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Bar<'a, i16> for &'a () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-02-14 12:25:26 +00:00
help: consider giving this pattern a type, where the type for type parameter `T` is specified
|
LL | let _: Box<T> = (&()).bar();
| ++++++++
2022-08-17 00:21:40 +00:00
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0283`.