Repository: rust-lang/rust
File: compiler/rustc_lint_defs/src/builtin.rs (Rust)

Code before:
    ///     y => (),
    ///     5 => (),
    /// }
    /// ```
    ///
    /// {{produces}}
    ///
    /// ### Explanation
    ///
    /// This usually indicates a mistake in how the patterns are specified or
    /// ordered. In this example, the `y` pattern will always match, so the
    /// five is impossible to reach. Remember, match arms match in order, you
    /// probably wanted to put the `5` case above the `y` case.
    pub UNREACHABLE_PATTERNS,
    Warn,
    "detects unreachable patterns"
}

declare_lint! {
    /// The `unreachable_cfg_select_predicates` lint detects unreachable configuration
    /// predicates in the `cfg_select!` macro.
    ///
    /// ### Example
    ///
    /// ```rust
    /// cfg_select! {
    ///     _ => (),
    ///     windows => (),
    /// }
    /// ```
    ///
    /// {{produces}}
    ///
    /// ### Explanation
    ///
    /// This usually indicates a mistake in how the predicates are specified or
    /// ordered. In this example, the `_` predicate will always match, so the
    /// `windows` is impossible to reach. Remember, arms match in order, you
    /// probably wanted to put the `windows` case above the `_` case.
    pub UNREACHABLE_CFG_SELECT_PREDICATES,
    Warn,
    "detects unreachable configuration predicates in the cfg_select macro",
}

declare_lint! {
    /// The `overlapping_range_endpoints` lint detects `match` arms that have [range patterns] that
    /// overlap on their endpoints.
    ///
    /// [range patterns]: https://doc.rust-lang.org/nightly/reference/patterns.html#range-patterns
    ///
    /// ### Example

Review comment (bug):
re. the CI failure, I guess this should use `bootstrap` somehow? and maybe hide it with a `# ` because users don't need to know about it?

Code after:
    ///     y => (),
    ///     5 => (),
    /// }
    /// ```
    ///
    /// {{produces}}
    ///
    /// ### Explanation
    ///
    /// This usually indicates a mistake in how the patterns are specified or
    /// ordered. In this example, the `y` pattern will always match, so the
    /// five is impossible to reach. Remember, match arms match in order, you
    /// probably wanted to put the `5` case above the `y` case.
    pub UNREACHABLE_PATTERNS,
    Warn,
    "detects unreachable patterns"
}

declare_lint! {
    /// The `unreachable_cfg_select_predicates` lint detects unreachable configuration
    /// predicates in the `cfg_select!` macro.
    ///
    /// ### Example
    ///
    /// ```rust
    /// # #![cfg_attr(bootstrap, feature(cfg_select))]
    /// cfg_select! {
    ///     _ => (),
    ///     windows => (),
    /// }
    /// ```
    ///
    /// {{produces}}
    ///
    /// ### Explanation
    ///
    /// This usually indicates a mistake in how the predicates are specified or
    /// ordered. In this example, the `_` predicate will always match, so the
    /// `windows` is impossible to reach. Remember, arms match in order, you
    /// probably wanted to put the `windows` case above the `_` case.
    pub UNREACHABLE_CFG_SELECT_PREDICATES,
    Warn,
    "detects unreachable configuration predicates in the cfg_select macro",
}

declare_lint! {
    /// The `overlapping_range_endpoints` lint detects `match` arms that have [range patterns] that
    /// overlap on their endpoints.
    ///
    /// [range patterns]: https://doc.rust-lang.org/nightly/reference/patterns.html#range-patterns
    ///