Skip to content

Commit 846424d

Browse files
authored
Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkov
Match unmatched backticks in compiler/ Found with GNU grep: ``` grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```' ```
2 parents f9b122a + c54f061 commit 846424d

File tree

14 files changed

+27
-25
lines changed

14 files changed

+27
-25
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
949949
.push_span_label(*span, "this has an implicit `'static` lifetime requirement");
950950
multi_span.push_span_label(
951951
ident.span,
952-
"calling this method introduces the `impl`'s 'static` requirement",
952+
"calling this method introduces the `impl`'s `'static` requirement",
953953
);
954954
err.subdiagnostic(RequireStaticErr::UsedImpl { multi_span });
955955
err.span_suggestion_verbose(

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
457457
assert_eq!(input_len, dest_len, "Return vector length must match input length");
458458
assert!(
459459
index < dest_len,
460-
"Index `{}` must be in bounds of vector with length {}`",
460+
"Index `{}` must be in bounds of vector with length {}",
461461
index,
462462
dest_len
463463
);
@@ -477,7 +477,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
477477
let (input, input_len) = self.operand_to_simd(&args[0])?;
478478
assert!(
479479
index < input_len,
480-
"index `{}` must be in bounds of vector with length `{}`",
480+
"index `{}` must be in bounds of vector with length {}",
481481
index,
482482
input_len
483483
);

compiler/rustc_const_eval/src/transform/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
332332

333333
fn check_static(&mut self, def_id: DefId, span: Span) {
334334
if self.tcx.is_thread_local_static(def_id) {
335-
self.tcx.sess.delay_span_bug(span, "tls access is checked in `Rvalue::ThreadLocalRef");
335+
self.tcx.sess.delay_span_bug(span, "tls access is checked in `Rvalue::ThreadLocalRef`");
336336
}
337337
self.check_op_spanned(ops::StaticAccess, span)
338338
}

compiler/rustc_data_structures/src/stable_hasher/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn test_isize_compression() {
150150
let hash_b = hash(&(b as isize, a as isize));
151151
assert_ne!(
152152
hash_a, hash_b,
153-
"The hash stayed the same when permuting values `{a}` and `{b}!",
153+
"The hash stayed the same when permuting values `{a}` and `{b}`!",
154154
);
155155
}
156156

compiler/rustc_expand/src/mbe/transcribe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub(super) fn transcribe<'a>(
282282
}
283283

284284
// There should be no meta-var declarations in the invocation of a macro.
285-
mbe::TokenTree::MetaVarDecl(..) => panic!("unexpected `TokenTree::MetaVarDecl"),
285+
mbe::TokenTree::MetaVarDecl(..) => panic!("unexpected `TokenTree::MetaVarDecl`"),
286286
}
287287
}
288288
}

