rust/tests/ui/editions
Matthias Krüger f3f9b3043e
Rollup merge of #118691 - chfogelman:improve-cstr-error, r=fmease
Add check for possible CStr literals in pre-2021

Fixes [#118654](https://github.com/rust-lang/rust/issues/118654)

Adds information to errors caused by possible CStr literals in pre-2021.

The lexer separates `c"str"` into two tokens if the edition is less than 2021, which later causes an error when parsing. This error now has a more helpful message that directs them to information about editions. However, the user might also have written `c "str"` in a later edition, so to not confuse people who _are_ using a recent edition, I also added a note about whitespace.

We could probably figure out exactly which scenario has been encountered by examining spans and editions, but I figured it would be better not to overcomplicate the creation of the error too much.

This is my first code PR and I tried to follow existing conventions as much as possible, but I probably missed something, so let me know!
2023-12-20 09:46:10 +01:00
..
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
async-block-2015.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
async-block-2015.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dyn-trait-sugg-2021.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dyn-trait-sugg-2021.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-cstr-2015-2018.rs Improve compiler error for c-strings in pre-2021 2023-12-19 13:28:48 -08:00
edition-cstr-2015-2018.stderr Improve compiler error for c-strings in pre-2021 2023-12-19 13:28:48 -08:00
edition-extern-crate-allowed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-extern-crate-allowed.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-imports-2015.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-imports-2015.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-imports-2018.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-imports-2018.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-imports-virtual-2015-ambiguity.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-imports-virtual-2015-gated.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-imports-virtual-2015-gated.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-keywords-2015-2015-expansion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2015-parsing.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2015-parsing.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2015.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2018-expansion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2018-expansion.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-keywords-2015-2018-parsing.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2018-parsing.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2015-2018.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2015-expansion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2015-parsing.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2015-parsing.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2015.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2018-expansion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2018-expansion.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-keywords-2018-2018-parsing.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2018-parsing.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-keywords-2018-2018.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-raw-pointer-method-2015.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-raw-pointer-method-2015.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
edition-raw-pointer-method-2018.rs improve error message for calling a method on a raw pointer with an unknown pointee, and add some tests 2023-05-26 13:15:15 -04:00
edition-raw-pointer-method-2018.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00