Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 26, 2019
1 parent 91b7423 commit 6ad77b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,7 @@ impl<'a> Parser<'a> {
if let Some(suffix) = suffix {
let mut err = self.diagnostic().struct_span_err(
span,
"tuple index with a suffix is invalid",
"suffixes on tuple indexes are invalid",
);
err.span_label(span, format!("invalid suffix `{}`", suffix));
err.emit();
Expand Down
6 changes: 5 additions & 1 deletion src/test/ui/parser/issue-59418.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ struct X(i32,i32,i32);
fn main() {
let a = X(1, 2, 3);
let b = a.1suffix;
//~^ ERROR tuple index with a suffix is invalid
//~^ ERROR suffixes on tuple indexes are invalid
println!("{}", b);
let c = (1, 2, 3);
let d = c.1suffix;
//~^ ERROR suffixes on tuple indexes are invalid
println!("{}", d);
}

10 changes: 8 additions & 2 deletions src/test/ui/parser/issue-59418.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
error: tuple index with a suffix is invalid
error: suffixes on tuple indexes are invalid
--> $DIR/issue-59418.rs:5:15
|
LL | let b = a.1suffix;
| ^^^^^^^ invalid suffix `suffix`

error: aborting due to previous error
error: suffixes on tuple indexes are invalid
--> $DIR/issue-59418.rs:9:15
|
LL | let d = c.1suffix;
| ^^^^^^^ invalid suffix `suffix`

error: aborting due to 2 previous errors

0 comments on commit 6ad77b0

Please sign in to comment.