diff options
| author | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-01-21 23:04:06 +0100 |
|---|---|---|
| committer | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-01-31 17:09:31 +0100 |
| commit | 565710b33cb20c901b8b3371d1364cf7fb11e79b (patch) | |
| tree | ea8b01a50153f7188172d0a924b86fa30471d4a2 /src/test/ui/macros/unreachable-format-arg.rs | |
| parent | 86f5e177bca8121e1edc9864023a8ea61acf9034 (diff) | |
| download | rust-565710b33cb20c901b8b3371d1364cf7fb11e79b.tar.gz rust-565710b33cb20c901b8b3371d1364cf7fb11e79b.zip | |
Fix invalid special casing of the unreachable! macro
Diffstat (limited to 'src/test/ui/macros/unreachable-format-arg.rs')
| -rw-r--r-- | src/test/ui/macros/unreachable-format-arg.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/macros/unreachable-format-arg.rs b/src/test/ui/macros/unreachable-format-arg.rs new file mode 100644 index 00000000000..7d83b698d79 --- /dev/null +++ b/src/test/ui/macros/unreachable-format-arg.rs @@ -0,0 +1,13 @@ +// run-fail +// ignore-emscripten no processes + +// revisions: edition_2015 edition_2021 +// [edition_2015]edition:2015 +// [edition_2021]edition:2021 +// [edition_2015]error-pattern:internal error: entered unreachable code: x is {x} +// [edition_2021]error-pattern:internal error: entered unreachable code: x is 5 + +fn main() { + let x = 5; + unreachable!("x is {x}"); +} |
