Skip to content

Commit

Permalink
Rollup merge of rust-lang#103484 - saschanaz:patch-2, r=ehuss
Browse files Browse the repository at this point in the history
Add `rust` to `let_underscore_lock` example

Currently https://doc.rust-lang.org/beta/rustc/lints/listing/deny-by-default.html#let-underscore-lock has no colored grammar and raw `{{produces}}` command is exposed.
  • Loading branch information
Dylan-DPC committed Nov 16, 2022
2 parents 9cb5855 + 0a528b1 commit af25137
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/let_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare_lint! {
/// of at end of scope, which is typically incorrect.
///
/// ### Example
/// ```compile_fail
/// ```rust,compile_fail
/// use std::sync::{Arc, Mutex};
/// use std::thread;
/// let data = Arc::new(Mutex::new(0));
Expand Down
14 changes: 9 additions & 5 deletions compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,23 @@ declare_lint! {
///
/// ### Example
///
/// ```
/// ```rust
/// trait Duh {}
///
/// impl Duh for i32 {}
///
/// trait Trait {
/// type Assoc: Send;
/// type Assoc: Duh;
/// }
///
/// struct Struct;
///
/// impl Trait for Struct {
/// type Assoc = i32;
/// impl<F: Duh> Trait for F {
/// type Assoc = F;
/// }
///
/// fn test() -> impl Trait<Assoc = impl Sized> {
/// Struct
/// 42
/// }
/// ```
///
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ declare_lint! {
///
/// ### Example
///
/// ```
/// ```rust
/// #[warn(unused_tuple_struct_fields)]
/// struct S(i32, i32, i32);
/// let s = S(1, 2, 3);
Expand Down Expand Up @@ -1154,7 +1154,7 @@ declare_lint! {
///
/// ### Example
///
/// ```compile_fail
/// ```rust,compile_fail
/// #[repr(packed)]
/// pub struct Foo {
/// field1: u64,
Expand Down Expand Up @@ -2548,7 +2548,7 @@ declare_lint! {
///
/// ### Example
///
/// ```compile_fail
/// ```rust,compile_fail
/// # #![allow(unused)]
/// enum E {
/// A,
Expand Down Expand Up @@ -3918,7 +3918,7 @@ declare_lint! {
///
/// ### Example
///
/// ```
/// ```rust
/// #![allow(test_unstable_lint)]
/// ```
///
Expand Down
6 changes: 2 additions & 4 deletions src/tools/lint-docs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ impl Lint {
}

fn is_ignored(&self) -> bool {
self.doc
.iter()
.filter(|line| line.starts_with("```rust"))
.all(|line| line.contains(",ignore"))
let blocks: Vec<_> = self.doc.iter().filter(|line| line.starts_with("```rust")).collect();
!blocks.is_empty() && blocks.iter().all(|line| line.contains(",ignore"))
}

/// Checks the doc style of the lint.
Expand Down

0 comments on commit af25137

Please sign in to comment.