-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix repr(...)
validation ICE
#85976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Fix repr(...)
validation ICE
#85976
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,90 @@ | ||
#![feature(repr_simd)] | ||
#![feature(no_niche)] | ||
|
||
#[repr(transparent())] //~ ERROR invalid `repr(transparent)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(transparent)` attribute: no arguments expected | ||
struct S0(u32); | ||
|
||
#[repr(transparent(1, 2, 3))] //~ ERROR invalid `repr(transparent)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(transparent)` attribute: no arguments expected | ||
struct S1(u32); | ||
|
||
#[repr(C())] //~ ERROR invalid `repr(C)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(C)` attribute: no arguments expected | ||
struct S2(u32); | ||
|
||
#[repr(C(1, 2, 3))] //~ ERROR invalid `repr(C)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(C)` attribute: no arguments expected | ||
struct S3(u32); | ||
|
||
#[repr(simd())] //~ ERROR invalid `repr(simd)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(simd)` attribute: no arguments expected | ||
struct S4(u32); | ||
|
||
#[repr(simd(1, 2, 3))] //~ ERROR invalid `repr(simd)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(simd)` attribute: no arguments expected | ||
struct S5(u32); | ||
|
||
#[repr(no_niche())] //~ ERROR invalid `repr(no_niche)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(no_niche)` attribute: no arguments expected | ||
struct S6(u32); | ||
|
||
#[repr(no_niche(1, 2, 3))] //~ ERROR invalid `repr(no_niche)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(no_niche)` attribute: no arguments expected | ||
struct S7(u32); | ||
|
||
|
||
#[repr(align)] //~ ERROR invalid `repr(align)` attribute: expected a non-negative number | ||
//~| ERROR invalid `repr(align)` attribute: expected a non-negative number | ||
struct S8(u32); | ||
|
||
#[repr(align())] //~ ERROR invalid `repr(align)` attribute: expected a non-negative number | ||
//~| ERROR invalid `repr(align)` attribute: expected a non-negative number | ||
struct S9(u32); | ||
|
||
#[repr(align(foo()))] //~ ERROR invalid `repr(align)` attribute | ||
//~| ERROR invalid `repr(align)` attribute | ||
struct S10(u32); | ||
|
||
#[repr(align = "1")] //~ ERROR incorrect `repr(align)` attribute | ||
//~| ERROR incorrect `repr(align)` attribute | ||
struct S11(u32); | ||
|
||
#[repr(align = "")] //~ ERROR incorrect `repr(align)` attribute | ||
//~| ERROR incorrect `repr(align)` attribute | ||
struct S12(u32); | ||
|
||
#[repr(align = true)] //~ ERROR incorrect `repr(align)` attribute | ||
//~| ERROR incorrect `repr(align)` attribute | ||
struct S13(u32); | ||
|
||
#[repr(align(1, 2, 3))] //~ ERROR invalid `repr(align)` attribute: expected only one value | ||
//~| ERROR invalid `repr(align)` attribute: expected only one value | ||
struct S14(u32); | ||
|
||
#[repr(packed())] //~ ERROR invalid `repr(packed)` attribute: expected a non-negative number | ||
//~| ERROR invalid `repr(packed)` attribute: expected a non-negative number | ||
struct S15(u32); | ||
|
||
#[repr(packed(1, 2, 3))] //~ ERROR invalid `repr(packed)` attribute: expected only one value | ||
//~| ERROR invalid `repr(packed)` attribute: expected only one value | ||
struct S16(u32); | ||
|
||
#[repr(i8())] //~ ERROR invalid `repr(i8)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(i8)` attribute: no arguments expected | ||
enum S17 { A, B } | ||
|
||
#[repr(i8(1, 2, 3))] //~ ERROR invalid `repr(i8)` attribute: no arguments expected | ||
//~| ERROR invalid `repr(i8)` attribute: no arguments expected | ||
enum S18 { A, B } | ||
|
||
#[repr] //~ ERROR malformed `repr` attribute input | ||
struct S19(u32); | ||
|
||
#[repr(123)] //~ ERROR meta item in `repr` must be an identifier | ||
struct S20(u32); | ||
|
||
#[repr("foo")] //~ ERROR meta item in `repr` must be an identifier | ||
struct S21(u32); | ||
|
||
fn main() {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if we can make this test also check for diagnostic applicability. It might not be possible (if there are further errors afterwards), but let's confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a separate file for fixable suggestions