summaryrefslogtreecommitdiffstats
path: root/tests/ui/dyn-star
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/dyn-star')
-rw-r--r--tests/ui/dyn-star/align.normal.stderr13
-rw-r--r--tests/ui/dyn-star/align.over_aligned.stderr6
-rw-r--r--tests/ui/dyn-star/align.rs3
-rw-r--r--tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast.rs2
-rw-r--r--tests/ui/dyn-star/check-size-at-cast.stderr2
-rw-r--r--tests/ui/dyn-star/const-and-static.rs10
-rw-r--r--tests/ui/dyn-star/const-and-static.stderr11
-rw-r--r--tests/ui/dyn-star/feature-gate-dyn_star.rs2
-rw-r--r--tests/ui/dyn-star/feature-gate-dyn_star.stderr4
-rw-r--r--tests/ui/dyn-star/gated-span.rs8
-rw-r--r--tests/ui/dyn-star/gated-span.stderr12
-rw-r--r--tests/ui/dyn-star/no-explicit-dyn-star-cast.rs4
-rw-r--r--tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr8
-rw-r--r--tests/ui/dyn-star/upcast.stderr2
16 files changed, 70 insertions, 21 deletions
diff --git a/tests/ui/dyn-star/align.normal.stderr b/tests/ui/dyn-star/align.normal.stderr
index 53c2cbeac..42fa4fd6f 100644
--- a/tests/ui/dyn-star/align.normal.stderr
+++ b/tests/ui/dyn-star/align.normal.stderr
@@ -1,5 +1,5 @@
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/align.rs:4:12
+ --> $DIR/align.rs:3:12
|
LL | #![feature(dyn_star)]
| ^^^^^^^^
@@ -7,5 +7,14 @@ 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
+error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
+ --> $DIR/align.rs:14:13
+ |
+LL | let x = AlignedUsize(12) as dyn* Debug;
+ | ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
+ |
+ = help: the trait `PointerLike` is not implemented for `AlignedUsize`
+
+error: aborting due to previous error; 1 warning emitted
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dyn-star/align.over_aligned.stderr b/tests/ui/dyn-star/align.over_aligned.stderr
index 0365d87a6..42fa4fd6f 100644
--- a/tests/ui/dyn-star/align.over_aligned.stderr
+++ b/tests/ui/dyn-star/align.over_aligned.stderr
@@ -1,5 +1,5 @@
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/align.rs:4:12
+ --> $DIR/align.rs:3:12
|
LL | #![feature(dyn_star)]
| ^^^^^^^^
@@ -7,8 +7,8 @@ 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
-error[E0277]: `AlignedUsize` needs to have the same alignment and size as a pointer
- --> $DIR/align.rs:15:13
+error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
+ --> $DIR/align.rs:14:13
|
LL | let x = AlignedUsize(12) as dyn* Debug;
| ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
diff --git a/tests/ui/dyn-star/align.rs b/tests/ui/dyn-star/align.rs
index 6679997a9..79cbaba0c 100644
--- a/tests/ui/dyn-star/align.rs
+++ b/tests/ui/dyn-star/align.rs
@@ -1,5 +1,4 @@
// revisions: normal over_aligned
-//[normal] check-pass
#![feature(dyn_star)]
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
@@ -13,5 +12,5 @@ struct AlignedUsize(usize);
fn main() {
let x = AlignedUsize(12) as dyn* Debug;
- //[over_aligned]~^ ERROR `AlignedUsize` needs to have the same alignment and size as a pointer
+ //~^ ERROR `AlignedUsize` needs to have the same ABI as a pointer
}
diff --git a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
index 85749aa7b..913c2faac 100644
--- a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
+++ b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.rs
@@ -9,7 +9,7 @@ fn dyn_debug(_: (dyn* Debug + '_)) {
fn polymorphic<T: Debug + ?Sized>(t: &T) {
dyn_debug(t);
- //~^ ERROR `&T` needs to have the same alignment and size as a pointer
+ //~^ ERROR `&T` needs to have the same ABI as a pointer
}
fn main() {}
diff --git a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
index 350630f79..8726fae79 100644
--- a/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
+++ b/tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `&T` needs to have the same alignment and size as a pointer
+error[E0277]: `&T` needs to have the same ABI as a pointer
--> $DIR/check-size-at-cast-polymorphic-bad.rs:11:15
|
LL | dyn_debug(t);
diff --git a/tests/ui/dyn-star/check-size-at-cast.rs b/tests/ui/dyn-star/check-size-at-cast.rs
index 17bc4f303..e15e090b5 100644
--- a/tests/ui/dyn-star/check-size-at-cast.rs
+++ b/tests/ui/dyn-star/check-size-at-cast.rs
@@ -5,6 +5,6 @@ use std::fmt::Debug;
fn main() {
let i = [1, 2, 3, 4] as dyn* Debug;
- //~^ ERROR `[i32; 4]` needs to have the same alignment and size as a pointer
+ //~^ ERROR `[i32; 4]` needs to have the same ABI as a pointer
dbg!(i);
}
diff --git a/tests/ui/dyn-star/check-size-at-cast.stderr b/tests/ui/dyn-star/check-size-at-cast.stderr
index 19700b406..e60b5c56f 100644
--- a/tests/ui/dyn-star/check-size-at-cast.stderr
+++ b/tests/ui/dyn-star/check-size-at-cast.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `[i32; 4]` needs to have the same alignment and size as a pointer
+error[E0277]: `[i32; 4]` needs to have the same ABI as a pointer
--> $DIR/check-size-at-cast.rs:7:13
|
LL | let i = [1, 2, 3, 4] as dyn* Debug;
diff --git a/tests/ui/dyn-star/const-and-static.rs b/tests/ui/dyn-star/const-and-static.rs
new file mode 100644
index 000000000..551b072ab
--- /dev/null
+++ b/tests/ui/dyn-star/const-and-static.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+#![feature(dyn_star)]
+//~^ WARN the feature `dyn_star` is incomplete
+
+const C: dyn* Send + Sync = &();
+
+static S: dyn* Send + Sync = &();
+
+fn main() {}
diff --git a/tests/ui/dyn-star/const-and-static.stderr b/tests/ui/dyn-star/const-and-static.stderr
new file mode 100644
index 000000000..df8f42fb0
--- /dev/null
+++ b/tests/ui/dyn-star/const-and-static.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/const-and-static.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
+
diff --git a/tests/ui/dyn-star/feature-gate-dyn_star.rs b/tests/ui/dyn-star/feature-gate-dyn_star.rs
index 4756661cf..41eed71cd 100644
--- a/tests/ui/dyn-star/feature-gate-dyn_star.rs
+++ b/tests/ui/dyn-star/feature-gate-dyn_star.rs
@@ -3,7 +3,7 @@
/// dyn* is not necessarily the final surface syntax (if we have one at all),
/// but for now we will support it to aid in writing tests independently.
pub fn dyn_star_parameter(_: &dyn* Send) {
- //~^ dyn* trait objects are unstable
+ //~^ `dyn*` trait objects are experimental
}
fn main() {}
diff --git a/tests/ui/dyn-star/feature-gate-dyn_star.stderr b/tests/ui/dyn-star/feature-gate-dyn_star.stderr
index c3449b627..342e71c3a 100644
--- a/tests/ui/dyn-star/feature-gate-dyn_star.stderr
+++ b/tests/ui/dyn-star/feature-gate-dyn_star.stderr
@@ -1,8 +1,8 @@
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/feature-gate-dyn_star.rs:5:31
|
LL | pub fn dyn_star_parameter(_: &dyn* Send) {
- | ^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
diff --git a/tests/ui/dyn-star/gated-span.rs b/tests/ui/dyn-star/gated-span.rs
new file mode 100644
index 000000000..a747987bd
--- /dev/null
+++ b/tests/ui/dyn-star/gated-span.rs
@@ -0,0 +1,8 @@
+macro_rules! t {
+ ($t:ty) => {}
+}
+
+t!(dyn* Send);
+//~^ ERROR `dyn*` trait objects are experimental
+
+fn main() {}
diff --git a/tests/ui/dyn-star/gated-span.stderr b/tests/ui/dyn-star/gated-span.stderr
new file mode 100644
index 000000000..626b6cd1b
--- /dev/null
+++ b/tests/ui/dyn-star/gated-span.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `dyn*` trait objects are experimental
+ --> $DIR/gated-span.rs:5:4
+ |
+LL | t!(dyn* Send);
+ | ^^^^
+ |
+ = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
+ = help: add `#![feature(dyn_star)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs b/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
index 67240c8e8..2d28f516a 100644
--- a/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
+++ b/tests/ui/dyn-star/no-explicit-dyn-star-cast.rs
@@ -4,8 +4,8 @@ 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
+ //~| ERROR `dyn*` trait objects are experimental
+ //~| ERROR `dyn*` trait objects are experimental
}
fn main() {
diff --git a/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr b/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
index eb9c93305..78af9c7a3 100644
--- a/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
+++ b/tests/ui/dyn-star/no-explicit-dyn-star-cast.stderr
@@ -1,17 +1,17 @@
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/no-explicit-dyn-star-cast.rs:5:16
|
LL | let dyn_i: dyn* Debug = i as dyn* Debug;
- | ^^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
-error[E0658]: dyn* trait objects are unstable
+error[E0658]: `dyn*` trait objects are experimental
--> $DIR/no-explicit-dyn-star-cast.rs:5:34
|
LL | let dyn_i: dyn* Debug = i as dyn* Debug;
- | ^^^^^^^^^^
+ | ^^^^
|
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= help: add `#![feature(dyn_star)]` to the crate attributes to enable
diff --git a/tests/ui/dyn-star/upcast.stderr b/tests/ui/dyn-star/upcast.stderr
index e60144fea..8b34c7f8b 100644
--- a/tests/ui/dyn-star/upcast.stderr
+++ b/tests/ui/dyn-star/upcast.stderr
@@ -7,7 +7,7 @@ LL | #![feature(dyn_star, trait_upcasting)]
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
= note: `#[warn(incomplete_features)]` on by default
-error[E0277]: `dyn* Foo` needs to have the same alignment and size as a pointer
+error[E0277]: `dyn* Foo` needs to have the same ABI as a pointer
--> $DIR/upcast.rs:30:23
|
LL | let w: dyn* Bar = w;