-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Reject integer suffix when tuple indexing #59421
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
Changes from all commits
91b7423
6ad77b0
c7ddb83
1bb3694
8d1cc72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
struct X(i32,i32,i32); | ||
|
||
fn main() { | ||
let a = X(1, 2, 3); | ||
let b = a.1suffix; | ||
//~^ ERROR suffixes on a tuple index are invalid | ||
println!("{}", b); | ||
let c = (1, 2, 3); | ||
let d = c.1suffix; | ||
//~^ ERROR suffixes on a tuple index are invalid | ||
println!("{}", d); | ||
let s = X { 0suffix: 0, 1: 1, 2: 2 }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (don't r- the PR in either case since it's in a rollup now... if changes need to be made, do it in a follow up PR) |
||
//~^ ERROR suffixes on a tuple index are invalid | ||
match s { | ||
X { 0suffix: _, .. } => {} | ||
//~^ ERROR suffixes on a tuple index are invalid | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: suffixes on a tuple index are invalid | ||
--> $DIR/issue-59418.rs:5:15 | ||
| | ||
LL | let b = a.1suffix; | ||
| ^^^^^^^ invalid suffix `suffix` | ||
|
||
error: suffixes on a tuple index are invalid | ||
--> $DIR/issue-59418.rs:9:15 | ||
| | ||
LL | let d = c.1suffix; | ||
| ^^^^^^^ invalid suffix `suffix` | ||
|
||
error: suffixes on a tuple index are invalid | ||
--> $DIR/issue-59418.rs:12:17 | ||
| | ||
LL | let s = X { 0suffix: 0, 1: 1, 2: 2 }; | ||
| ^^^^^^^ invalid suffix `suffix` | ||
|
||
error: suffixes on a tuple index are invalid | ||
--> $DIR/issue-59418.rs:15:13 | ||
| | ||
LL | X { 0suffix: _, .. } => {} | ||
| ^^^^^^^ invalid suffix `suffix` | ||
|
||
error: aborting due to 4 previous errors | ||
|
Uh oh!
There was an error while loading. Please reload this page.