Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rustdoc warnings about invalid Rust syntax #77559

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
/// it. However, it works pretty well in practice. In particular,
/// this is needed to deal with projection outlives bounds like
///
/// <T as Foo<'0>>::Item: '1
/// ```ignore (internal compiler representation so lifetime syntax is invalid)
/// <T as Foo<'0>>::Item: '1
/// ```
///
/// In particular, this routine winds up being important when
/// there are bounds like `where <T as Foo<'a>>::Item: 'b` in the
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_mir/src/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ pub fn write_allocations<'tcx>(
/// 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
/// format of this function is (*without* leading or trailing newline):
/// ```
///
/// ```text
/// size: {}, align: {}) {
/// <bytes>
/// }
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_trait_selection/src/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ pub struct OpaqueTypeDecl<'tcx> {
/// then `substs` would be `['a, T]`.
pub substs: SubstsRef<'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:
///
/// ```
/// ```ignore (incomplete snippet)
/// type Foo = impl Baz;
camelid marked this conversation as resolved.
Show resolved Hide resolved
/// 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
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/check/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
/// ```ignore (diagnostic)
/// ```text
/// error: missing field `you_can_use_this_field` in initializer of `foo::Foo`
/// --> src/main.rs:8:5
/// |
Expand Down Expand Up @@ -1327,7 +1327,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

/// 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
/// --> src/main.rs:8:5
/// |
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/check/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// Returns a diagnostic reporting a struct pattern which is missing an `..` due to
/// inaccessible fields.
///
/// ```ignore (diagnostic)
/// ```text
/// error: pattern requires `..` due to inaccessible fields
/// --> src/main.rs:10:9
/// |
Expand Down Expand Up @@ -1431,7 +1431,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

/// 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`
/// --> src/main.rs:15:9
/// |
Expand Down