Skip to content

Commit

Permalink
Rollup merge of rust-lang#68084 - estebank:ice-68000, r=varkor
Browse files Browse the repository at this point in the history
Do not ICE on unicode next point

Use `shrink_to_hi` instead of `next_point`.
Fix rust-lang#68000.
  • Loading branch information
JohnTitor authored Jan 10, 2020
2 parents 5f7d23d + fcd850f commit 0d7a792
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ impl<'a> Parser<'a> {
}
}
_ => {
let sp = self.sess.source_map().next_point(self.prev_span);
let sp = self.prev_span.shrink_to_hi();
let mut err = self.struct_span_err(
sp,
&format!("expected `,`, or `}}`, found {}", super::token_descr(&self.token)),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub struct Foo {
pub bar: Vec<i32>ö
//~^ ERROR expected `,`, or `}`, found `ö`
} //~ ERROR expected `:`, found `}`

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error: expected `,`, or `}`, found `ö`
--> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:2:22
|
LL | pub bar: Vec<i32>ö
| ^ help: try adding a comma: `,`

error: expected `:`, found `}`
--> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:4:1
|
LL | pub bar: Vec<i32>ö
| - expected `:`
LL |
LL | }
| ^ unexpected token

error: aborting due to 2 previous errors

0 comments on commit 0d7a792

Please sign in to comment.