Rollup merge of #77559 - camelid:fix-rustdoc-warnings-invalid-rust-syntax, r=lcnr
Fix rustdoc warnings about invalid Rust syntax
This commit is contained in:
commit
2970af8e28
|
@ -1225,7 +1225,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||||
/// it. However, it works pretty well in practice. In particular,
|
/// it. However, it works pretty well in practice. In particular,
|
||||||
/// this is needed to deal with projection outlives bounds like
|
/// this is needed to deal with projection outlives bounds like
|
||||||
///
|
///
|
||||||
|
/// ```ignore (internal compiler representation so lifetime syntax is invalid)
|
||||||
/// <T as Foo<'0>>::Item: '1
|
/// <T as Foo<'0>>::Item: '1
|
||||||
|
/// ```
|
||||||
///
|
///
|
||||||
/// In particular, this routine winds up being important when
|
/// In particular, this routine winds up being important when
|
||||||
/// there are bounds like `where <T as Foo<'a>>::Item: 'b` in the
|
/// there are bounds like `where <T as Foo<'a>>::Item: 'b` in the
|
||||||
|
|
|
@ -671,7 +671,8 @@ pub fn write_allocations<'tcx>(
|
||||||
/// Dumps the size and metadata and content of an allocation to the given writer.
|
/// Dumps the size and metadata and content of an allocation to the given writer.
|
||||||
/// The expectation is that the caller first prints other relevant metadata, so the exact
|
/// The expectation is that the caller first prints other relevant metadata, so the exact
|
||||||
/// format of this function is (*without* leading or trailing newline):
|
/// format of this function is (*without* leading or trailing newline):
|
||||||
/// ```
|
///
|
||||||
|
/// ```text
|
||||||
/// size: {}, align: {}) {
|
/// size: {}, align: {}) {
|
||||||
/// <bytes>
|
/// <bytes>
|
||||||
/// }
|
/// }
|
||||||
|
|
|
@ -41,10 +41,10 @@ pub struct OpaqueTypeDecl<'tcx> {
|
||||||
/// The span of this particular definition of the opaque type. So
|
/// The span of this particular definition of the opaque type. So
|
||||||
/// for example:
|
/// for example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```ignore (incomplete snippet)
|
||||||
/// type Foo = impl Baz;
|
/// type Foo = impl Baz;
|
||||||
/// fn bar() -> Foo {
|
/// fn bar() -> Foo {
|
||||||
/// ^^^ This is the span we are looking for!
|
/// // ^^^ This is the span we are looking for!
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// In cases where the fn returns `(impl Trait, impl Trait)` or
|
/// In cases where the fn returns `(impl Trait, impl Trait)` or
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
/// Report an error for a struct field expression when there are fields which aren't provided.
|
/// Report an error for a struct field expression when there are fields which aren't provided.
|
||||||
///
|
///
|
||||||
/// ```ignore (diagnostic)
|
/// ```text
|
||||||
/// error: missing field `you_can_use_this_field` in initializer of `foo::Foo`
|
/// error: missing field `you_can_use_this_field` in initializer of `foo::Foo`
|
||||||
/// --> src/main.rs:8:5
|
/// --> src/main.rs:8:5
|
||||||
/// |
|
/// |
|
||||||
|
@ -1327,7 +1327,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
/// Report an error for a struct field expression when there are no visible fields.
|
/// Report an error for a struct field expression when there are no visible fields.
|
||||||
///
|
///
|
||||||
/// ```ignore (diagnostic)
|
/// ```text
|
||||||
/// error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
|
/// error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
|
||||||
/// --> src/main.rs:8:5
|
/// --> src/main.rs:8:5
|
||||||
/// |
|
/// |
|
||||||
|
|
|
@ -1381,7 +1381,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
/// Returns a diagnostic reporting a struct pattern which is missing an `..` due to
|
/// Returns a diagnostic reporting a struct pattern which is missing an `..` due to
|
||||||
/// inaccessible fields.
|
/// inaccessible fields.
|
||||||
///
|
///
|
||||||
/// ```ignore (diagnostic)
|
/// ```text
|
||||||
/// error: pattern requires `..` due to inaccessible fields
|
/// error: pattern requires `..` due to inaccessible fields
|
||||||
/// --> src/main.rs:10:9
|
/// --> src/main.rs:10:9
|
||||||
/// |
|
/// |
|
||||||
|
@ -1431,7 +1431,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
/// Returns a diagnostic reporting a struct pattern which does not mention some fields.
|
/// Returns a diagnostic reporting a struct pattern which does not mention some fields.
|
||||||
///
|
///
|
||||||
/// ```ignore (diagnostic)
|
/// ```text
|
||||||
/// error[E0027]: pattern does not mention field `you_cant_use_this_field`
|
/// error[E0027]: pattern does not mention field `you_cant_use_this_field`
|
||||||
/// --> src/main.rs:15:9
|
/// --> src/main.rs:15:9
|
||||||
/// |
|
/// |
|
||||||
|
|
Loading…
Reference in New Issue