about summary refs log tree commit diff
path: root/tests/ui/lint
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-21 17:57:55 -0400
committerGitHub <noreply@github.com>2025-08-21 17:57:55 -0400
commit268ef7bafe340848f9323f27a1b4ac57f32aeda4 (patch)
treea78af0e44d46849d7ea0b0db9d81bfeac5e41a5a /tests/ui/lint
parentb426cb2af8b873b21c54e19cd55b43131b732bc7 (diff)
parentd18d94d8a0416f9013ad6e59ffae3d9e57382add (diff)
downloadrust-268ef7bafe340848f9323f27a1b4ac57f32aeda4.tar.gz
rust-268ef7bafe340848f9323f27a1b4ac57f32aeda4.zip
Rollup merge of #145672 - compiler-errors:query-instab-ice, r=lcnr
Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability

Fixes https://github.com/rust-lang/rust/issues/145652 which was introduced by https://github.com/rust-lang/rust/pull/139345 because we were skipping a binder before calling `Instance::try_resolve`.

r? lcnr
Diffstat (limited to 'tests/ui/lint')
-rw-r--r--tests/ui/lint/internal/higher-ranked-query-instability.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/lint/internal/higher-ranked-query-instability.rs b/tests/ui/lint/internal/higher-ranked-query-instability.rs
new file mode 100644
index 00000000000..4407baac0c6
--- /dev/null
+++ b/tests/ui/lint/internal/higher-ranked-query-instability.rs
@@ -0,0 +1,11 @@
+//@ check-pass
+//@ compile-flags: -Zunstable-options
+
+// Make sure we don't try to resolve instances for trait refs that have escaping
+// bound vars when computing the query instability lint.
+
+fn foo<T>() where for<'a> &'a [T]: IntoIterator<Item = &'a T> {}
+
+fn main() {
+    foo::<()>();
+}