about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-06 08:47:35 +0000
committerMichael Goulet <michael@errs.io>2023-01-11 19:52:42 +0000
commit70a8d8dcf3c07c3a43c3ee0561dfe5ce594ae365 (patch)
treee195fb252d7978a497d15a979fd69f8513cb5de5 /tests
parentb22c152958eade17a71d899b29a2d39bcc77aa48 (diff)
downloadrust-70a8d8dcf3c07c3a43c3ee0561dfe5ce594ae365.tar.gz
rust-70a8d8dcf3c07c3a43c3ee0561dfe5ce594ae365.zip
Allow codegen to unsize dyn* to dyn
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/dyn-star/dyn-star-to-dyn.rs9
-rw-r--r--tests/ui/dyn-star/dyn-star-to-dyn.stderr11
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/dyn-star/dyn-star-to-dyn.rs b/tests/ui/dyn-star/dyn-star-to-dyn.rs
new file mode 100644
index 00000000000..a6d9df9523a
--- /dev/null
+++ b/tests/ui/dyn-star/dyn-star-to-dyn.rs
@@ -0,0 +1,9 @@
+// build-pass
+
+#![feature(dyn_star)]
+//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
+
+fn main() {
+    let x: dyn* Send = &();
+    let x = Box::new(x) as Box<dyn Send>;
+}
diff --git a/tests/ui/dyn-star/dyn-star-to-dyn.stderr b/tests/ui/dyn-star/dyn-star-to-dyn.stderr
new file mode 100644
index 00000000000..03aedf5f797
--- /dev/null
+++ b/tests/ui/dyn-star/dyn-star-to-dyn.stderr
@@ -0,0 +1,11 @@
+warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/dyn-star-to-dyn.rs:3:12
+   |
+LL | #![feature(dyn_star)]
+   |            ^^^^^^^^
+   |
+   = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+