-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #100658 - chenyukang:100631-check-get-attr, r=lcnr
TyCtxt::get_attr should check that no duplicates are allowed Fixes #100631
- Loading branch information
Showing
7 changed files
with
38 additions
and
5 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 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// issue #100631, make sure `TyCtxt::get_attr` only called by case that compiler | ||
// can reasonably deal with multiple attributes. | ||
// `repr` will use `TyCtxt::get_attrs` since it's `DuplicatesOk`. | ||
#[repr(C)] //~ ERROR: unsupported representation for zero-variant enum [E0084] | ||
#[repr(C)] | ||
enum Foo {} | ||
|
||
fn main() {} |
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,12 @@ | ||
error[E0084]: unsupported representation for zero-variant enum | ||
--> $DIR/issue-100631.rs:4:1 | ||
| | ||
LL | #[repr(C)] | ||
| ^^^^^^^^^^ | ||
LL | #[repr(C)] | ||
LL | enum Foo {} | ||
| -------- zero-variant enum | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0084`. |