Skip to content

Commit 420b986

Browse files
committed
Fix duplicate warning; merge test into tests/ui-fulldeps/internal-lints
1 parent 1a2c5a3 commit 420b986

File tree

5 files changed

+15
-27
lines changed

5 files changed

+15
-27
lines changed

compiler/rustc_lint/src/internal.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ fn check_into_iter_stability<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx
133133
let Some(into_iterator_def_id) = cx.tcx.get_diagnostic_item(sym::IntoIterator) else {
134134
return;
135135
};
136+
if expr.span.from_expansion() {
137+
return;
138+
};
136139
// Is `expr` a function or method call?
137140
let Some((callee_def_id, generic_args, recv, args)) =
138141
get_callee_generic_args_and_args(cx, expr)

tests/ui-fulldeps/internal-lints/query_stability.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ fn main() {
3434
//~^ ERROR using `values_mut` can result in unstable query results
3535
*val = *val + 10;
3636
}
37+
38+
FxHashMap::<u32, i32>::default().extend(x);
39+
//~^ ERROR using `into_iter` can result in unstable query results
3740
}

tests/ui-fulldeps/internal-lints/query_stability.stderr

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,13 @@ LL | for val in x.values_mut() {
5959
|
6060
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
6161

62-
error: aborting due to 7 previous errors
62+
error: using `into_iter` can result in unstable query results
63+
--> $DIR/query_stability.rs:38:45
64+
|
65+
LL | FxHashMap::<u32, i32>::default().extend(x);
66+
| ^
67+
|
68+
= note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
69+
70+
error: aborting due to 8 previous errors
6371

tests/ui/internal-lints/query_stability_into_iter.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/internal-lints/query_stability_into_iter.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)