Skip to content

Commit d7d6238

Browse files
committed
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.
1 parent e3a918e commit d7d6238

File tree

113 files changed

+425
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+425
-425
lines changed

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ hir_analysis_missing_trait_item_suggestion = implement the missing item: `{$snip
311311
312312
hir_analysis_missing_trait_item_unstable = not all trait items implemented, missing: `{$missing_item_name}`
313313
.note = default implementation of `{$missing_item_name}` is unstable
314-
.some_note = use of unstable library feature '{$feature}': {$reason}
315-
.none_note = use of unstable library feature '{$feature}'
314+
.some_note = use of unstable library feature `{$feature}`: {$reason}
315+
.none_note = use of unstable library feature `{$feature}`
316316
317317
hir_analysis_missing_type_params =
318318
the type {$parameterCount ->

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ pub fn report_unstable(
112112
soft_handler: impl FnOnce(&'static Lint, Span, String),
113113
) {
114114
let msg = match reason {
115-
Some(r) => format!("use of unstable library feature '{feature}': {r}"),
116-
None => format!("use of unstable library feature '{feature}'"),
115+
Some(r) => format!("use of unstable library feature `{feature}`: {r}"),
116+
None => format!("use of unstable library feature `{feature}`"),
117117
};
118118

119119
if is_soft {

tests/ui-fulldeps/hash-stable-is-unstable.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
//@ compile-flags: -Zdeduplicate-diagnostics=yes
22
extern crate rustc_data_structures;
3-
//~^ use of unstable library feature 'rustc_private'
3+
//~^ use of unstable library feature `rustc_private`
44
//~| NOTE: issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
55
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
66
extern crate rustc_macros;
7-
//~^ use of unstable library feature 'rustc_private'
7+
//~^ use of unstable library feature `rustc_private`
88
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
99
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010
extern crate rustc_query_system;
11-
//~^ use of unstable library feature 'rustc_private'
11+
//~^ use of unstable library feature `rustc_private`
1212
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
1313
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1414

1515
use rustc_macros::HashStable;
16-
//~^ use of unstable library feature 'rustc_private'
16+
//~^ use of unstable library feature `rustc_private`
1717
//~| NOTE: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
1818
//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1919

2020
#[derive(HashStable)]
21-
//~^ use of unstable library feature 'rustc_private'
21+
//~^ use of unstable library feature `rustc_private`
2222
//~| NOTE: in this expansion of #[derive(HashStable)]
2323
//~| NOTE: in this expansion of #[derive(HashStable)]
2424
//~| NOTE: in this expansion of #[derive(HashStable)]

tests/ui-fulldeps/hash-stable-is-unstable.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
1+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
22
--> $DIR/hash-stable-is-unstable.rs:2:1
33
|
44
LL | extern crate rustc_data_structures;
@@ -8,7 +8,7 @@ LL | extern crate rustc_data_structures;
88
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

11-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
11+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
1212
--> $DIR/hash-stable-is-unstable.rs:6:1
1313
|
1414
LL | extern crate rustc_macros;
@@ -18,7 +18,7 @@ LL | extern crate rustc_macros;
1818
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

21-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
21+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
2222
--> $DIR/hash-stable-is-unstable.rs:10:1
2323
|
2424
LL | extern crate rustc_query_system;
@@ -28,7 +28,7 @@ LL | extern crate rustc_query_system;
2828
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

31-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
31+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
3232
--> $DIR/hash-stable-is-unstable.rs:15:5
3333
|
3434
LL | use rustc_macros::HashStable;
@@ -38,7 +38,7 @@ LL | use rustc_macros::HashStable;
3838
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
3939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4040

41-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
41+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
4242
--> $DIR/hash-stable-is-unstable.rs:20:10
4343
|
4444
LL | #[derive(HashStable)]

tests/ui-fulldeps/pathless-extern-unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// Test that `--extern rustc_middle` fails with `rustc_private`.
55

66
pub use rustc_middle;
7-
//~^ ERROR use of unstable library feature 'rustc_private'
7+
//~^ ERROR use of unstable library feature `rustc_private`
88

99
fn main() {}

tests/ui-fulldeps/pathless-extern-unstable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
1+
error[E0658]: use of unstable library feature `rustc_private`: this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
22
--> $DIR/pathless-extern-unstable.rs:6:9
33
|
44
LL | pub use rustc_middle;

tests/ui/associated-inherent-types/assoc-inherent-unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#![feature(inherent_associated_types)]
55
#![allow(incomplete_features)]
66

7-
type Data = aux::Owner::Data; //~ ERROR use of unstable library feature 'data'
7+
type Data = aux::Owner::Data; //~ ERROR use of unstable library feature `data`
88

99
fn main() {}

tests/ui/associated-inherent-types/assoc-inherent-unstable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: use of unstable library feature 'data'
1+
error[E0658]: use of unstable library feature `data`
22
--> $DIR/assoc-inherent-unstable.rs:7:13
33
|
44
LL | type Data = aux::Owner::Data;

tests/ui/async-await/async-fn/edition-2015.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fn foo(x: impl async Fn()) -> impl async Fn() { x }
33
//~| ERROR `async` trait bounds are only allowed in Rust 2018 or later
44
//~| ERROR async closures are unstable
55
//~| ERROR async closures are unstable
6-
//~| ERROR use of unstable library feature 'async_closure'
7-
//~| ERROR use of unstable library feature 'async_closure'
6+
//~| ERROR use of unstable library feature `async_closure`
7+
//~| ERROR use of unstable library feature `async_closure`
88

99
fn main() {}

tests/ui/async-await/async-fn/edition-2015.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
3838
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3939
= help: to use an async block, remove the `||`: `async {`
4040

41-
error[E0658]: use of unstable library feature 'async_closure'
41+
error[E0658]: use of unstable library feature `async_closure`
4242
--> $DIR/edition-2015.rs:1:42
4343
|
4444
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
@@ -48,7 +48,7 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
4848
= help: add `#![feature(async_closure)]` to the crate attributes to enable
4949
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5050

51-
error[E0658]: use of unstable library feature 'async_closure'
51+
error[E0658]: use of unstable library feature `async_closure`
5252
--> $DIR/edition-2015.rs:1:22
5353
|
5454
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }

0 commit comments

Comments
 (0)