|
1 | 1 | use rustc_hir::def_id::LocalDefId; |
2 | 2 | use rustc_hir::intravisit::FnKind; |
3 | 3 | use rustc_hir::{Body,FnDecl}; |
4 | | -use rustc_lint::Level::Deny; |
5 | | -use rustc_lint::{LateContext,LateLintPass,Lint}; |
| 4 | +use rustc_lint::{LateContext,LateLintPass}; |
6 | 5 | use rustc_session::declare_lint_pass; |
7 | 6 | use rustc_span::Span; |
8 | 7 |
|
9 | | -/// Ensures that Constant-time Function Evaluation is being done (specifically, MIR lint passes). |
10 | | -/// As Clippy deactivates codegen, this lint ensures that CTFE (used in hard errors) is still ran. |
11 | | -pubstaticCLIPPY_CTFE:&Lint = &Lint{ |
12 | | -name:&"clippy::CLIPPY_CTFE", |
13 | | -default_level:Deny, |
14 | | -desc:"Ensure CTFE is being made", |
15 | | -edition_lint_opts:None, |
16 | | -report_in_external_macro:true, |
17 | | -future_incompatible:None, |
18 | | -is_externally_loaded:true, |
19 | | -crate_level_only:false, |
20 | | -eval_always:true, |
21 | | - ..Lint::default_fields_for_macro() |
22 | | -}; |
23 | 8 |
|
24 | | -// No static CLIPPY_CTFE_INFO because we want this lint to be invisible |
25 | | - |
26 | | -declare_lint_pass!{ClippyCtfe => [CLIPPY_CTFE]} |
| 9 | +declare_lint_pass!{ |
| 10 | +/// Ensures that Constant-time Function Evaluation is being done (specifically, MIR lint passes). |
| 11 | +/// As Clippy deactivates codegen, this lint ensures that CTFE (used in hard errors) is still ran. |
| 12 | +ClippyCtfe => [] |
| 13 | +} |
27 | 14 |
|
28 | 15 | impl<'tcx>LateLintPass<'tcx>forClippyCtfe{ |
29 | 16 | fncheck_fn( |
|
0 commit comments