rust/tests
Matthias Krüger 89c3fa92d4
Rollup merge of #122438 - jswrenn:check-referent-size, r=compiler-errors
Safe Transmute: Require that source referent is smaller than destination

`BikeshedIntrinsicFrom` currently models transmute-via-union; i.e., it attempts to provide a `where` bound for this function:
```rust
pub unsafe fn transmute_via_union<Src, Dst>(src: Src) -> Dst {
    use core::mem::*;

    #[repr(C)]
    union Transmute<T, U> {
        src: ManuallyDrop<T>,
        dst: ManuallyDrop<U>,
    }

    let transmute = Transmute { src: ManuallyDrop::new(src) };

    // SAFETY: The caller must guarantee that the transmutation is safe.
    let dst = transmute.dst;

    ManuallyDrop::into_inner(dst)
}
```
A quirk of this model is that it admits padding extensions in value-to-value transmutation: The destination type can be bigger than the source type, so long as the excess consists of uninitialized bytes. However, this isn't permissible for reference-to-reference transmutations (introduced in #110662) — extra referent bytes cannot come from thin air.

This PR patches our analysis for reference-to-reference transmutations to require that the destination referent is no larger than the source referent.

r? `@compiler-errors`
2024-03-13 20:01:58 +01:00
..
assembly Rollup merge of #121953 - jhorstmann:assembly-tests-for-masked-simd-instructions, r=workingjubilee 2024-03-12 09:03:59 -07:00
auxiliary
codegen Auto merge of #121668 - erikdesjardins:commonprim, r=scottmcm,oli-obk 2024-03-13 15:25:35 +00:00
codegen-units [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
coverage coverage: Remove all unstable values of -Cinstrument-coverage 2024-03-13 11:14:09 +11:00
coverage-run-rustdoc [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
debuginfo std: move Once implementations to sys 2024-03-12 15:41:06 +01:00
incremental Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
mir-opt Rollup merge of #121908 - Nadrieril:dynamic-variant-collection, r=matthewjasper 2024-03-13 06:41:21 +01:00
pretty Re-bless tests/pretty 2024-02-22 16:04:05 +00:00
run-make Convert some WebAssembly run-make tests to Rust 2024-03-11 09:36:35 -07:00
run-make-fulldeps Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
run-pass-valgrind Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
rustdoc Rollup merge of #122355 - fmease:rustdoc-fix-up-old-test, r=notriddle 2024-03-12 09:04:01 -07:00
rustdoc-gui [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-js [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-js-std Add display method to OsStr 2024-01-18 20:38:31 +00:00
rustdoc-json [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustdoc-ui Auto merge of #122190 - matthiaskrgr:rollup-9ol4y30, r=matthiaskrgr 2024-03-08 17:31:00 +00:00
ui Rollup merge of #122438 - jswrenn:check-referent-size, r=compiler-errors 2024-03-13 20:01:58 +01:00
ui-fulldeps Rollup merge of #122203 - adpaco-aws:smir-intrinsic-name, r=celinval 2024-03-13 06:41:21 +01:00
COMPILER_TESTS.md