Skip to content

Commit 6df5ae4

Browse files
committed
Match unmatched backticks in comments in compiler/
1 parent ff2c609 commit 6df5ae4

File tree

24 files changed

+28
-25
lines changed

24 files changed

+28
-25
lines changed

compiler/rustc_ast/src/util/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl AssocOp {
225225
AssignOp(_) | // `{ 42 } +=`
226226
As | // `{ 42 } as usize`
227227
// Equal | // `{ 42 } == { 42 }` Accepting these here would regress incorrect
228-
// NotEqual | // `{ 42 } != { 42 } struct literals parser recovery.
228+
// NotEqual | // `{ 42 } != { 42 }` struct literals parser recovery.
229229
Colon, // `{ 42 }: usize`
230230
)
231231
}

compiler/rustc_ast_passes/src/ast_validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'a> AstValidator<'a> {
192192
// We allow these:
193193
// - `Option<impl Trait>`
194194
// - `option::Option<impl Trait>`
195-
// - `option::Option<T>::Foo<impl Trait>
195+
// - `option::Option<T>::Foo<impl Trait>`
196196
//
197197
// But not these:
198198
// - `<impl Trait>::Foo`

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ pub(super) fn check_type_bounds<'tcx>(
18731873
// type Bar<C> =...
18741874
// }
18751875
//
1876-
// - `impl_trait_ref` would be `<(A, B) as Foo<u32>>
1876+
// - `impl_trait_ref` would be `<(A, B) as Foo<u32>>`
18771877
// - `impl_ty_substs` would be `[A, B, ^0.0]` (`^0.0` here is the bound var with db 0 and index 0)
18781878
// - `rebased_substs` would be `[(A, B), u32, ^0.0]`, combining the substs from
18791879
// the *trait* with the generic associated type parameters (as bound vars).

compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUn
437437
}
438438

439439
// Here we are considering a case of converting
440-
// `S<P0...Pn>` to S<Q0...Qn>`. As an example, let's imagine a struct `Foo<T, U>`,
440+
// `S<P0...Pn>` to `S<Q0...Qn>`. As an example, let's imagine a struct `Foo<T, U>`,
441441
// which acts like a pointer to `U`, but carries along some extra data of type `T`:
442442
//
443443
// struct Foo<T, U> {

