diff options
| author | bors <bors@rust-lang.org> | 2021-10-29 04:55:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-29 04:55:51 +0000 |
| commit | 88a5a984fe95e0411dce4e8364f9630cadd3782c (patch) | |
| tree | ff8fc8e9649e80411c4bf8d07cf9e7bd9630172a /src | |
| parent | a9f664f37d62fd255827a416482186308b8e8f7d (diff) | |
| parent | 3215eeb99f055e4c00bc66c2b424e49f5868811b (diff) | |
Auto merge of #90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr
Revert "Add rustc lint, warning when iterating over hashmaps" Fixes perf regressions introduced in https://github.com/rust-lang/rust/pull/90235 by temporarily reverting the relevant PR.
Diffstat (limited to 'src')
4 files changed, 0 insertions, 95 deletions
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.rs b/src/test/ui-fulldeps/internal-lints/query_stability.rs deleted file mode 100644 index 560675b4486..00000000000 --- a/src/test/ui-fulldeps/internal-lints/query_stability.rs +++ /dev/null @@ -1,24 +0,0 @@ -// compile-flags: -Z unstable-options - -#![feature(rustc_private)] -#![deny(rustc::potential_query_instability)] - -extern crate rustc_data_structures; - -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; - -fn main() { - let mut x = FxHashMap::<u32, i32>::default(); - - for _ in x.drain() {} - //~^ ERROR using `drain` can result in unstable - - for _ in x.iter() {} - //~^ ERROR using `iter` - - for _ in Some(&mut x).unwrap().iter_mut() {} - //~^ ERROR using `iter_mut` - - for _ in x {} - //~^ ERROR using `into_iter` -} diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.stderr b/src/test/ui-fulldeps/internal-lints/query_stability.stderr deleted file mode 100644 index 7e8b448f41a..00000000000 --- a/src/test/ui-fulldeps/internal-lints/query_stability.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error: using `drain` can result in unstable query results - --> $DIR/query_stability.rs:13:16 - | -LL | for _ in x.drain() {} - | ^^^^^ - | -note: the lint level is defined here - --> $DIR/query_stability.rs:4:9 - | -LL | #![deny(rustc::potential_query_instability)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale - -error: using `iter` can result in unstable query results - --> $DIR/query_stability.rs:16:16 - | -LL | for _ in x.iter() {} - | ^^^^ - | - = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale - -error: using `iter_mut` can result in unstable query results - --> $DIR/query_stability.rs:19:36 - | -LL | for _ in Some(&mut x).unwrap().iter_mut() {} - | ^^^^^^^^ - | - = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale - -error: using `into_iter` can result in unstable query results - --> $DIR/query_stability.rs:22:14 - | -LL | for _ in x {} - | ^ - | - = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale - -error: aborting due to 4 previous errors - diff --git a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs deleted file mode 100644 index f478b73329e..00000000000 --- a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags: -Z unstable-options - -#![feature(rustc_attrs)] - -#[rustc_lint_query_instability] -//~^ ERROR attribute should be applied to a function -struct Foo; - -impl Foo { - #[rustc_lint_query_instability(a)] - //~^ ERROR malformed `rustc_lint_query_instability` - fn bar() {} -} - -fn main() {} diff --git a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr b/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr deleted file mode 100644 index b5156f2ac59..00000000000 --- a/src/test/ui-fulldeps/internal-lints/query_stability_incorrect.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: malformed `rustc_lint_query_instability` attribute input - --> $DIR/query_stability_incorrect.rs:10:5 - | -LL | #[rustc_lint_query_instability(a)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_lint_query_instability]` - -error: attribute should be applied to a function - --> $DIR/query_stability_incorrect.rs:5:1 - | -LL | #[rustc_lint_query_instability] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | -LL | struct Foo; - | ----------- not a function - -error: aborting due to 2 previous errors - |
