Skip to content

Commit e427a4e

Browse files
committed
Remove module passes filtering
1 parent 8f8aa46 commit e427a4e

File tree

4 files changed

+22
-36
lines changed

4 files changed

+22
-36
lines changed

clippy_lints/src/cognitive_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub static COGNITIVE_COMPLEXITY: &Lint = &Lint {
2525
future_incompatible: None,
2626
is_externally_loaded: true,
2727
crate_level_only: false,
28-
loadbearing: true,
28+
eval_always: true,
2929
..Lint::default_fields_for_macro()
3030
};
3131
pub(crate) static COGNITIVE_COMPLEXITY_INFO: &'static LintInfo = &LintInfo {
@@ -44,7 +44,7 @@ Sometimes it's hard to find a way to reduce the complexity.
4444
### Example
4545
You'll see it when you get the warning.",
4646
version: Some("1.35.0"),
47-
location: "#L0",
47+
location: "clippy_lints/src/cognitive_complexity.rs#L47",
4848
};
4949

5050
pub struct CognitiveComplexity {

clippy_lints/src/ctfe.rs

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,28 @@
11
use rustc_hir::def_id::LocalDefId;
22
use rustc_hir::intravisit::FnKind;
33
use rustc_hir::{Body, FnDecl};
4-
use rustc_lint::{LateContext, LateLintPass};
4+
use rustc_lint::Level::Deny;
5+
use rustc_lint::{LateContext, LateLintPass, Lint};
56
use rustc_session::declare_lint_pass;
67
use rustc_span::Span;
78

8-
declare_clippy_lint! {
9-
/// ### What it does
10-
/// Checks for comparisons where one side of the relation is
11-
/// either the minimum or maximum value for its type and warns if it involves a
12-
/// case that is always true or always false. Only integer and boolean types are
13-
/// checked.
14-
///
15-
/// ### Why is this bad?
16-
/// An expression like `min <= x` may misleadingly imply
17-
/// that it is possible for `x` to be less than the minimum. Expressions like
18-
/// `max < x` are probably mistakes.
19-
///
20-
/// ### Known problems
21-
/// For `usize` the size of the current compile target will
22-
/// be assumed (e.g., 64 bits on 64 bit systems). This means code that uses such
23-
/// a comparison to detect target pointer width will trigger this lint. One can
24-
/// use `mem::sizeof` and compare its value or conditional compilation
25-
/// attributes
26-
/// like `#[cfg(target_pointer_width = "64")] ..` instead.
27-
///
28-
/// ### Example
29-
/// ```no_run
30-
/// let vec: Vec<isize> = Vec::new();
31-
/// if vec.len() <= 0 {}
32-
/// if 100 > i32::MAX {}
33-
/// ```
34-
#[clippy::version = "1.82.0"]
35-
pub CLIPPY_CTFE,
36-
correctness,
37-
"a comparison with a maximum or minimum value that is always true or false"
38-
}
9+
/// Ensures that Constant-time Function Evaluation is being done (specifically, MIR lint passes).
10+
/// See rust-lang/rust#125116 for more info.
11+
#[clippy::version = "1.82.0"]
12+
pub static CLIPPY_CTFE: &Lint = &Lint {
13+
name: &"clippy::CLIPPY_CTFE",
14+
default_level: Deny,
15+
desc: "Ensure CTFE is being made",
16+
edition_lint_opts: None,
17+
report_in_external_macro: true,
18+
future_incompatible: None,
19+
is_externally_loaded: true,
20+
crate_level_only: false,
21+
eval_always: true,
22+
..Lint::default_fields_for_macro()
23+
};
24+
25+
// No static CLIPPY_CTFE_INFO because we want this lint to be invisible
3926

4027
declare_lint_pass! { ClippyCtfe => [CLIPPY_CTFE] }
4128

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extern crate clippy_utils;
6565
#[cfg_attr(feature = "internal", allow(clippy::missing_clippy_version_attribute))]
6666
mod utils;
6767

68-
pub mod ctfe; // VERY important lint (rust#125116)
68+
pub mod ctfe; // Very important lint (rust#125116)
6969
pub mod declared_lints;
7070
pub mod deprecated_lints;
7171

clippy_lints/src/utils/author.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,4 +798,3 @@ fn path_to_string(path: &QPath<'_>) -> Result<String, ()> {
798798
inner(&mut s, path)?;
799799
Ok(s)
800800
}
801-

0 commit comments

Comments
 (0)