summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs
new file mode 100644
index 000000000..67240c8e8
--- /dev/null
+++ b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs
@@ -0,0 +1,13 @@
+use std::fmt::Debug;
+
+fn make_dyn_star() {
+ let i = 42usize;
+ let dyn_i: dyn* Debug = i as dyn* Debug;
+ //~^ ERROR casting `usize` as `dyn* Debug` is invalid
+ //~| ERROR dyn* trait objects are unstable
+ //~| ERROR dyn* trait objects are unstable
+}
+
+fn main() {
+ make_dyn_star();
+}