about summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/redundant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/precise-capturing/redundant.rs')
-rw-r--r--tests/ui/impl-trait/precise-capturing/redundant.rs13
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() {}