We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2f5814 commit 57056d7Copy full SHA for 57056d7
tests/ui/dyn-star/dyn-star-to-dyn.rs
@@ -1,9 +1,17 @@
1
-// build-pass
+// run-pass
2
3
#![feature(dyn_star)]
4
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
5
6
+use std::fmt::Debug;
7
+
8
fn main() {
- let x: dyn* Send = &();
- let x = Box::new(x) as Box<dyn Send>;
9
+ let x: dyn* Debug = &42;
10
+ let x = Box::new(x) as Box<dyn Debug>;
11
+ assert_eq!("42", format!("{x:?}"));
12
13
+ // Also test opposite direction.
14
+ let x: Box<dyn Debug> = Box::new(42);
15
+ let x = &x as dyn* Debug;
16
17
}
0 commit comments