Skip to content

Commit 51ee196

Browse files
author
Samy Kacimi
committed
normalize use of backticks in compiler messages for librustc/hir
#60532
1 parent 83dfe7b commit 51ee196

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/librustc/hir/def_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ impl CrateNum {
6969
pub fn as_usize(self) -> usize {
7070
match self {
7171
CrateNum::Index(id) => id.as_usize(),
72-
_ => bug!("tried to get index of nonstandard crate {:?}", self),
72+
_ => bug!("tried to get index of non-standard crate {:?}", self),
7373
}
7474
}
7575

7676
pub fn as_u32(self) -> u32 {
7777
match self {
7878
CrateNum::Index(id) => id.as_u32(),
79-
_ => bug!("tried to get index of nonstandard crate {:?}", self),
79+
_ => bug!("tried to get index of non-standard crate {:?}", self),
8080
}
8181
}
8282

src/librustc/hir/lowering.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,8 @@ impl<'a> LoweringContext<'a> {
16931693
if pos == ImplTraitPosition::Binding &&
16941694
nightly_options::is_nightly_build() {
16951695
help!(err,
1696-
"add #![feature(impl_trait_in_bindings)] to the crate attributes \
1697-
to enable");
1696+
"add `#![feature(impl_trait_in_bindings)]` to the crate \
1697+
attributes to enable");
16981698
}
16991699
err.emit();
17001700
hir::TyKind::Err

src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,23 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
121121
LL | const _cdef: impl Tr1<As1: Copy> = S1;
122122
| ^^^^^^^^^^^^^^^^^^^
123123
|
124-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
124+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
125125

126126
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
127127
--> $DIR/feature-gate-associated_type_bounds.rs:60:15
128128
|
129129
LL | static _sdef: impl Tr1<As1: Copy> = S1;
130130
| ^^^^^^^^^^^^^^^^^^^
131131
|
132-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
132+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
133133

134134
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
135135
--> $DIR/feature-gate-associated_type_bounds.rs:67:12
136136
|
137137
LL | let _: impl Tr1<As1: Copy> = S1;
138138
| ^^^^^^^^^^^^^^^^^^^
139139
|
140-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
140+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
141141

142142
error: aborting due to 16 previous errors
143143

src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
1010
LL | const FOO: impl Copy = 42;
1111
| ^^^^^^^^^
1212
|
13-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
13+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
1414

1515
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
1616
--> $DIR/feature-gate-impl_trait_in_bindings.rs:4:13
1717
|
1818
LL | static BAR: impl Copy = 42;
1919
| ^^^^^^^^^
2020
|
21-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
21+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
2222

2323
error: aborting due to 3 previous errors
2424

src/test/ui/impl-trait/where-allowed.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
232232
LL | let _in_local_variable: impl Fn() = || {};
233233
| ^^^^^^^^^
234234
|
235-
= help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
235+
= help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
236236

237237
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
238238
--> $DIR/where-allowed.rs:222:46

0 commit comments

Comments
 (0)