about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-11-02 16:10:24 -0700
committerdianne <diannes.gm@gmail.com>2024-11-03 13:55:52 -0800
commitd7d6238b235fe65caedefd346c2a7107eb0a2656 (patch)
tree3fabff303a5ab50609503a1589972ee3097d7fb5 /compiler
parente3a918ece026cec748fc64af5b4983095b46097e (diff)
downloadrust-d7d6238b235fe65caedefd346c2a7107eb0a2656.tar.gz
rust-d7d6238b235fe65caedefd346c2a7107eb0a2656.zip
use backticks instead of single quotes when reporting "use of unstable library feature"
This is consistent with all other diagnostics I could find containing
features and enables the use of `DiagSymbolList` for generalizing
diagnostics for unstable library features to multiple features.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_analysis/messages.ftl4
-rw-r--r--compiler/rustc_middle/src/middle/stability.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl
index 38b11aa4017..6e8ba51612e 100644
--- a/compiler/rustc_hir_analysis/messages.ftl
+++ b/compiler/rustc_hir_analysis/messages.ftl
@@ -311,8 +311,8 @@ hir_analysis_missing_trait_item_suggestion = implement the missing item: `{$snip
 
 hir_analysis_missing_trait_item_unstable = not all trait items implemented, missing: `{$missing_item_name}`
     .note = default implementation of `{$missing_item_name}` is unstable
-    .some_note = use of unstable library feature '{$feature}': {$reason}
-    .none_note = use of unstable library feature '{$feature}'
+    .some_note = use of unstable library feature `{$feature}`: {$reason}
+    .none_note = use of unstable library feature `{$feature}`
 
 hir_analysis_missing_type_params =
     the type {$parameterCount ->
diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs
index c0688aff183..e6b36299d7f 100644
--- a/compiler/rustc_middle/src/middle/stability.rs
+++ b/compiler/rustc_middle/src/middle/stability.rs
@@ -112,8 +112,8 @@ pub fn report_unstable(
     soft_handler: impl FnOnce(&'static Lint, Span, String),
 ) {
     let msg = match reason {
-        Some(r) => format!("use of unstable library feature '{feature}': {r}"),
-        None => format!("use of unstable library feature '{feature}'"),
+        Some(r) => format!("use of unstable library feature `{feature}`: {r}"),
+        None => format!("use of unstable library feature `{feature}`"),
     };
 
     if is_soft {