diff options
| author | lcnr <rust@lcnr.de> | 2025-08-07 14:29:11 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-08-07 14:29:11 +0200 |
| commit | 8441f95ec70a2ee5cde4d1b8c81203860e4f5bb9 (patch) | |
| tree | ec51e9631f1dc01ed19045064129766ae28c3e32 /tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs | |
| parent | 064d5886544de3f28b0804fb15654ea49eb6b9c7 (diff) | |
| download | rust-8441f95ec70a2ee5cde4d1b8c81203860e4f5bb9.tar.gz rust-8441f95ec70a2ee5cde4d1b8c81203860e4f5bb9.zip | |
add opaque type member constraint tests
Diffstat (limited to 'tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs')
| -rw-r--r-- | tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs b/tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs index 4633ad68230..6860fc5e6a5 100644 --- a/tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs +++ b/tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs @@ -1,6 +1,7 @@ // Nested impl-traits can impose different member constraints on the same region variable. //@ check-pass +// FIXME(-Znext-solver): enable this test trait Cap<'a> {} impl<T> Cap<'_> for T {} @@ -8,7 +9,9 @@ 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] // from inner impl-trait -// To satisfy both we can only choose 'a. +// To satisfy both we can only choose 'a. Concretely, first member constraint requires ?15 +// to outlive at least 'b while the second requires ?15 to outlive 'a. As 'a outlives 'b we +// end up with 'a as the final member region. fn pass_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a>> + Cap<'b> where 's: 'a, |
