forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#59355 - varkor:const-param-struct-ice, r=pe…
…trochenkov Fix ICE with const generic param in struct Fixes rust-lang#59340. r? @petrochenkov
- Loading branch information
Showing
3 changed files
with
37 additions
and
9 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
6 changes: 6 additions & 0 deletions
6
src/test/ui/const-generics/struct-with-invalid-const-param.rs
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
struct S<const C: u8>(C); //~ ERROR expected type, found const parameter | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/const-generics/struct-with-invalid-const-param.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/struct-with-invalid-const-param.rs:1:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error[E0573]: expected type, found const parameter `C` | ||
--> $DIR/struct-with-invalid-const-param.rs:4:23 | ||
| | ||
LL | struct S<const C: u8>(C); | ||
| ^ help: a struct with a similar name exists: `S` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0573`. |