about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-10 22:16:45 +0100
committerGitHub <noreply@github.com>2024-03-10 22:16:45 +0100
commit16ffeb208d67b2717bc6826d5310d326096bc27c (patch)
tree15ce9592bbfb2bf7895246d8ec2d50b9d69dd00f /tests
parent97f3b3383a605c4adbdbdfe29dfc9ba626e9d949 (diff)
parente4bafa2b8cd02aad4077ed34be29dd8fddbbefed (diff)
downloadrust-16ffeb208d67b2717bc6826d5310d326096bc27c.tar.gz
rust-16ffeb208d67b2717bc6826d5310d326096bc27c.zip
Rollup merge of #122304 - lukas-code:dyn-star-meta, r=compiler-errors
fix metadata for dyn-star in new solver

The pointee metadata of `dyn* Trait` types is `()` and not a vtable.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/dyn-star/thin.next.stderr11
-rw-r--r--tests/ui/dyn-star/thin.old.stderr11
-rw-r--r--tests/ui/dyn-star/thin.rs16
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/dyn-star/thin.next.stderr b/tests/ui/dyn-star/thin.next.stderr
new file mode 100644
index 00000000000..ef251062afc
--- /dev/null
+++ b/tests/ui/dyn-star/thin.next.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/thin.rs:6: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
+
diff --git a/tests/ui/dyn-star/thin.old.stderr b/tests/ui/dyn-star/thin.old.stderr
new file mode 100644
index 00000000000..ef251062afc
--- /dev/null
+++ b/tests/ui/dyn-star/thin.old.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/thin.rs:6: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
+
diff --git a/tests/ui/dyn-star/thin.rs b/tests/ui/dyn-star/thin.rs
new file mode 100644
index 00000000000..6df70f560de
--- /dev/null
+++ b/tests/ui/dyn-star/thin.rs
@@ -0,0 +1,16 @@
+//@check-pass
+//@revisions: old next
+//@[next] compile-flags: -Znext-solver
+
+#![feature(ptr_metadata)]
+#![feature(dyn_star)]
+//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
+
+use std::fmt::Debug;
+use std::ptr::Thin;
+
+fn check_thin<T: ?Sized + Thin>() {}
+
+fn main() {
+    check_thin::<dyn* Debug>();
+}