about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-02 10:11:10 +0200
committerLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-02 11:02:50 +0200
commitaba70e8f9d66dce7d9980808cc1ce88fab967d3d (patch)
tree259cfed27a4a9b872b5f53bd91e17769582ee3bd /tests/ui/error-codes
parent91fad92585b2dafc52a074e502b2a6c1f093ca35 (diff)
Add missing `dyn` keywords to tests that do not test for them
This ensures that these tests can be run on editions other than 2015
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0657.rs4
-rw-r--r--tests/ui/error-codes/E0657.stderr24
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/ui/error-codes/E0657.rs b/tests/ui/error-codes/E0657.rs
index 212c1d9e581..f046788153d 100644
--- a/tests/ui/error-codes/E0657.rs
+++ b/tests/ui/error-codes/E0657.rs
@@ -7,7 +7,7 @@ impl<'a> Lt<'a> for () {}
 impl<T> Id<T> for T {}
 
 fn free_fn_capture_hrtb_in_impl_trait()
-    -> Box<for<'a> Id<impl Lt<'a>>>
+    -> Box<dyn for<'a> Id<impl Lt<'a>>>
         //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
 {
     Box::new(())
@@ -16,7 +16,7 @@ fn free_fn_capture_hrtb_in_impl_trait()
 struct Foo;
 impl Foo {
     fn impl_fn_capture_hrtb_in_impl_trait()
-        -> Box<for<'a> Id<impl Lt<'a>>>
+        -> Box<dyn for<'a> Id<impl Lt<'a>>>
             //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
     {
         Box::new(())
diff --git a/tests/ui/error-codes/E0657.stderr b/tests/ui/error-codes/E0657.stderr
index c539007cdcf..c9dfc9eb906 100644
--- a/tests/ui/error-codes/E0657.stderr
+++ b/tests/ui/error-codes/E0657.stderr
@@ -1,26 +1,26 @@
 error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
-  --> $DIR/E0657.rs:10:31
+  --> $DIR/E0657.rs:10:35
    |
-LL |     -> Box<for<'a> Id<impl Lt<'a>>>
-   |                               ^^
+LL |     -> Box<dyn for<'a> Id<impl Lt<'a>>>
+   |                                   ^^
    |
 note: lifetime declared here
-  --> $DIR/E0657.rs:10:16
+  --> $DIR/E0657.rs:10:20
    |
-LL |     -> Box<for<'a> Id<impl Lt<'a>>>
-   |                ^^
+LL |     -> Box<dyn for<'a> Id<impl Lt<'a>>>
+   |                    ^^
 
 error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
-  --> $DIR/E0657.rs:19:35
+  --> $DIR/E0657.rs:19:39
    |
-LL |         -> Box<for<'a> Id<impl Lt<'a>>>
-   |                                   ^^
+LL |         -> Box<dyn for<'a> Id<impl Lt<'a>>>
+   |                                       ^^
    |
 note: lifetime declared here
-  --> $DIR/E0657.rs:19:20
+  --> $DIR/E0657.rs:19:24
    |
-LL |         -> Box<for<'a> Id<impl Lt<'a>>>
-   |                    ^^
+LL |         -> Box<dyn for<'a> Id<impl Lt<'a>>>
+   |                        ^^
 
 error: aborting due to 2 previous errors