1
Fork 0

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.
This commit is contained in:
Matthias Krüger 2024-11-04 18:12:46 +01:00 committed by GitHub
commit b9db639ea5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
113 changed files with 433 additions and 431 deletions

View file

@ -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 {