2024-04-20 11:22:06 -04:00
|
|
|
//@ compile-flags: -Zunstable-options --edition=2024
|
2024-09-29 13:41:13 -04:00
|
|
|
//@ check-pass
|
|
|
|
|
|
|
|
#![feature(precise_capturing_in_traits)]
|
2024-04-20 11:22:06 -04:00
|
|
|
|
2024-06-05 16:18:52 -04:00
|
|
|
fn hello<'a>() -> impl Sized + use<'a> {}
|
2024-09-29 13:41:13 -04:00
|
|
|
//~^ WARN all possible in-scope parameters are already captured
|
2024-04-20 11:22:06 -04:00
|
|
|
|
|
|
|
struct Inherent;
|
|
|
|
impl Inherent {
|
2024-06-05 16:18:52 -04:00
|
|
|
fn inherent(&self) -> impl Sized + use<'_> {}
|
2024-09-29 13:41:13 -04:00
|
|
|
//~^ WARN all possible in-scope parameters are already captured
|
2024-04-20 11:22:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Test<'a> {
|
2024-06-05 16:18:52 -04:00
|
|
|
fn in_trait() -> impl Sized + use<'a, Self>;
|
2024-09-29 13:41:13 -04:00
|
|
|
//~^ WARN all possible in-scope parameters are already captured
|
2024-04-20 11:22:06 -04:00
|
|
|
}
|
|
|
|
impl<'a> Test<'a> for () {
|
2024-06-05 16:18:52 -04:00
|
|
|
fn in_trait() -> impl Sized + use<'a> {}
|
2024-09-29 13:41:13 -04:00
|
|
|
//~^ WARN all possible in-scope parameters are already captured
|
2024-04-20 11:22:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|