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.
Restrict parsing of bare union/struct to field types
Do not unconditionally parse bare types everywhere, only parse them if they are in a field type, and try them when recovering a misparse everywhere else, using them only if they are successfuly fully parsed. Fix rust-lang#88583.
- Loading branch information
Showing
3 changed files
with
138 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// check-pass | ||
|
||
#![allow(non_camel_case_types)] | ||
|
||
struct union; | ||
|
||
impl union { | ||
pub fn new() -> Self { | ||
union { } | ||
} | ||
} | ||
|
||
fn main() { | ||
let _u = union::new(); | ||
} |