Skip to content

Commit 8f284de

Browse files
committed
use backticks instead of single quotes when reporting "use of unstable library feature 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 35fd749 commit 8f284de

File tree

116 files changed

+443
-443
lines changed

Some content is hidden

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

116 files changed

+443
-443
lines changed

compiler/rustc_error_codes/src/error_codes/E0658.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ An unstable feature was used.
33
Erroneous code example:
44

55
```compile_fail,E0658
6-
#[repr(u128)] // error: use of unstable library feature 'repr128'
6+
#[repr(u128)] // error: use of unstable library feature `repr128`
77
enum Foo {
88
Bar(u64),
99
}

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ hir_analysis_missing_trait_item_suggestion = implement the missing item: `{$snip
309309
310310
hir_analysis_missing_trait_item_unstable = not all trait items implemented, missing: `{$missing_item_name}`
311311
.note = default implementation of `{$missing_item_name}` is unstable
312-
.some_note = use of unstable library feature '{$feature}': {$reason}
313-
.none_note = use of unstable library feature '{$feature}'
312+
.some_note = use of unstable library feature `{$feature}`: {$reason}
313+
.none_note = use of unstable library feature `{$feature}`
314314
315315
hir_analysis_missing_type_params =
316316
the type {$parameterCount ->

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ pub fn report_unstable(
114114
let attr::Unstability { feature, reason, issue, .. } = denial.unstability;
115115

116116
let msg = match reason.to_opt_reason() {
117-
Some(r) => format!("use of unstable library feature '{feature}': {r}"),
118-
None => format!("use of unstable library feature '{feature}'"),
117+
Some(r) => format!("use of unstable library feature `{feature}`: {r}"),
118+
None => format!("use of unstable library feature `{feature}`"),
119119
};
120120

121121
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() {}

0 commit comments

Comments
 (0)