Skip to content

Commit 2970af8

Browse files
authored
Rollup merge of #77559 - camelid:fix-rustdoc-warnings-invalid-rust-syntax, r=lcnr
Fix rustdoc warnings about invalid Rust syntax
2 parents 54d72d7 + c8d25af commit 2970af8

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

compiler/rustc_mir/src/borrow_check/region_infer/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
12251225
/// it. However, it works pretty well in practice. In particular,
12261226
/// this is needed to deal with projection outlives bounds like
12271227
///
1228-
/// <T as Foo<'0>>::Item: '1
1228+
/// ```ignore (internal compiler representation so lifetime syntax is invalid)
1229+
/// <T as Foo<'0>>::Item: '1
1230+
/// ```
12291231
///
12301232
/// In particular, this routine winds up being important when
12311233
/// there are bounds like `where <T as Foo<'a>>::Item: 'b` in the

compiler/rustc_mir/src/util/pretty.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ pub fn write_allocations<'tcx>(
671671
/// Dumps the size and metadata and content of an allocation to the given writer.
672672
/// The expectation is that the caller first prints other relevant metadata, so the exact
673673
/// format of this function is (*without* leading or trailing newline):
674-
/// ```
674+
///
675+
/// ```text
675676
/// size: {}, align: {}) {
676677
/// <bytes>
677678
/// }

compiler/rustc_trait_selection/src/opaque_types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ pub struct OpaqueTypeDecl<'tcx> {
3838
/// then `substs` would be `['a, T]`.
3939
pub substs: SubstsRef<'tcx>,
4040

41-
/// The span of this particular definition of the opaque type. So
41+
/// The span of this particular definition of the opaque type. So
4242
/// for example:
4343
///
44-
/// ```
44+
/// ```ignore (incomplete snippet)
4545
/// type Foo = impl Baz;
4646
/// fn bar() -> Foo {
47-
/// ^^^ This is the span we are looking for!
47+
/// // ^^^ This is the span we are looking for!
4848
/// ```
4949
///
5050
/// In cases where the fn returns `(impl Trait, impl Trait)` or

compiler/rustc_typeck/src/check/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12751275

12761276
/// Report an error for a struct field expression when there are fields which aren't provided.
12771277
///
1278-
/// ```ignore (diagnostic)
1278+
/// ```text
12791279
/// error: missing field `you_can_use_this_field` in initializer of `foo::Foo`
12801280
/// --> src/main.rs:8:5
12811281
/// |
@@ -1327,7 +1327,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13271327

13281328
/// Report an error for a struct field expression when there are no visible fields.
13291329
///
1330-
/// ```ignore (diagnostic)
1330+
/// ```text
13311331
/// error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
13321332
/// --> src/main.rs:8:5
13331333
/// |

compiler/rustc_typeck/src/check/pat.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13811381
/// Returns a diagnostic reporting a struct pattern which is missing an `..` due to
13821382
/// inaccessible fields.
13831383
///
1384-
/// ```ignore (diagnostic)
1384+
/// ```text
13851385
/// error: pattern requires `..` due to inaccessible fields
13861386
/// --> src/main.rs:10:9
13871387
/// |
@@ -1431,7 +1431,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14311431

14321432
/// Returns a diagnostic reporting a struct pattern which does not mention some fields.
14331433
///
1434-
/// ```ignore (diagnostic)
1434+
/// ```text
14351435
/// error[E0027]: pattern does not mention field `you_cant_use_this_field`
14361436
/// --> src/main.rs:15:9
14371437
/// |

0 commit comments

Comments
 (0)