2024-11-22 15:20:22 +00:00
|
|
|
//@ edition: 2024
|
2024-09-29 17:41:13 +00:00
|
|
|
|
2025-01-13 15:52:45 +00:00
|
|
|
#![deny(impl_trait_redundant_captures)]
|
2024-04-20 15:22:06 +00:00
|
|
|
|
2024-06-05 20:18:52 +00:00
|
|
|
fn hello<'a>() -> impl Sized + use<'a> {}
|
2025-01-13 15:52:45 +00:00
|
|
|
//~^ ERROR all possible in-scope parameters are already captured
|
2024-04-20 15:22:06 +00:00
|
|
|
|
|
|
|
struct Inherent;
|
|
|
|
impl Inherent {
|
2024-06-05 20:18:52 +00:00
|
|
|
fn inherent(&self) -> impl Sized + use<'_> {}
|
2025-01-13 15:52:45 +00:00
|
|
|
//~^ ERROR all possible in-scope parameters are already captured
|
2024-04-20 15:22:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Test<'a> {
|
2024-06-05 20:18:52 +00:00
|
|
|
fn in_trait() -> impl Sized + use<'a, Self>;
|
2025-01-13 15:52:45 +00:00
|
|
|
//~^ ERROR all possible in-scope parameters are already captured
|
2024-04-20 15:22:06 +00:00
|
|
|
}
|
|
|
|
impl<'a> Test<'a> for () {
|
2024-06-05 20:18:52 +00:00
|
|
|
fn in_trait() -> impl Sized + use<'a> {}
|
2025-01-13 15:52:45 +00:00
|
|
|
//~^ ERROR all possible in-scope parameters are already captured
|
2024-04-20 15:22:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|