]> git.proxmox.com Git - rustc.git/blob - src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / methods / method-ambig-one-trait-unknown-int-type.stderr
1 error[E0282]: type annotations needed for `std::vec::Vec<T>`
2 --> $DIR/method-ambig-one-trait-unknown-int-type.rs:24:17
3 |
4 LL | let mut x = Vec::new();
5 | ----- ^^^^^^^^ cannot infer type for type parameter `T`
6 | |
7 | consider giving `x` the explicit type `std::vec::Vec<T>`, where the type parameter `T` is specified
8
9 error[E0308]: mismatched types
10 --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20
11 |
12 LL | let y: usize = x.foo();
13 | ----- ^^^^^^^ expected `usize`, found `isize`
14 | |
15 | expected due to this
16 |
17 help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
18 |
19 LL | let y: usize = x.foo().try_into().unwrap();
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
22 error: aborting due to 2 previous errors
23
24 Some errors have detailed explanations: E0282, E0308.
25 For more information about an error, try `rustc --explain E0282`.