about summary refs log tree commit diff
path: root/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2025-08-07 14:20:19 +0200
committerlcnr <rust@lcnr.de>2025-08-07 14:20:19 +0200
commit064d5886544de3f28b0804fb15654ea49eb6b9c7 (patch)
tree0a119ee2e03d2dcd0484aad908f464f02b08f425 /tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
parent61cb1e97fcf954c37d0a457a8084ed9ad8b3cb82 (diff)
downloadrust-064d5886544de3f28b0804fb15654ea49eb6b9c7.tar.gz
rust-064d5886544de3f28b0804fb15654ea49eb6b9c7.zip
move member-constraints tests
Diffstat (limited to 'tests/ui/nll/member-constraints/nested-impl-trait-fail.rs')
-rw-r--r--tests/ui/nll/member-constraints/nested-impl-trait-fail.rs33
1 files changed, 0 insertions, 33 deletions
diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs b/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
deleted file mode 100644
index 0bf32a2624f..00000000000
--- a/tests/ui/nll/member-constraints/nested-impl-trait-fail.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Nested impl-traits can impose different member constraints on the same region variable.
-
-//@ check-fail
-
-trait Cap<'a> {}
-impl<T> Cap<'_> for T {}
-
-// Assuming the hidden type is `[&'?15 u8; 1]`, we have two distinct member constraints:
-// - '?15 member ['static, 'a, 'b] // from outer impl-trait
-// - '?15 member ['static, 'a, 'b] // from inner impl-trait
-// To satisfy both we can choose 'a or 'b, so it's a failure due to ambiguity.
-fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>
-where
-    's: 'a,
-    's: 'b,
-{
-    [a]
-    //~^ ERROR E0700
-    //~| ERROR E0700
-}
-
-// Same as the above but with late-bound regions.
-fn fail_late_bound<'s, 'a, 'b>(
-    a: &'s u8,
-    _: &'a &'s u8,
-    _: &'b &'s u8,
-) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> {
-    [a]
-    //~^ ERROR E0700
-    //~| ERROR E0700
-}
-
-fn main() {}