about summary refs log tree commit diff
path: root/tests/ui/dyn-drop
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/dyn-drop
parent91fad92585b2dafc52a074e502b2a6c1f093ca35 (diff)
downloadrust-aba70e8f9d66dce7d9980808cc1ce88fab967d3d.tar.gz
rust-aba70e8f9d66dce7d9980808cc1ce88fab967d3d.zip
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/dyn-drop')
-rw-r--r--tests/ui/dyn-drop/dyn-drop.rs3
-rw-r--r--tests/ui/dyn-drop/dyn-drop.stderr14
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/ui/dyn-drop/dyn-drop.rs b/tests/ui/dyn-drop/dyn-drop.rs
index e1668a3f188..f336949d2cb 100644
--- a/tests/ui/dyn-drop/dyn-drop.rs
+++ b/tests/ui/dyn-drop/dyn-drop.rs
@@ -1,8 +1,7 @@
 #![deny(dyn_drop)]
-#![allow(bare_trait_objects)]
 fn foo(_: Box<dyn Drop>) {} //~ ERROR
 fn bar(_: &dyn Drop) {} //~ERROR
-fn baz(_: *mut Drop) {} //~ ERROR
+fn baz(_: *mut dyn Drop) {} //~ ERROR
 struct Foo {
   _x: Box<dyn Drop> //~ ERROR
 }
diff --git a/tests/ui/dyn-drop/dyn-drop.stderr b/tests/ui/dyn-drop/dyn-drop.stderr
index 1b1dbc4d12d..8210d8a4c48 100644
--- a/tests/ui/dyn-drop/dyn-drop.stderr
+++ b/tests/ui/dyn-drop/dyn-drop.stderr
@@ -1,5 +1,5 @@
 error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
-  --> $DIR/dyn-drop.rs:3:19
+  --> $DIR/dyn-drop.rs:2:19
    |
 LL | fn foo(_: Box<dyn Drop>) {}
    |                   ^^^^
@@ -11,25 +11,25 @@ LL | #![deny(dyn_drop)]
    |         ^^^^^^^^
 
 error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
-  --> $DIR/dyn-drop.rs:4:16
+  --> $DIR/dyn-drop.rs:3:16
    |
 LL | fn bar(_: &dyn Drop) {}
    |                ^^^^
 
 error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
-  --> $DIR/dyn-drop.rs:5:16
+  --> $DIR/dyn-drop.rs:4:20
    |
-LL | fn baz(_: *mut Drop) {}
-   |                ^^^^
+LL | fn baz(_: *mut dyn Drop) {}
+   |                    ^^^^
 
 error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
-  --> $DIR/dyn-drop.rs:7:15
+  --> $DIR/dyn-drop.rs:6:15
    |
 LL |   _x: Box<dyn Drop>
    |               ^^^^
 
 error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
-  --> $DIR/dyn-drop.rs:14:16
+  --> $DIR/dyn-drop.rs:13:16
    |
 LL |   type T = dyn Drop;
    |                ^^^^