diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-20 12:17:42 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-06-24 12:03:09 -0400 |
| commit | 6521c3971d0818ab37f27f36f2eb99de420c780f (patch) | |
| tree | 84d60a479b7024a868518e3dce3d89b1ed758849 /tests/ui/impl-trait/precise-capturing/redundant.rs | |
| parent | dd557d8c3720c82c488d6e2af3b7e19025f2473a (diff) | |
| download | rust-6521c3971d0818ab37f27f36f2eb99de420c780f.tar.gz rust-6521c3971d0818ab37f27f36f2eb99de420c780f.zip | |
Deny use<> for RPITITs
Diffstat (limited to 'tests/ui/impl-trait/precise-capturing/redundant.rs')
| -rw-r--r-- | tests/ui/impl-trait/precise-capturing/redundant.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/ui/impl-trait/precise-capturing/redundant.rs b/tests/ui/impl-trait/precise-capturing/redundant.rs index 99c128fdc48..ef4f05bd7e4 100644 --- a/tests/ui/impl-trait/precise-capturing/redundant.rs +++ b/tests/ui/impl-trait/precise-capturing/redundant.rs @@ -1,24 +1,27 @@ //@ compile-flags: -Zunstable-options --edition=2024 -//@ check-pass +//@ revisions: normal rpitit +//@[normal] check-pass #![feature(precise_capturing)] fn hello<'a>() -> impl Sized + use<'a> {} -//~^ WARN all possible in-scope parameters are already captured +//[normal]~^ WARN all possible in-scope parameters are already captured struct Inherent; impl Inherent { fn inherent(&self) -> impl Sized + use<'_> {} - //~^ WARN all possible in-scope parameters are already captured + //[normal]~^ WARN all possible in-scope parameters are already captured } +#[cfg(rpitit)] trait Test<'a> { fn in_trait() -> impl Sized + use<'a, Self>; - //~^ WARN all possible in-scope parameters are already captured + //[rpitit]~^ ERROR `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits } +#[cfg(rpitit)] impl<'a> Test<'a> for () { fn in_trait() -> impl Sized + use<'a> {} - //~^ WARN all possible in-scope parameters are already captured + //[rpitit]~^ ERROR `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits } fn main() {} |
