]> git.lizzy.rs Git - rust.git/blob - src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / methods / method-ambig-one-trait-unknown-int-type.stderr
1 error[E0282]: type annotations needed for `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 `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 a `usize` and panic if the converted value doesn'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`.