compiler/rustc_hir_typeck/src/mem_categorization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
636636
// `&&Some(x,)` `place_foo`
637637
// `&Some(x,)` `deref { place_foo}`
638638
// `Some(x,)` `deref { deref { place_foo }}`
639-
// (x,)` `field0 { deref { deref { place_foo }}}` <- resulting place
639+
// `(x,)` `field0 { deref { deref { place_foo }}}` <- resulting place
640640
//
641641
// The above example has no adjustments. If the code were instead the (after adjustments,
642642
// equivalent) version

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
16211621
#[instrument(level = "debug", skip(self))]
16221622
fn encode_info_for_closure(&mut self, def_id: LocalDefId) {
16231623
// NOTE(eddyb) `tcx.type_of(def_id)` isn't used because it's fully generic,
1624-
// including on the signature, which is inferred in `typeck.
1624+
// including on the signature, which is inferred in `typeck`.
16251625
let typeck_result: &'tcx ty::TypeckResults<'tcx> = self.tcx.typeck(def_id);
16261626
let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
16271627
let ty = typeck_result.node_type(hir_id);

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2908,7 +2908,7 @@ fn pretty_print_const_value<'tcx>(
29082908
// the `destructure_const` query with an empty `ty::ParamEnv` without
29092909
// introducing ICEs (e.g. via `layout_of`) from missing bounds.
29102910
// E.g. `transmute([0usize; 2]): (u8, *mut T)` needs to know `T: Sized`
2911-
// to be able to destructure the tuple into `(0u8, *mut T)
2911+
// to be able to destructure the tuple into `(0u8, *mut T)`
29122912
//
29132913
// FIXME(eddyb) for `--emit=mir`/`-Z dump-mir`, we should provide the
29142914
// correct `ty::ParamEnv` to allow printing *all* constant values.

compiler/rustc_middle/src/mir/spanview.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::io::{self, Write};
1111
pub const TOOLTIP_INDENT: &str = " ";
1212

1313
const CARET: char = '\u{2038}'; // Unicode `CARET`
14-
const ANNOTATION_LEFT_BRACKET: char = '\u{298a}'; // Unicode `Z NOTATION RIGHT BINDING BRACKET
14+
const ANNOTATION_LEFT_BRACKET: char = '\u{298a}'; // Unicode `Z NOTATION RIGHT BINDING BRACKET`
1515
const ANNOTATION_RIGHT_BRACKET: char = '\u{2989}'; // Unicode `Z NOTATION LEFT BINDING BRACKET`
1616
const NEW_LINE_SPAN: &str = "</span>\n<span class=\"line\">";
1717
const HEADER: &str = r#"<!DOCTYPE html>

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,7 @@ impl<'tcx> TyCtxt<'tcx> {
21872187
// Actually intern type lists as lists of `GenericArg`s.
21882188
//
21892189
// Transmuting from `Ty<'tcx>` to `GenericArg<'tcx>` is sound
2190-
// as explained in ty_slice_as_generic_arg`. With this,
2190+
// as explained in `ty_slice_as_generic_arg`. With this,
21912191
// we guarantee that even when transmuting between `List<Ty<'tcx>>`
21922192
// and `List<GenericArg<'tcx>>`, the uniqueness requirement for
21932193
// lists is upheld.

compiler/rustc_middle/src/ty/inhabitedness/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'tcx> VariantDef {
105105
impl<'tcx> Ty<'tcx> {
106106
pub fn inhabited_predicate(self, tcx: TyCtxt<'tcx>) -> InhabitedPredicate<'tcx> {
107107
match self.kind() {
108-
// For now, union`s are always considered inhabited
108+
// For now, unions are always considered inhabited
109109
Adt(adt, _) if adt.is_union() => InhabitedPredicate::True,
110110
// Non-exhaustive ADTs from other crates are always considered inhabited
111111
Adt(adt, _) if adt.is_variant_list_non_exhaustive() && !adt.did().is_local() => {

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ impl<'tcx> Predicate<'tcx> {
710710
// The substitution from the input trait-ref is therefore going to be
711711
// `'a => 'x` (where `'x` has a DB index of 1).
712712
// - The supertrait-ref is `for<'b> Bar1<'a,'b>`, where `'a` is an
713-
// early-bound parameter and `'b' is a late-bound parameter with a
713+
// early-bound parameter and `'b` is a late-bound parameter with a
714714
// DB index of 1.
715715
// - If we replace `'a` with `'x` from the input, it too will have
716716
// a DB index of 1, and thus we'll have `for<'x,'b> Bar1<'x,'b>`

compiler/rustc_mir_transform/src/check_const_item_mutation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'tcx> ConstMutationChecker<'_, 'tcx> {
7474
//
7575
// `unsafe { *FOO = 0; *BAR.field = 1; }`
7676
// `unsafe { &mut *FOO }`
77-
// `unsafe { (*ARRAY)[0] = val; }
77+
// `unsafe { (*ARRAY)[0] = val; }`
7878
if !place.projection.iter().any(|p| matches!(p, PlaceElem::Deref)) {
7979
let source_info = self.body.source_info(location);
8080
let lint_root = self.body.source_scopes[source_info.scope]

compiler/rustc_mir_transform/src/coverage/spans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl<'a, 'tcx> CoverageSpans<'a, 'tcx> {
407407
if self.prev().is_macro_expansion() && self.curr().is_macro_expansion() {
408408
// Macros that expand to include branching (such as
409409
// `assert_eq!()`, `assert_ne!()`, `info!()`, `debug!()`, or
410-
// `trace!()) typically generate callee spans with identical
410+
// `trace!()`) typically generate callee spans with identical
411411
// ranges (typically the full span of the macro) for all
412412
// `BasicBlocks`. This makes it impossible to distinguish
413413
// the condition (`if val1 != val2`) from the optional

compiler/rustc_mir_transform/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) ->
248248

249249
// N.B., this `borrow()` is guaranteed to be valid (i.e., the value
250250
// cannot yet be stolen), because `mir_promoted()`, which steals
251-
// from `mir_const(), forces this query to execute before
251+
// from `mir_const()`, forces this query to execute before
252252
// performing the steal.
253253
let body = &tcx.mir_const(def).borrow();
254254

compiler/rustc_mir_transform/src/lower_slice_len.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ fn lower_slice_len_call<'tcx>(
6868
ty::FnDef(fn_def_id, _) if fn_def_id == &slice_len_fn_item_def_id => {
6969
// perform modifications
7070
// from something like `_5 = core::slice::<impl [u8]>::len(move _6) -> bb1`
71-
// into `_5 = Len(*_6)
71+
// into:
72+
// ```
73+
// _5 = Len(*_6)
7274
// goto bb1
75+
// ```
7376

7477
// make new RValue for Len
7578
let deref_arg = tcx.mk_place_deref(arg);

compiler/rustc_parse/src/parser/attr_wrapper.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
134134
// Process the replace ranges, starting from the highest start
135135
// position and working our way back. If have tokens like:
136136
//
137-
// `#[cfg(FALSE)]` struct Foo { #[cfg(FALSE)] field: bool }`
137+
// `#[cfg(FALSE)] struct Foo { #[cfg(FALSE)] field: bool }`
138138
//
139139
// Then we will generate replace ranges for both
140140
// the `#[cfg(FALSE)] field: bool` and the entire
141-
// `#[cfg(FALSE)]` struct Foo { #[cfg(FALSE)] field: bool }`
141+
// `#[cfg(FALSE)] struct Foo { #[cfg(FALSE)] field: bool }`
142142
//
143143
// By starting processing from the replace range with the greatest
144144
// start position, we ensure that any replace range which encloses

compiler/rustc_parse/src/parser/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl TokenCursor {
335335
num_of_hashes = cmp::max(num_of_hashes, count);
336336
}
337337

338-
// `/// foo` becomes `doc = r"foo".
338+
// `/// foo` becomes `doc = r"foo"`.
339339
let delim_span = DelimSpan::from_single(span);
340340
let body = TokenTree::Delimited(
341341
delim_span,

compiler/rustc_passes/src/hir_stats.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
646646
}
647647

648648
// `UseTree` has one inline use (in `ast::ItemKind::Use`) and one
649-
// non-inline use (in `ast::UseTreeKind::Nested). The former case is more
649+
// non-inline use (in `ast::UseTreeKind::Nested`). The former case is more
650650
// common, so we don't implement `visit_use_tree` and tolerate the missed
651651
// coverage in the latter case.
652652

compiler/rustc_query_impl/src/on_disk_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
333333
},
334334
);
335335

336-
// `Encode the file footer.
336+
// Encode the file footer.
337337
let footer_pos = encoder.position() as u64;
338338
encoder.encode_tagged(
339339
TAG_FILE_FOOTER,

compiler/rustc_resolve/src/late/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
878878
);
879879
let is_assoc_fn = self.self_type_is_available();
880880
if let Some((fn_kind, span)) = &self.diagnostic_metadata.current_function {
881-
// The current function has a `self' parameter, but we were unable to resolve
881+
// The current function has a `self` parameter, but we were unable to resolve
882882
// a reference to `self`. This can only happen if the `self` identifier we
883883
// are resolving came from a different hygiene context.
884884
if fn_kind.decl().inputs.get(0).map_or(false, |p| p.is_self()) {

compiler/rustc_span/src/def_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<D: Decoder> Decodable<D> for DefIndex {
235235
pub struct DefId {
236236
// cfg-ing the order of fields so that the `DefIndex` which is high entropy always ends up in
237237
// the lower bits no matter the endianness. This allows the compiler to turn that `Hash` impl
238-
// into a direct call to 'u64::hash(_)`.
238+
// into a direct call to `u64::hash(_)`.
239239
#[cfg(not(all(target_pointer_width = "64", target_endian = "big")))]
240240
pub index: DefIndex,
241241
pub krate: CrateNum,

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ impl Interner {
19541954
let name = Symbol::new(inner.strings.len() as u32);
19551955

19561956
// SAFETY: we convert from `&str` to `&[u8]`, clone it into the arena,
1957-
// and immediately convert the clone back to `&[u8], all because there
1957+
// and immediately convert the clone back to `&[u8]`, all because there
19581958
// is no `inner.arena.alloc_str()` method. This is clearly safe.
19591959
let string: &str =
19601960
unsafe { str::from_utf8_unchecked(inner.arena.alloc_slice(string.as_bytes())) };

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
339339

340340
// Essentially any user-written impl will match with an error type,
341341
// so creating `ImplCandidates` isn't useful. However, we might
342-
// end up finding a candidate elsewhere (e.g. a `BuiltinCandidate` for `Sized)
342+
// end up finding a candidate elsewhere (e.g. a `BuiltinCandidate` for `Sized`)
343343
// This helps us avoid overflow: see issue #72839
344344
// Since compilation is already guaranteed to fail, this is just
345345
// to try to show the 'nicest' possible errors to the user.

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
727727
// Otherwise, we can say that `T: NonAutoTrait` is
728728
// true.
729729
// Let's imagine we have a predicate stack like
730-
// `Foo: Bar -> WF(T) -> T: NonAutoTrait -> T: Auto
730+
// `Foo: Bar -> WF(T) -> T: NonAutoTrait -> T: Auto`
731731
// depth ^1 ^2 ^3
732732
// and the current predicate is `WF(T)`. `wf_args`
733733
// would contain `(T, 1)`. We want to check all

0 commit comments

Comments
 (0)