diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/traits/vtable/vtable-vacant.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/traits/vtable/vtable-vacant.rs')
-rw-r--r-- | tests/ui/traits/vtable/vtable-vacant.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/traits/vtable/vtable-vacant.rs b/tests/ui/traits/vtable/vtable-vacant.rs new file mode 100644 index 000000000..a64796358 --- /dev/null +++ b/tests/ui/traits/vtable/vtable-vacant.rs @@ -0,0 +1,31 @@ +// build-fail +#![feature(rustc_attrs)] +#![feature(negative_impls)] +#![allow(where_clauses_object_safety)] + +// B --> A + +#[rustc_dump_vtable] +trait A { + fn foo_a1(&self) {} + fn foo_a2(&self) where Self: Send {} +} + +#[rustc_dump_vtable] +trait B: A { + //~^ error vtable + fn foo_b1(&self) {} + fn foo_b2(&self) where Self: Send {} +} + +struct S; +impl !Send for S {} + +impl A for S {} +impl B for S {} + +fn foo(_: &dyn B) {} + +fn main() { + foo(&S); +} |