rust/tests/ui/malformed
Matthias Krüger ed58c01959 don't point at nonexisting code beyond EOF when warning about unused delims
Previously we would show this:
```
warning: unnecessary braces around block return value
 --> /tmp/bad.rs:1:8
  |
1 | fn a(){{{
  |        ^  ^
  |
  = note: `#[warn(unused_braces)]` on by default
help: remove these braces
  |
1 - fn a(){{{
1 + fn a(){{
  |
```

which is now hidden in this case.
We would create a span spanning between the pair of redundant {}s but there is only EOF instead of the `}` so we would previously point at nothing.
This would cause the debug assertion ice to trigger.
I would have loved to just only point at the second delim and say "you can remove that" but I'm not sure how to do that without refactoring the entire diagnostic which seems tricky. :(
But given that this does not seem to regress any other tests we have, I think this edge-casey enough be acceptable.

Fixes https://github.com/rust-lang/rust/issues/107423

r? @compiler-errors
2023-02-04 13:36:14 +01:00
..
issue-69341-malformed-derive-inert.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-69341-malformed-derive-inert.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-107423-unused-delim-only-one-no-pair.rs don't point at nonexisting code beyond EOF when warning about unused delims 2023-02-04 13:36:14 +01:00
issue-107423-unused-delim-only-one-no-pair.stderr don't point at nonexisting code beyond EOF when warning about unused delims 2023-02-04 13:36:14 +01:00
malformed-derive-entry.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-derive-entry.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-interpolated.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-interpolated.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-meta-delim.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-meta-delim.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-1.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-plugin-3.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-regressions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-regressions.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-special-attrs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
malformed-special-attrs.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00