Fix duplicate warning; merge test into tests/ui-fulldeps/internal-lints

This commit is contained in:
Samuel Moelius 2025-04-04 15:22:09 -04:00
parent 1a2c5a35b9
commit 420b9864b7
5 changed files with 15 additions and 27 deletions

View File

@ -133,6 +133,9 @@ fn check_into_iter_stability<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx
let Some(into_iterator_def_id) = cx.tcx.get_diagnostic_item(sym::IntoIterator) else {
return;
};
if expr.span.from_expansion() {
return;
};
// Is `expr` a function or method call?
let Some((callee_def_id, generic_args, recv, args)) =
get_callee_generic_args_and_args(cx, expr)

View File

@ -34,4 +34,7 @@ fn main() {
//~^ ERROR using `values_mut` can result in unstable query results
*val = *val + 10;
}
FxHashMap::<u32, i32>::default().extend(x);
//~^ ERROR using `into_iter` can result in unstable query results
}

View File

@ -59,5 +59,13 @@ LL | for val in x.values_mut() {
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: aborting due to 7 previous errors
error: using `into_iter` can result in unstable query results
--> $DIR/query_stability.rs:38:45
|
LL | FxHashMap::<u32, i32>::default().extend(x);
| ^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: aborting due to 8 previous errors

View File

@ -1,11 +0,0 @@
//@ compile-flags: -Z unstable-options
#![deny(rustc::potential_query_instability)]
use std::collections::HashSet;
fn main() {
let set = HashSet::<u32>::default();
HashSet::<u32>::default().extend(set);
//~^ ERROR using `into_iter` can result in unstable query results
}

View File

@ -1,15 +0,0 @@
error: using `into_iter` can result in unstable query results
--> $DIR/query_stability_into_iter.rs:9:38
|
LL | HashSet::<u32>::default().extend(set);
| ^^^
|
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
note: the lint level is defined here
--> $DIR/query_stability_into_iter.rs:3:9
|
LL | #![deny(rustc::potential_query_instability)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error