diff options
| author | bors <bors@rust-lang.org> | 2024-10-18 17:23:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-18 17:23:35 +0000 |
| commit | f7b5e5471b79a556dfd758a25265a777fbdad7ac (patch) | |
| tree | 2ac406cb8c82ec5d3e1476c782d1d9b37d129ffa /tests | |
| parent | b0c2d2e5b00339014cba0a31f634af8c146458ed (diff) | |
| parent | 43e50932f2f885281871dd91d454a3cd3571ec61 (diff) | |
| download | rust-f7b5e5471b79a556dfd758a25265a777fbdad7ac.tar.gz rust-f7b5e5471b79a556dfd758a25265a777fbdad7ac.zip | |
Auto merge of #131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
Rollup of 3 pull requests Successful merges: - #126207 (std::unix::stack_overflow::drop_handler addressing todo through libc …) - #131864 (Never emit `vptr` for empty/auto traits) - #131870 (compiletest: Store test collection context/state in two structs) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/traits/object/print_vtable_sizes.stdout | 4 | ||||
| -rw-r--r-- | tests/ui/traits/upcast_reorder.rs | 29 | ||||
| -rw-r--r-- | tests/ui/traits/vtable/multiple-markers.stderr | 6 |
3 files changed, 31 insertions, 8 deletions
diff --git a/tests/ui/traits/object/print_vtable_sizes.stdout b/tests/ui/traits/object/print_vtable_sizes.stdout index b43e168df3f..4daf4769576 100644 --- a/tests/ui/traits/object/print_vtable_sizes.stdout +++ b/tests/ui/traits/object/print_vtable_sizes.stdout @@ -1,8 +1,8 @@ -print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "E", "entries": "6", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "2", "upcasting_cost_percent": "50" } -print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "G", "entries": "14", "entries_ignoring_upcasting": "11", "entries_for_upcasting": "3", "upcasting_cost_percent": "27.27272727272727" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "A", "entries": "6", "entries_ignoring_upcasting": "5", "entries_for_upcasting": "1", "upcasting_cost_percent": "20" } +print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "G", "entries": "13", "entries_ignoring_upcasting": "11", "entries_for_upcasting": "2", "upcasting_cost_percent": "18.181818181818183" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "B", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "D", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } +print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "E", "entries": "4", "entries_ignoring_upcasting": "4", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "F", "entries": "6", "entries_ignoring_upcasting": "6", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "_::S", "entries": "3", "entries_ignoring_upcasting": "3", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } print-vtable-sizes { "crate_name": "print_vtable_sizes", "trait_name": "_::S", "entries": "3", "entries_ignoring_upcasting": "3", "entries_for_upcasting": "0", "upcasting_cost_percent": "0" } diff --git a/tests/ui/traits/upcast_reorder.rs b/tests/ui/traits/upcast_reorder.rs new file mode 100644 index 00000000000..55e6ad4c368 --- /dev/null +++ b/tests/ui/traits/upcast_reorder.rs @@ -0,0 +1,29 @@ +//@ run-pass +// +// issue: <https://github.com/rust-lang/rust/issues/131813> + +#![feature(trait_upcasting)] + +trait Pollable { + #[allow(unused)] + fn poll(&self) {} +} +trait FileIo: Pollable + Send + Sync { + fn read(&self) {} +} +trait Terminal: Send + Sync + FileIo {} + +struct A; + +impl Pollable for A {} +impl FileIo for A {} +impl Terminal for A {} + +fn main() { + let a = A; + + let b = &a as &dyn Terminal; + let c = b as &dyn FileIo; + + c.read(); +} diff --git a/tests/ui/traits/vtable/multiple-markers.stderr b/tests/ui/traits/vtable/multiple-markers.stderr index 4497c703ae8..36ac8b24eb5 100644 --- a/tests/ui/traits/vtable/multiple-markers.stderr +++ b/tests/ui/traits/vtable/multiple-markers.stderr @@ -14,7 +14,6 @@ error: vtable entries for `<S as B>`: [ MetadataSize, MetadataAlign, Method(<S as T>::method), - TraitVPtr(<S as M2>), ] --> $DIR/multiple-markers.rs:24:1 | @@ -26,8 +25,6 @@ error: vtable entries for `<S as C>`: [ MetadataSize, MetadataAlign, Method(<S as T>::method), - TraitVPtr(<S as M1>), - TraitVPtr(<S as M2>), ] --> $DIR/multiple-markers.rs:27:1 | @@ -39,9 +36,6 @@ error: vtable entries for `<S as D>`: [ MetadataSize, MetadataAlign, Method(<S as T>::method), - TraitVPtr(<S as M0>), - TraitVPtr(<S as M1>), - TraitVPtr(<S as M2>), ] --> $DIR/multiple-markers.rs:30:1 | |
