From 064d5886544de3f28b0804fb15654ea49eb6b9c7 Mon Sep 17 00:00:00 2001 From: lcnr Date: Thu, 7 Aug 2025 14:20:19 +0200 Subject: move member-constraints tests --- .../min-choice-reject-ambiguous.rs | 43 ++++++++++++++ .../min-choice-reject-ambiguous.stderr | 48 ++++++++++++++++ .../ui/impl-trait/member-constraints/min-choice.rs | 34 +++++++++++ .../member-constraints/nested-impl-trait-fail.rs | 33 +++++++++++ .../nested-impl-trait-fail.stderr | 67 ++++++++++++++++++++++ .../member-constraints/nested-impl-trait-pass.rs | 29 ++++++++++ .../min-choice-reject-ambiguous.rs | 43 -------------- .../min-choice-reject-ambiguous.stderr | 48 ---------------- tests/ui/nll/member-constraints/min-choice.rs | 34 ----------- .../member-constraints/nested-impl-trait-fail.rs | 33 ----------- .../nested-impl-trait-fail.stderr | 67 ---------------------- .../member-constraints/nested-impl-trait-pass.rs | 29 ---------- 12 files changed, 254 insertions(+), 254 deletions(-) create mode 100644 tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.rs create mode 100644 tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.stderr create mode 100644 tests/ui/impl-trait/member-constraints/min-choice.rs create mode 100644 tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.rs create mode 100644 tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.stderr create mode 100644 tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs delete mode 100644 tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs delete mode 100644 tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr delete mode 100644 tests/ui/nll/member-constraints/min-choice.rs delete mode 100644 tests/ui/nll/member-constraints/nested-impl-trait-fail.rs delete mode 100644 tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr delete mode 100644 tests/ui/nll/member-constraints/nested-impl-trait-pass.rs diff --git a/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.rs b/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.rs new file mode 100644 index 00000000000..09138095523 --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.rs @@ -0,0 +1,43 @@ +// ... continued from ./min-choice.rs + +//@ check-fail + +trait Cap<'a> {} +impl Cap<'_> for T {} + +fn type_test<'a, T: 'a>() -> &'a u8 { &0 } + +// Make sure we don't pick `'b`. +fn test_b<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> +where + 'a: 'b, + 'a: 'c, + T: 'b, +{ + type_test::<'_, T>() // This should pass if we pick 'b. + //~^ ERROR the parameter type `T` may not live long enough +} + +// Make sure we don't pick `'c`. +fn test_c<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> +where + 'a: 'b, + 'a: 'c, + T: 'c, +{ + type_test::<'_, T>() // This should pass if we pick 'c. + //~^ ERROR the parameter type `T` may not live long enough +} + +// We need to pick min_choice from `['b, 'c]`, but it's ambiguous which one to pick because +// they're incomparable. +fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> +where + 'a: 'b, + 'a: 'c, +{ + s + //~^ ERROR captures lifetime that does not appear in bounds +} + +fn main() {} diff --git a/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.stderr b/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.stderr new file mode 100644 index 00000000000..911ddd3dc80 --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/min-choice-reject-ambiguous.stderr @@ -0,0 +1,48 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/min-choice-reject-ambiguous.rs:17:5 + | +LL | fn test_b<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> + | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... +... +LL | type_test::<'_, T>() // This should pass if we pick 'b. + | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | T: 'b + 'a, + | ++++ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/min-choice-reject-ambiguous.rs:28:5 + | +LL | fn test_c<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> + | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... +... +LL | type_test::<'_, T>() // This should pass if we pick 'c. + | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound + | +LL | T: 'c + 'a, + | ++++ + +error[E0700]: hidden type for `impl Cap<'b> + Cap<'c>` captures lifetime that does not appear in bounds + --> $DIR/min-choice-reject-ambiguous.rs:39:5 + | +LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + | -- ---------------------- opaque type defined here + | | + | hidden type `&'a u8` captures the lifetime `'a` as defined here +... +LL | s + | ^ + | +help: add a `use<...>` bound to explicitly capture `'a` + | +LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + use<'b, 'c, 'a> + | +++++++++++++++++ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0309, E0700. +For more information about an error, try `rustc --explain E0309`. diff --git a/tests/ui/impl-trait/member-constraints/min-choice.rs b/tests/ui/impl-trait/member-constraints/min-choice.rs new file mode 100644 index 00000000000..4fbffeb4b2a --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/min-choice.rs @@ -0,0 +1,34 @@ +// Assuming that the hidden type in these tests is `&'?15 u8`, +// we have a member constraint: `'?15 member ['static, 'a, 'b, 'c]`. +// +// Make sure we pick up the minimum non-ambiguous region among them. +// We will have to exclude `['b, 'c]` because they're incomparable, +// and then we should pick `'a` because we know `'static: 'a`. + +//@ check-pass + +trait Cap<'a> {} +impl Cap<'_> for T {} + +fn type_test<'a, T: 'a>() -> &'a u8 { &0 } + +// Basic test: make sure we don't bail out because 'b and 'c are incomparable. +fn basic<'a, 'b, 'c>() -> impl Cap<'a> + Cap<'b> + Cap<'c> +where + 'a: 'b, + 'a: 'c, +{ + &0 +} + +// Make sure we don't pick `'static`. +fn test_static<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> +where + 'a: 'b, + 'a: 'c, + T: 'a, +{ + type_test::<'_, T>() // This will fail if we pick 'static +} + +fn main() {} diff --git a/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.rs b/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.rs new file mode 100644 index 00000000000..0bf32a2624f --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.rs @@ -0,0 +1,33 @@ +// Nested impl-traits can impose different member constraints on the same region variable. + +//@ check-fail + +trait Cap<'a> {} +impl 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 + 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 + Cap<'b>> { + [a] + //~^ ERROR E0700 + //~| ERROR E0700 +} + +fn main() {} diff --git a/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.stderr b/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.stderr new file mode 100644 index 00000000000..1a0611e715e --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/nested-impl-trait-fail.stderr @@ -0,0 +1,67 @@ +error[E0700]: hidden type for `impl IntoIterator + Cap<'b>>` captures lifetime that does not appear in bounds + --> $DIR/nested-impl-trait-fail.rs:17:5 + | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> + | -- ------------------------------------------------ opaque type defined here + | | + | hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here +... +LL | [a] + | ^^^ + | +help: add a `use<...>` bound to explicitly capture `'s` + | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> + use<'a, 'b, 's> + | +++++++++++++++++ + +error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds + --> $DIR/nested-impl-trait-fail.rs:17:5 + | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> + | -- ---------------------- opaque type defined here + | | + | hidden type `&'s u8` captures the lifetime `'s` as defined here +... +LL | [a] + | ^^^ + | +help: add a `use<...>` bound to explicitly capture `'s` + | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b> + use<'a, 'b, 's>> + | +++++++++++++++++ + +error[E0700]: hidden type for `impl IntoIterator + Cap<'b>>` captures lifetime that does not appear in bounds + --> $DIR/nested-impl-trait-fail.rs:28:5 + | +LL | fn fail_late_bound<'s, 'a, 'b>( + | -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here +... +LL | ) -> impl IntoIterator + Cap<'b>> { + | ------------------------------------------------ opaque type defined here +LL | [a] + | ^^^ + | +help: add a `use<...>` bound to explicitly capture `'s` + | +LL | ) -> impl IntoIterator + Cap<'b>> + use<'a, 'b, 's> { + | +++++++++++++++++ + +error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds + --> $DIR/nested-impl-trait-fail.rs:28:5 + | +LL | fn fail_late_bound<'s, 'a, 'b>( + | -- hidden type `&'s u8` captures the lifetime `'s` as defined here +... +LL | ) -> impl IntoIterator + Cap<'b>> { + | ---------------------- opaque type defined here +LL | [a] + | ^^^ + | +help: add a `use<...>` bound to explicitly capture `'s` + | +LL | ) -> impl IntoIterator + Cap<'b> + use<'a, 'b, 's>> { + | +++++++++++++++++ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0700`. 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 new file mode 100644 index 00000000000..4633ad68230 --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/nested-impl-trait-pass.rs @@ -0,0 +1,29 @@ +// Nested impl-traits can impose different member constraints on the same region variable. + +//@ check-pass + +trait Cap<'a> {} +impl 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. +fn pass_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator> + Cap<'b> +where + 's: 'a, + 's: 'b, +{ + [a] +} + +// Same as the above but with late-bound regions. +fn pass_late_bound<'s, 'a, 'b>( + a: &'s u8, + _: &'a &'s u8, + _: &'b &'s u8, +) -> impl IntoIterator> + Cap<'b> { + [a] +} + +fn main() {} diff --git a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs b/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs deleted file mode 100644 index 09138095523..00000000000 --- a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.rs +++ /dev/null @@ -1,43 +0,0 @@ -// ... continued from ./min-choice.rs - -//@ check-fail - -trait Cap<'a> {} -impl Cap<'_> for T {} - -fn type_test<'a, T: 'a>() -> &'a u8 { &0 } - -// Make sure we don't pick `'b`. -fn test_b<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> -where - 'a: 'b, - 'a: 'c, - T: 'b, -{ - type_test::<'_, T>() // This should pass if we pick 'b. - //~^ ERROR the parameter type `T` may not live long enough -} - -// Make sure we don't pick `'c`. -fn test_c<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> -where - 'a: 'b, - 'a: 'c, - T: 'c, -{ - type_test::<'_, T>() // This should pass if we pick 'c. - //~^ ERROR the parameter type `T` may not live long enough -} - -// We need to pick min_choice from `['b, 'c]`, but it's ambiguous which one to pick because -// they're incomparable. -fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> -where - 'a: 'b, - 'a: 'c, -{ - s - //~^ ERROR captures lifetime that does not appear in bounds -} - -fn main() {} diff --git a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr b/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr deleted file mode 100644 index 911ddd3dc80..00000000000 --- a/tests/ui/nll/member-constraints/min-choice-reject-ambiguous.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/min-choice-reject-ambiguous.rs:17:5 - | -LL | fn test_b<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> - | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... -... -LL | type_test::<'_, T>() // This should pass if we pick 'b. - | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound - | -LL | T: 'b + 'a, - | ++++ - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/min-choice-reject-ambiguous.rs:28:5 - | -LL | fn test_c<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> - | -- the parameter type `T` must be valid for the lifetime `'a` as defined here... -... -LL | type_test::<'_, T>() // This should pass if we pick 'c. - | ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - | -help: consider adding an explicit lifetime bound - | -LL | T: 'c + 'a, - | ++++ - -error[E0700]: hidden type for `impl Cap<'b> + Cap<'c>` captures lifetime that does not appear in bounds - --> $DIR/min-choice-reject-ambiguous.rs:39:5 - | -LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> - | -- ---------------------- opaque type defined here - | | - | hidden type `&'a u8` captures the lifetime `'a` as defined here -... -LL | s - | ^ - | -help: add a `use<...>` bound to explicitly capture `'a` - | -LL | fn test_ambiguous<'a, 'b, 'c>(s: &'a u8) -> impl Cap<'b> + Cap<'c> + use<'b, 'c, 'a> - | +++++++++++++++++ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0309, E0700. -For more information about an error, try `rustc --explain E0309`. diff --git a/tests/ui/nll/member-constraints/min-choice.rs b/tests/ui/nll/member-constraints/min-choice.rs deleted file mode 100644 index 4fbffeb4b2a..00000000000 --- a/tests/ui/nll/member-constraints/min-choice.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Assuming that the hidden type in these tests is `&'?15 u8`, -// we have a member constraint: `'?15 member ['static, 'a, 'b, 'c]`. -// -// Make sure we pick up the minimum non-ambiguous region among them. -// We will have to exclude `['b, 'c]` because they're incomparable, -// and then we should pick `'a` because we know `'static: 'a`. - -//@ check-pass - -trait Cap<'a> {} -impl Cap<'_> for T {} - -fn type_test<'a, T: 'a>() -> &'a u8 { &0 } - -// Basic test: make sure we don't bail out because 'b and 'c are incomparable. -fn basic<'a, 'b, 'c>() -> impl Cap<'a> + Cap<'b> + Cap<'c> -where - 'a: 'b, - 'a: 'c, -{ - &0 -} - -// Make sure we don't pick `'static`. -fn test_static<'a, 'b, 'c, T>() -> impl Cap<'a> + Cap<'b> + Cap<'c> -where - 'a: 'b, - 'a: 'c, - T: 'a, -{ - type_test::<'_, T>() // This will fail if we pick 'static -} - -fn main() {} 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 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 + 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 + Cap<'b>> { - [a] - //~^ ERROR E0700 - //~| ERROR E0700 -} - -fn main() {} diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr b/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr deleted file mode 100644 index 1a0611e715e..00000000000 --- a/tests/ui/nll/member-constraints/nested-impl-trait-fail.stderr +++ /dev/null @@ -1,67 +0,0 @@ -error[E0700]: hidden type for `impl IntoIterator + Cap<'b>>` captures lifetime that does not appear in bounds - --> $DIR/nested-impl-trait-fail.rs:17:5 - | -LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> - | -- ------------------------------------------------ opaque type defined here - | | - | hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here -... -LL | [a] - | ^^^ - | -help: add a `use<...>` bound to explicitly capture `'s` - | -LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> + use<'a, 'b, 's> - | +++++++++++++++++ - -error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds - --> $DIR/nested-impl-trait-fail.rs:17:5 - | -LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b>> - | -- ---------------------- opaque type defined here - | | - | hidden type `&'s u8` captures the lifetime `'s` as defined here -... -LL | [a] - | ^^^ - | -help: add a `use<...>` bound to explicitly capture `'s` - | -LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator + Cap<'b> + use<'a, 'b, 's>> - | +++++++++++++++++ - -error[E0700]: hidden type for `impl IntoIterator + Cap<'b>>` captures lifetime that does not appear in bounds - --> $DIR/nested-impl-trait-fail.rs:28:5 - | -LL | fn fail_late_bound<'s, 'a, 'b>( - | -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here -... -LL | ) -> impl IntoIterator + Cap<'b>> { - | ------------------------------------------------ opaque type defined here -LL | [a] - | ^^^ - | -help: add a `use<...>` bound to explicitly capture `'s` - | -LL | ) -> impl IntoIterator + Cap<'b>> + use<'a, 'b, 's> { - | +++++++++++++++++ - -error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds - --> $DIR/nested-impl-trait-fail.rs:28:5 - | -LL | fn fail_late_bound<'s, 'a, 'b>( - | -- hidden type `&'s u8` captures the lifetime `'s` as defined here -... -LL | ) -> impl IntoIterator + Cap<'b>> { - | ---------------------- opaque type defined here -LL | [a] - | ^^^ - | -help: add a `use<...>` bound to explicitly capture `'s` - | -LL | ) -> impl IntoIterator + Cap<'b> + use<'a, 'b, 's>> { - | +++++++++++++++++ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0700`. diff --git a/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs b/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs deleted file mode 100644 index 4633ad68230..00000000000 --- a/tests/ui/nll/member-constraints/nested-impl-trait-pass.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Nested impl-traits can impose different member constraints on the same region variable. - -//@ check-pass - -trait Cap<'a> {} -impl 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. -fn pass_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator> + Cap<'b> -where - 's: 'a, - 's: 'b, -{ - [a] -} - -// Same as the above but with late-bound regions. -fn pass_late_bound<'s, 'a, 'b>( - a: &'s u8, - _: &'a &'s u8, - _: &'b &'s u8, -) -> impl IntoIterator> + Cap<'b> { - [a] -} - -fn main() {} -- cgit 1.4.1-3-g733a5