rust/tests/ui/impl-trait/precise-capturing/redundant.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
617 B
Rust
Raw Normal View History

2024-11-22 07:20:22 -08:00
//@ edition: 2024
2024-09-29 13:41:13 -04:00
#![deny(impl_trait_redundant_captures)]
2024-04-20 11:22:06 -04:00
2024-06-05 16:18:52 -04:00
fn hello<'a>() -> impl Sized + use<'a> {}
//~^ ERROR 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<'_> {}
//~^ ERROR 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>;
//~^ ERROR 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> {}
//~^ ERROR all possible in-scope parameters are already captured
2024-04-20 11:22:06 -04:00
}
fn main() {}