Do not ICE when synthesizing spans falling inside unicode chars

This commit is contained in:
Esteban Küber 2019-08-12 23:31:13 -07:00
parent 60960a260f
commit d824edfc2c
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,5 @@
struct X {}
fn f() {
vec![X]; //…
//~^ ERROR expected value, found struct `X`
}

View file

@ -0,0 +1,17 @@
error[E0423]: expected value, found struct `X`
--> $DIR/issue-61226.rs:3:10
|
LL | vec![X]; //…
| ^
| |
| did you mean `X { /* fields */ }`?
| help: a function with a similar name exists: `f`
error[E0601]: `main` function not found in crate `issue_61226`
|
= note: consider adding a `main` function to `$DIR/issue-61226.rs`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0423, E0601.
For more information about an error, try `rustc --explain E0423`.