Skip to content

Commit 57056d7

Browse files
committed
slightly beef up dyn-star-to-dyn test
1 parent b2f5814 commit 57056d7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/ui/dyn-star/dyn-star-to-dyn.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
// build-pass
1+
// run-pass
22

33
#![feature(dyn_star)]
44
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
55

6+
use std::fmt::Debug;
7+
68
fn main() {
7-
let x: dyn* Send = &();
8-
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+
assert_eq!("42", format!("{x:?}"));
917
}

0 commit comments

Comments
 (0)