rust/tests
Matthias Krüger 9f8c618a90
Rollup merge of #127856 - RalfJung:interpret-cast-sanity, r=oli-obk
interpret: add sanity check in dyn upcast to double-check what codegen does

For dyn receiver calls, we already have two codepaths: look up the function to call by indexing into the vtable, or alternatively resolve the DefId given the dynamic type of the receiver. With debug assertions enabled, the interpreter does both and compares the results. (Without debug assertions we always use the vtable as it is simpler.)

This PR does the same for dyn trait upcasts. However, for casts *not* using the vtable is the easier thing to do, so now the vtable path is the debug-assertion-only path. In particular, there are cases where the vtable does not contain a pointer for upcasts but instead reuses the old pointer: when the supertrait vtable is a prefix of the larger vtable. We don't want to expose this optimization and detect UB if people do a transmute assuming this optimization, so we cannot in general use the vtable indexing path.

r? ``@oli-obk``
2024-07-19 17:06:50 +02:00
..
assembly Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubilee 2024-07-12 20:36:43 +00:00
auxiliary
codegen Use Option's discriminant as its size hint 2024-07-15 00:34:03 -07:00
codegen-units Avoid MIR bloat in inlining 2024-07-01 05:17:13 -07:00
coverage Bless coverage. 2024-07-13 12:02:12 +00:00
coverage-run-rustdoc coverage: Extract hole spans from HIR instead of MIR 2024-07-08 21:22:56 +10:00
crashes Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwU 2024-07-19 08:44:51 +00:00
debuginfo Add Natvis visualiser and debuginfo tests for f16 2024-07-09 03:47:50 +01:00
incremental
mir-opt Rollup merge of #127337 - celinval:intrinsics-fallback, r=oli-obk 2024-07-17 16:22:28 +02:00
pretty Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
run-make Rollup merge of #127928 - Oneirical:anatesthetic-sleep, r=Kobzol 2024-07-19 03:27:49 -05:00
run-pass-valgrind
rustdoc Rollup merge of #127671 - notriddle:notriddle/issue-d, r=Mark-Simulacrum 2024-07-13 20:19:48 -07:00
rustdoc-gui Add test for size of items in the items list 2024-07-18 20:48:20 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json Add rustdoc-json support for use<> 2024-07-12 05:24:51 -04:00
rustdoc-ui Rollup merge of #127878 - estebank:assoc-item-removal, r=fmease 2024-07-18 08:09:01 +02:00
ui Rollup merge of #127856 - RalfJung:interpret-cast-sanity, r=oli-obk 2024-07-19 17:06:50 +02:00
ui-fulldeps Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwU 2024-07-19 08:44:51 +00:00
COMPILER_TESTS.md