Skip to content

Remove ClippyCtfe pass #14712

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 0 additions & 26 deletions clippy_lints/src/ctfe.rs

This file was deleted.

3 changes: 0 additions & 3 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ extern crate clippy_utils;

mod utils;

pub mod ctfe; // Very important lint, do not remove (rust#125116)
pub mod declared_lints;
pub mod deprecated_lints;

Expand Down Expand Up @@ -583,8 +582,6 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
let attrs = attr_storage.clone();
store.register_early_pass(move || Box::new(AttrCollector::new(attrs.clone())));

store.register_late_pass(|_| Box::new(ctfe::ClippyCtfe));

store.register_late_pass(move |_| Box::new(operators::arithmetic_side_effects::ArithmeticSideEffects::new(conf)));
store.register_late_pass(|_| Box::new(utils::dump_hir::DumpHir));
store.register_late_pass(|_| Box::new(utils::author::Author));
Expand Down
7 changes: 3 additions & 4 deletions tests/ui/crashes/ice-9463.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#![deny(arithmetic_overflow)]
//@check-pass

fn main() {
let _x = -1_i32 >> -1;
//~^ ERROR: this arithmetic operation will overflow
#[expect(overflowing_literals)]
let _y = 1u32 >> 10000000000000u32;
//~^ ERROR: this arithmetic operation will overflow
//~| ERROR: literal out of range
}
29 changes: 0 additions & 29 deletions tests/ui/crashes/ice-9463.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/indexing_slicing_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn main() {
// This should be linted, since `suppress-restriction-lint-in-const` default is false.
const { &ARR[idx4()] };
//~^ ERROR: indexing may panic
//~| ERROR: evaluation of `main

let y = &x;
// Ok, referencing shouldn't affect this lint. See the issue 6021
Expand Down
31 changes: 9 additions & 22 deletions tests/ui/indexing_slicing_index.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-re
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`

error[E0080]: evaluation of `main::{constant#3}` failed
--> tests/ui/indexing_slicing_index.rs:69:14
|
LL | const { &ARR[idx4()] };
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4

note: erroneous constant encountered
--> tests/ui/indexing_slicing_index.rs:69:5
|
LL | const { &ARR[idx4()] };
| ^^^^^^^^^^^^^^^^^^^^^^

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:48:5
|
Expand Down Expand Up @@ -63,63 +51,62 @@ LL | const { &ARR[idx4()] };
= note: the suggestion might not be applicable in constant blocks

error: index is out of bounds
--> tests/ui/indexing_slicing_index.rs:77:5
--> tests/ui/indexing_slicing_index.rs:76:5
|
LL | y[4];
| ^^^^

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:81:5
--> tests/ui/indexing_slicing_index.rs:80:5
|
LL | v[0];
| ^^^^
|
= help: consider using `.get(n)` or `.get_mut(n)` instead

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:83:5
--> tests/ui/indexing_slicing_index.rs:82:5
|
LL | v[10];
| ^^^^^
|
= help: consider using `.get(n)` or `.get_mut(n)` instead

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:85:5
--> tests/ui/indexing_slicing_index.rs:84:5
|
LL | v[1 << 3];
| ^^^^^^^^^
|
= help: consider using `.get(n)` or `.get_mut(n)` instead

error: index is out of bounds
--> tests/ui/indexing_slicing_index.rs:93:5
--> tests/ui/indexing_slicing_index.rs:92:5
|
LL | x[N];
| ^^^^

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:97:5
--> tests/ui/indexing_slicing_index.rs:96:5
|
LL | v[N];
| ^^^^
|
= help: consider using `.get(n)` or `.get_mut(n)` instead

error: indexing may panic
--> tests/ui/indexing_slicing_index.rs:99:5
--> tests/ui/indexing_slicing_index.rs:98:5
|
LL | v[M];
| ^^^^
|
= help: consider using `.get(n)` or `.get_mut(n)` instead

error: index is out of bounds
--> tests/ui/indexing_slicing_index.rs:103:13
--> tests/ui/indexing_slicing_index.rs:102:13
|
LL | let _ = x[4];
| ^^^^

error: aborting due to 15 previous errors
error: aborting due to 14 previous errors

For more information about this error, try `rustc --explain E0080`.