|
1 |
| -error[E0283]: type annotations needed for `Bar<i32, &str, Z>` |
| 1 | +error[E0283]: type annotations needed for `Foo<i32, &str, W, Z>` |
2 | 2 | --> $DIR/erase-type-params-in-label.rs:2:15
|
3 | 3 | |
|
4 |
| -LL | let foo = new(1, ""); |
5 |
| - | --- ^^^ cannot infer type for type parameter `Z` declared on the function `new` |
| 4 | +LL | let foo = foo(1, ""); |
| 5 | + | --- ^^^ cannot infer type for type parameter `W` declared on the function `foo` |
| 6 | + | | |
| 7 | + | consider giving `foo` the explicit type `Foo<_, _, W, Z>`, where the type parameter `W` is specified |
| 8 | + | |
| 9 | + = note: cannot satisfy `_: Default` |
| 10 | +note: required by a bound in `foo` |
| 11 | + --> $DIR/erase-type-params-in-label.rs:25:17 |
| 12 | + | |
| 13 | +LL | fn foo<T, K, W: Default, Z: Default>(t: T, k: K) -> Foo<T, K, W, Z> { |
| 14 | + | ^^^^^^^ required by this bound in `foo` |
| 15 | +help: consider specifying the type arguments in the function call |
| 16 | + | |
| 17 | +LL | let foo = foo::<T, K, W, Z>(1, ""); |
| 18 | + | ++++++++++++++ |
| 19 | + |
| 20 | +error[E0283]: type annotations needed for `Bar<i32, &str, Z>` |
| 21 | + --> $DIR/erase-type-params-in-label.rs:5:15 |
| 22 | + | |
| 23 | +LL | let bar = bar(1, ""); |
| 24 | + | --- ^^^ cannot infer type for type parameter `Z` declared on the function `bar` |
6 | 25 | | |
|
7 |
| - | consider giving `foo` the explicit type `Bar<_, _, Z>`, where the type parameter `Z` is specified |
| 26 | + | consider giving `bar` the explicit type `Bar<_, _, Z>`, where the type parameter `Z` is specified |
8 | 27 | |
|
9 | 28 | = note: cannot satisfy `_: Default`
|
10 |
| -note: required by a bound in `new` |
11 |
| - --> $DIR/erase-type-params-in-label.rs:11:17 |
| 29 | +note: required by a bound in `bar` |
| 30 | + --> $DIR/erase-type-params-in-label.rs:14:17 |
12 | 31 | |
|
13 |
| -LL | fn new<T, K, Z: Default>(t: T, k: K) -> Bar<T, K, Z> { |
14 |
| - | ^^^^^^^ required by this bound in `new` |
| 32 | +LL | fn bar<T, K, Z: Default>(t: T, k: K) -> Bar<T, K, Z> { |
| 33 | + | ^^^^^^^ required by this bound in `bar` |
15 | 34 | help: consider specifying the type arguments in the function call
|
16 | 35 | |
|
17 |
| -LL | let foo = new::<T, K, Z>(1, ""); |
| 36 | +LL | let bar = bar::<T, K, Z>(1, ""); |
18 | 37 | | +++++++++++
|
19 | 38 |
|
20 |
| -error: aborting due to previous error |
| 39 | +error: aborting due to 2 previous errors |
21 | 40 |
|
22 | 41 | For more information about this error, try `rustc --explain E0283`.
|
0 commit comments