diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-22 11:36:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-22 11:36:44 +0100 |
| commit | 72e41e5d650a392914a6faa56b81072a2fe16ea2 (patch) | |
| tree | 7c0ba6ee1278477de69beaeaf15e88b8bfcbdfc8 /compiler/rustc_interface/src/errors.rs | |
| parent | 37e0d138cffd8d3b3d9b9da75f2645e1ba87dacb (diff) | |
| parent | ec88bc2e00985e99923ff3de966a947daa63c567 (diff) | |
| download | rust-72e41e5d650a392914a6faa56b81072a2fe16ea2.tar.gz rust-72e41e5d650a392914a6faa56b81072a2fe16ea2.zip | |
Rollup merge of #137356 - nik-rev:FERRIS, r=compiler-errors
Ferris 🦀 Identifier naming conventions
You cannot use Ferris as an identifier in Rust, this code will suggest to correct the 🦀 to `ferris`:
```rs
fn main() {
let 🦀 = 4;
}
```
But it also suggests to correct to `ferris` in these cases, too:
```rs
struct 🦀 {}
fn main() {}
```
^ suggests: `ferris`
~ with this PR: `Ferris`
```rs
static 🦀: &str = "ferris!";
fn main() {}
```
^ suggests: `ferris`
~ with this PR: `FERRIS`
This is my first pull requests here!
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
| -rw-r--r-- | compiler/rustc_interface/src/errors.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs index ca4e556dcdb..eed729a1777 100644 --- a/compiler/rustc_interface/src/errors.rs +++ b/compiler/rustc_interface/src/errors.rs @@ -24,8 +24,9 @@ pub(crate) struct CrateNameInvalid<'a> { pub struct FerrisIdentifier { #[primary_span] pub spans: Vec<Span>, - #[suggestion(code = "ferris", applicability = "maybe-incorrect")] + #[suggestion(code = "{ferris_fix}", applicability = "maybe-incorrect")] pub first_span: Span, + pub ferris_fix: &'static str, } #[derive(Diagnostic)] |
