rust/src/librustc_errors
kennytm bd8aa02ff4 Rollup merge of #47407 - gaurikholkar:master, r=estebank
fix mispositioned span

This fixes #47377

The output now looks like this
```
error[E0369]: binary operation `+` cannot be applied to type `&str`
 --> h.rs:3:11
  |
3 |     let _a = b + ", World!";
  |              ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
  |
3 |     let _a = b.to_owned() + ", World!";
  |              ^^^^^^^^^

error: aborting due to previous error
```
For the case when emojis are involved,  it gives the new output for proper indentation.
But for an indentation as follows,
```
fn main() {
let b = "hello";
    let _a = b + ", World!";
}
```
it still mispositions the span
```
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
  |                                           ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
  |
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
  |                                           ^^^^^^^
error: aborting due to previous erro
```

cc @estebank  @est31
2018-01-18 01:57:16 +08:00
..
Cargo.toml When attempting to write str with single quote suggest double quotes 2017-12-14 22:51:42 -08:00
diagnostic.rs Only bump error count when we are sure that the diagnostic is not a repetition. 2018-01-03 00:42:12 +01:00
diagnostic_builder.rs Only bump error count when we are sure that the diagnostic is not a repetition. 2018-01-03 00:42:12 +01:00
emitter.rs Rollup merge of #47407 - gaurikholkar:master, r=estebank 2018-01-18 01:57:16 +08:00
lib.rs Auto merge of #47274 - Manishearth:rustdoc-span, r=QuietMisdreavus 2018-01-14 11:28:27 +00:00
lock.rs run rustfmt on librustc_errors folder 2016-10-18 23:13:02 +05:30
registry.rs run rustfmt on librustc_errors folder 2016-10-18 23:13:02 +05:30
snippet.rs Rollup merge of #46052 - oli-obk:rendered_diagnostics_in_json, r=petrochenkov 2017-11-22 01:12:59 +08:00
styled_buffer.rs Display \t in diagnostics code as four spaces 2017-11-24 08:24:31 -08:00