diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-20 09:46:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-20 09:46:10 +0100 |
| commit | f3f9b3043ec936548075391ba86cd64e46454bee (patch) | |
| tree | 04cfddb2c86514fdf9052e64275dcedfb06b21f4 /compiler/rustc_interface/src/errors.rs | |
| parent | 5810deef6941025e6f60bb9a5f7b2a6ca8a9bf76 (diff) | |
| parent | 2c9602587472a94afc595f0f5adc7a0b85e15201 (diff) | |
| download | rust-f3f9b3043ec936548075391ba86cd64e46454bee.tar.gz rust-f3f9b3043ec936548075391ba86cd64e46454bee.zip | |
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!
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
