about summary refs log tree commit diff
path: root/tests/ui/consts
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-04 18:12:46 +0100
committerGitHub <noreply@github.com>2024-11-04 18:12:46 +0100
commitb9db639ea588534060504a48e8334fbfcb751fe6 (patch)
tree96b5a871dd298eec7f8abf871c8d5fdb1b01fa6b /tests/ui/consts
parentc89a6cd0ad7a3218e821b027510a8fc30c47e5d2 (diff)
parentae428141f7b99511e327ad28daf988978a376d86 (diff)
downloadrust-b9db639ea588534060504a48e8334fbfcb751fe6.tar.gz
rust-b9db639ea588534060504a48e8334fbfcb751fe6.zip
Rollup merge of #132544 - dianne:unstable-library-feature-backticks, r=compiler-errors
Use backticks instead of single quotes for library feature names in diagnostics

This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since `DiagSymbolList` also displays symbols using backticks.
Diffstat (limited to 'tests/ui/consts')
-rw-r--r--tests/ui/consts/const-unstable-intrinsic.rs8
-rw-r--r--tests/ui/consts/const-unstable-intrinsic.stderr8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/ui/consts/const-unstable-intrinsic.rs b/tests/ui/consts/const-unstable-intrinsic.rs
index 050abc6dd46..5d43cdf5da6 100644
--- a/tests/ui/consts/const-unstable-intrinsic.rs
+++ b/tests/ui/consts/const-unstable-intrinsic.rs
@@ -15,16 +15,16 @@ const fn const_main() {
     let x = 42;
     unsafe {
         unstable_intrinsic::old_way::size_of_val(&x);
-        //~^ERROR: unstable library feature 'unstable'
+        //~^ERROR: unstable library feature `unstable`
         //~|ERROR: cannot call non-const intrinsic
         unstable_intrinsic::old_way::min_align_of_val(&x);
-        //~^ERROR: unstable library feature 'unstable'
+        //~^ERROR: unstable library feature `unstable`
         //~|ERROR: not yet stable as a const intrinsic
         unstable_intrinsic::new_way::size_of_val(&x);
-        //~^ERROR: unstable library feature 'unstable'
+        //~^ERROR: unstable library feature `unstable`
         //~|ERROR: cannot be (indirectly) exposed to stable
         unstable_intrinsic::new_way::min_align_of_val(&x);
-        //~^ERROR: unstable library feature 'unstable'
+        //~^ERROR: unstable library feature `unstable`
         //~|ERROR: not yet stable as a const intrinsic
 
         old_way::size_of_val(&x);
diff --git a/tests/ui/consts/const-unstable-intrinsic.stderr b/tests/ui/consts/const-unstable-intrinsic.stderr
index 33a434c503d..c2e38f54dc6 100644
--- a/tests/ui/consts/const-unstable-intrinsic.stderr
+++ b/tests/ui/consts/const-unstable-intrinsic.stderr
@@ -1,4 +1,4 @@
-error[E0658]: use of unstable library feature 'unstable'
+error[E0658]: use of unstable library feature `unstable`
   --> $DIR/const-unstable-intrinsic.rs:17:9
    |
 LL |         unstable_intrinsic::old_way::size_of_val(&x);
@@ -8,7 +8,7 @@ LL |         unstable_intrinsic::old_way::size_of_val(&x);
    = help: add `#![feature(unstable)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: use of unstable library feature 'unstable'
+error[E0658]: use of unstable library feature `unstable`
   --> $DIR/const-unstable-intrinsic.rs:20:9
    |
 LL |         unstable_intrinsic::old_way::min_align_of_val(&x);
@@ -18,7 +18,7 @@ LL |         unstable_intrinsic::old_way::min_align_of_val(&x);
    = help: add `#![feature(unstable)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: use of unstable library feature 'unstable'
+error[E0658]: use of unstable library feature `unstable`
   --> $DIR/const-unstable-intrinsic.rs:23:9
    |
 LL |         unstable_intrinsic::new_way::size_of_val(&x);
@@ -28,7 +28,7 @@ LL |         unstable_intrinsic::new_way::size_of_val(&x);
    = help: add `#![feature(unstable)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: use of unstable library feature 'unstable'
+error[E0658]: use of unstable library feature `unstable`
   --> $DIR/const-unstable-intrinsic.rs:26:9
    |
 LL |         unstable_intrinsic::new_way::min_align_of_val(&x);