diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2024-04-14 17:59:54 +0000 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2024-05-21 20:16:39 +0000 |
| commit | c227f35a9cd7ef894abfb623a16ad28abf8b6e3f (patch) | |
| tree | fe7288d38b63650035965c61d2767e7453e7d882 /compiler/rustc_attr/src/builtin.rs | |
| parent | 2482f3c17cd1fd4c4988b1f4fbf07270cd93c771 (diff) | |
| download | rust-c227f35a9cd7ef894abfb623a16ad28abf8b6e3f.tar.gz rust-c227f35a9cd7ef894abfb623a16ad28abf8b6e3f.zip | |
Generate lint diagnostic message from BuiltinLintDiag
Translation of the lint message happens when the actual diagnostic is created, not when the lint is buffered. Generating the message from BuiltinLintDiag ensures that all required data to construct the message is preserved in the LintBuffer, eventually allowing the messages to be moved to fluent. Remove the `msg` field from BufferedEarlyLint, it is either generated from the data in the BuiltinLintDiag or stored inside BuiltinLintDiag::Normal.
Diffstat (limited to 'compiler/rustc_attr/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_attr/src/builtin.rs | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index c08bf287733..1ac2e15c327 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -532,11 +532,6 @@ pub fn cfg_matches( UNEXPECTED_CFGS, cfg.span, lint_node_id, - if let Some(value) = cfg.value { - format!("unexpected `cfg` condition value: `{value}`") - } else { - format!("unexpected `cfg` condition value: (none)") - }, BuiltinLintDiag::UnexpectedCfgValue( (cfg.name, cfg.name_span), cfg.value.map(|v| (v, cfg.value_span.unwrap())), @@ -548,7 +543,6 @@ pub fn cfg_matches( UNEXPECTED_CFGS, cfg.span, lint_node_id, - format!("unexpected `cfg` condition name: `{}`", cfg.name), BuiltinLintDiag::UnexpectedCfgName( (cfg.name, cfg.name_span), cfg.value.map(|v| (v, cfg.value_span.unwrap())), |
