diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-04 18:12:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 18:12:46 +0100 |
| commit | b9db639ea588534060504a48e8334fbfcb751fe6 (patch) | |
| tree | 96b5a871dd298eec7f8abf871c8d5fdb1b01fa6b /compiler/rustc_middle/src | |
| parent | c89a6cd0ad7a3218e821b027510a8fc30c47e5d2 (diff) | |
| parent | ae428141f7b99511e327ad28daf988978a376d86 (diff) | |
| download | rust-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 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/middle/stability.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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 { |