compiler/rustc_infer/locales/en-US.ftl

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ infer_subtype = ...so that the {$requirement ->
7979
[if_else_different] `if` and `else` have incompatible types
8080
[no_else] `if` missing an `else` returns `()`
8181
[fn_main_correct_type] `main` function has the correct type
82-
[fn_start_correct_type] #[start]` function has the correct type
82+
[fn_start_correct_type] `#[start]` function has the correct type
8383
[intristic_correct_type] intrinsic has the correct type
8484
[method_correct_type] method receiver has the correct type
8585
*[other] types are compatible
@@ -92,7 +92,7 @@ infer_subtype_2 = ...so that {$requirement ->
9292
[if_else_different] `if` and `else` have incompatible types
9393
[no_else] `if` missing an `else` returns `()`
9494
[fn_main_correct_type] `main` function has the correct type
95-
[fn_start_correct_type] #[start]` function has the correct type
95+
[fn_start_correct_type] `#[start]` function has the correct type
9696
[intristic_correct_type] intrinsic has the correct type
9797
[method_correct_type] method receiver has the correct type
9898
*[other] types are compatible
@@ -277,7 +277,7 @@ infer_tid_consider_borrowing = consider borrowing this type parameter in the tra
277277
infer_tid_param_help = the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
278278
279279
infer_dtcs_has_lifetime_req_label = this has an implicit `'static` lifetime requirement
280-
infer_dtcs_introduces_requirement = calling this method introduces the `impl`'s 'static` requirement
280+
infer_dtcs_introduces_requirement = calling this method introduces the `impl`'s `'static` requirement
281281
infer_dtcs_has_req_note = the used `impl` has a `'static` requirement
282282
infer_dtcs_suggestion = consider relaxing the implicit `'static` requirement
283283
@@ -313,7 +313,7 @@ infer_but_needs_to_satisfy = {$has_param_name ->
313313
[false] ...and is required to live as long as `'static` here
314314
}
315315
.used_here = ...is used here...
316-
.introduced_by_bound = 'static` lifetime requirement introduced by this bound
316+
.introduced_by_bound = `'static` lifetime requirement introduced by this bound
317317
318318
infer_more_targeted = {$has_param_name ->
319319
[true] `{$param_name}`

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
16901690
format!("{name} is defined in the current crate")
16911691
} else {
16921692
let crate_name = self.tcx.crate_name(defid.krate);
1693-
format!("{name} is defined in crate `{crate_name}")
1693+
format!("{name} is defined in crate `{crate_name}`")
16941694
};
16951695
diagnostic.span_note(def_span, msg);
16961696
};

compiler/rustc_interface/locales/en-US.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface_rustc_error_fatal =
3333
fatal error triggered by #[rustc_error]
3434
3535
interface_rustc_error_unexpected_annotation =
36-
unexpected annotation used with `#[rustc_error(...)]!
36+
unexpected annotation used with `#[rustc_error(...)]`!
3737
3838
interface_failed_writing_file =
3939
failed to write file {$path}: {$error}"

compiler/rustc_lexer/src/lib.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,17 @@ pub enum DocStyle {
166166
Inner,
167167
}
168168

169-
// Note that the suffix is *not* considered when deciding the `LiteralKind` in
170-
// this type. This means that float literals like `1f32` are classified by this
171-
// type as `Int`. (Compare against `rustc_ast::token::LitKind` and
172-
// `rustc_ast::ast::LitKind.)
169+
/// Enum representing the literal types supported by the lexer.
170+
///
171+
/// Note that the suffix is *not* considered when deciding the `LiteralKind` in
172+
/// this type. This means that float literals like `1f32` are classified by this
173+
/// type as `Int`. (Compare against `rustc_ast::token::LitKind` and
174+
/// `rustc_ast::ast::LitKind`).
173175
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
174176
pub enum LiteralKind {
175177
/// "12_u8", "0o100", "0b120i99", "1f32".
176178
Int { base: Base, empty_int: bool },
177-
/// "12.34f32", "1e3", but not "1f32`.
179+
/// "12.34f32", "1e3", but not "1f32".
178180
Float { base: Base, empty_exponent: bool },
179181
/// "'a'", "'\\'", "'''", "';"
180182
Char { terminated: bool },

compiler/rustc_middle/src/ty/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl IntegerExt for Integer {
9393
if discr < fit {
9494
bug!(
9595
"Integer::repr_discr: `#[repr]` hint too small for \
96-
discriminant range of enum `{}",
96+
discriminant range of enum `{}`",
9797
ty
9898
)
9999
}

compiler/rustc_mir_build/src/build/expr/as_constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn as_constant_inner<'tcx>(
5555
ConstantKind::Ty(tcx.const_error_with_guaranteed(ty, guar))
5656
}
5757
Err(LitToConstError::TypeError) => {
58-
bug!("encountered type error in `lit_to_mir_constant")
58+
bug!("encountered type error in `lit_to_mir_constant`")
5959
}
6060
};
6161

compiler/rustc_session/locales/en-US.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ session_incorrect_cgu_reuse_type =
55
}`{$expected_reuse}`
66
77
session_cgu_not_recorded =
8-
CGU-reuse for `{$cgu_user_name}` is (mangled: `{$cgu_name}`) was not recorded`
8+
CGU-reuse for `{$cgu_user_name}` is (mangled: `{$cgu_name}`) was not recorded
99
1010
session_feature_gate_error = {$explain}
1111

compiler/rustc_session/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ pub fn parse_externs(
22452245
early_error(
22462246
error_format,
22472247
"the `-Z unstable-options` flag must also be passed to \
2248-
enable `--extern options",
2248+
enable `--extern` options",
22492249
);
22502250
}
22512251
for opt in opts.split(',') {

tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ note: the used `impl` has a `'static` requirement
1717
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> {
1818
| ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
1919
LL | fn use_self<K>(&self) -> &() { panic!() }
20-
| -------- calling this method introduces the `impl`'s 'static` requirement
20+
| -------- calling this method introduces the `impl`'s `'static` requirement
2121
help: consider relaxing the implicit `'static` requirement
2222
|
2323
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
@@ -42,7 +42,7 @@ note: the used `impl` has a `'static` requirement
4242
LL | impl dyn ObjectTrait {
4343
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
4444
LL | fn use_self(&self) -> &() { panic!() }
45-
| -------- calling this method introduces the `impl`'s 'static` requirement
45+
| -------- calling this method introduces the `impl`'s `'static` requirement
4646
help: consider relaxing the implicit `'static` requirement
4747
|
4848
LL | impl dyn ObjectTrait + '_ {
@@ -65,7 +65,7 @@ note: the used `impl` has a `'static` requirement
6565
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:87:26
6666
|
6767
LL | fn use_self(&self) -> &() { panic!() }
68-
| -------- calling this method introduces the `impl`'s 'static` requirement
68+
| -------- calling this method introduces the `impl`'s `'static` requirement
6969
...
7070
LL | impl MyTrait for dyn ObjectTrait {}
7171
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -91,7 +91,7 @@ note: the used `impl` has a `'static` requirement
9191
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:106:26
9292
|
9393
LL | fn use_self(&self) -> &() { panic!() }
94-
| -------- calling this method introduces the `impl`'s 'static` requirement
94+
| -------- calling this method introduces the `impl`'s `'static` requirement
9595
...
9696
LL | impl MyTrait for dyn ObjectTrait {}
9797
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement

0 commit comments

Comments
 (0)