forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
470 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
error[E0282]: type annotations needed for `Foo<_>` | ||
error[E0284]: type annotations needed for `Foo<_>` | ||
--> $DIR/doesnt_infer.rs:13:9 | ||
| | ||
LL | let foo = Foo::foo(); | ||
| ^^^ | ||
| ^^^ ---------- type must be known at this point | ||
| | ||
note: required by a bound in `Foo::<N>::foo` | ||
--> $DIR/doesnt_infer.rs:5:6 | ||
| | ||
LL | impl<const N: u32> Foo<N> { | ||
| ^^^^^^^^^^^^ required by this bound in `Foo::<N>::foo` | ||
LL | fn foo() -> Self { | ||
| --- required by a bound in this associated function | ||
help: consider giving `foo` an explicit type, where the value of const parameter `N` is specified | ||
| | ||
LL | let foo: Foo<N> = Foo::foo(); | ||
| ++++++++ | ||
|
||
error[E0284]: type annotations needed for `Foo<_>` | ||
--> $DIR/doesnt_infer.rs:13:9 | ||
| | ||
LL | let foo = Foo::foo(); | ||
| ^^^ --- type must be known at this point | ||
| | ||
note: required by a bound in `Foo` | ||
--> $DIR/doesnt_infer.rs:3:12 | ||
| | ||
LL | struct Foo<const N: u32 = 2>; | ||
| ^^^^^^^^^^^^^^^^ required by this bound in `Foo` | ||
help: consider giving `foo` an explicit type, where the value of const parameter `N` is specified | ||
| | ||
LL | let foo: Foo<N> = Foo::foo(); | ||
| ++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0284`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 17 additions & 11 deletions
28
tests/ui/const-generics/generic_arg_infer/issue-91614.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
error[E0283]: type annotations needed for `Mask<_, _>` | ||
error[E0284]: type annotations needed for `Mask<_, _>` | ||
--> $DIR/issue-91614.rs:6:9 | ||
| | ||
LL | let y = Mask::<_, _>::splat(false); | ||
| ^ -------------------------- type must be known at this point | ||
| | ||
= note: cannot satisfy `_: MaskElement` | ||
= help: the following types implement trait `MaskElement`: | ||
i16 | ||
i32 | ||
i64 | ||
i8 | ||
isize | ||
note: required by a bound in `Mask::<T, N>::splat` | ||
--> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/masks.rs:LL:COL | ||
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified | ||
help: consider giving `y` an explicit type, where the value of const parameter `N` is specified | ||
| | ||
LL | let y: Mask<T, N> = Mask::<_, _>::splat(false); | ||
| ++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
error[E0284]: type annotations needed for `Mask<_, _>` | ||
--> $DIR/issue-91614.rs:6:9 | ||
| | ||
LL | let y = Mask::<_, _>::splat(false); | ||
| ^ ------------ type must be known at this point | ||
| | ||
note: required by a bound in `Mask` | ||
--> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/masks.rs:LL:COL | ||
help: consider giving `y` an explicit type, where the value of const parameter `N` is specified | ||
| | ||
LL | let y: Mask<T, N> = Mask::<_, _>::splat(false); | ||
| ++++++++++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0283`. | ||
For more information about this error, try `rustc --explain E0284`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
error[E0282]: type annotations needed | ||
error[E0284]: type annotations needed | ||
--> $DIR/cannot-infer-const-args.rs:6:5 | ||
| | ||
LL | foo(); | ||
| ^^^ cannot infer the value of the const parameter `X` declared on the function `foo` | ||
| | ||
note: required by a bound in `foo` | ||
--> $DIR/cannot-infer-const-args.rs:1:8 | ||
| | ||
LL | fn foo<const X: usize>() -> usize { | ||
| ^^^^^^^^^^^^^^ required by this bound in `foo` | ||
help: consider specifying the generic argument | ||
| | ||
LL | foo::<X>(); | ||
| +++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. | ||
For more information about this error, try `rustc --explain E0284`. |
Oops, something went wrong.