rust/tests/ui/layout
bors 7660aed73d Auto merge of #132173 - veluca93:abi_checks, r=RalfJung,compiler-errors
Emit warning when calling/declaring functions with unavailable vectors.

On some architectures, vector types may have a different ABI depending on whether the relevant target features are enabled. (The ABI when the feature is disabled is often not specified, but LLVM implements some de-facto ABI.)

As discussed in rust-lang/lang-team#235, this turns out to very easily lead to unsound code.

This commit makes it a post-monomorphization future-incompat warning to declare or call functions using those vector types in a context in which the corresponding target features are disabled, if using an ABI for which the difference is relevant. This ensures that these functions are always called with a consistent ABI.

See the [nomination comment](https://github.com/rust-lang/rust/pull/127731#issuecomment-2288558187) for more discussion.

Part of #116558

r? RalfJung
2024-11-10 02:52:25 +00:00
..
base-layout-is-sized-ice-123078.rs add test for ICE: !base.layout().is_sized() #123078 2024-04-06 23:30:51 +02:00
base-layout-is-sized-ice-123078.stderr transmute size check: properly account for alignment 2024-05-30 10:06:28 +02:00
big-type-no-err.rs
cannot-transmute-unnormalizable-type.rs
cannot-transmute-unnormalizable-type.stderr
debug.rs layout computation: eagerly error for unexpected unsized fields 2024-09-16 15:53:21 +02:00
debug.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
enum-scalar-pair-int-ptr.rs tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
enum-scalar-pair-int-ptr.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
enum.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
enum.stderr
failed-to-get-layout-for-type-error-ice-92979.rs
failed-to-get-layout-for-type-error-ice-92979.stderr
hexagon-enum.rs
hexagon-enum.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
homogeneous-aggr-transparent.rs
homogeneous-aggr-transparent.stderr
homogeneous-aggr-zero-sized-c-struct.rs
homogeneous-aggr-zero-sized-c-struct.stderr
homogeneous-aggr-zero-sized-repr-rust.rs
homogeneous-aggr-zero-sized-repr-rust.stderr
ice-non-last-unsized-field-issue-121473.rs Error out of layout calculation if a non-last struct field is unsized 2024-04-04 15:50:36 +05:30
ice-non-last-unsized-field-issue-121473.stderr Error out of layout calculation if a non-last struct field is unsized 2024-04-04 15:50:36 +05:30
ice-type-error-in-tail-124031.rs Fix ICE when ADT tail has type error 2024-04-22 09:12:36 +05:30
ice-type-error-in-tail-124031.stderr Fix ICE when ADT tail has type error 2024-04-22 09:12:36 +05:30
invalid-unsized-const-eval.rs layout computation: eagerly error for unexpected unsized fields 2024-09-16 15:53:21 +02:00
invalid-unsized-const-eval.stderr layout computation: eagerly error for unexpected unsized fields 2024-09-16 15:53:21 +02:00
invalid-unsized-const-prop.rs get rid of an old hack 2024-09-17 00:09:21 +02:00
invalid-unsized-in-always-sized-tail.rs get rid of an old hack 2024-09-17 00:09:21 +02:00
invalid-unsized-in-always-sized-tail.stderr get rid of an old hack 2024-09-17 00:09:21 +02:00
issue-60431-unsized-tail-behind-projection.rs
issue-84108.rs Allow type_of to return partially non-error types if the type was already tainted 2024-05-28 11:55:20 +00:00
issue-84108.stderr Allow type_of to return partially non-error types if the type was already tainted 2024-05-28 11:55:20 +00:00
issue-96158-scalarpair-payload-might-be-uninit.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
issue-96158-scalarpair-payload-might-be-uninit.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
issue-96185-overaligned-enum.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
issue-96185-overaligned-enum.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
issue-112048-unsizing-field-order.rs
issue-112048-unsizing-niche.rs
issue-113941.rs
issue-unsized-tail-restatic-ice-122488.rs add test for ICE: Unexpected unsized type tail: &ReStatic [u8] #122488 2024-04-06 23:34:46 +02:00
issue-unsized-tail-restatic-ice-122488.stderr add test for ICE: Unexpected unsized type tail: &ReStatic [u8] #122488 2024-04-06 23:34:46 +02:00
layout-cycle.rs
layout-cycle.stderr
malformed-unsized-type-in-union.rs
malformed-unsized-type-in-union.stderr
post-mono-layout-cycle-2.rs Emit warning when calling/declaring functions with unavailable vectors. 2024-11-01 22:24:35 +01:00
post-mono-layout-cycle-2.stderr Emit warning when calling/declaring functions with unavailable vectors. 2024-11-01 22:24:35 +01:00
post-mono-layout-cycle.rs Emit warning when calling/declaring functions with unavailable vectors. 2024-11-01 22:24:35 +01:00
post-mono-layout-cycle.stderr Emit warning when calling/declaring functions with unavailable vectors. 2024-11-01 22:24:35 +01:00
rust-call-abi-not-a-tuple-ice-81974.rs
rust-call-abi-not-a-tuple-ice-81974.stderr Suggest creating unary tuples 2024-11-04 12:06:19 +01:00
size-of-val-raw-too-big.rs TL note: current means target 2024-09-20 10:02:14 -07:00
size-of-val-raw-too-big.stderr TL note: current means target 2024-09-20 10:02:14 -07:00
struct.rs tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
struct.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
thaw-transmute-invalid-enum.rs use backticks instead of single quotes when reporting "use of unstable library feature" 2024-11-03 13:55:52 -08:00
thaw-transmute-invalid-enum.stderr use backticks instead of single quotes when reporting "use of unstable library feature" 2024-11-03 13:55:52 -08:00
thaw-validate-invalid-enum.rs compiler: Reject impossible reprs during enum layout 2024-10-20 02:12:58 -07:00
thaw-validate-invalid-enum.stderr compiler: Reject impossible reprs during enum layout 2024-10-20 02:12:58 -07:00
thin-meta-implies-thin-ptr.rs
thumb-enum.rs
thumb-enum.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
too-big-with-padding.rs TL note: current means target 2024-09-20 10:02:14 -07:00
too-big-with-padding.stderr TL note: current means target 2024-09-20 10:02:14 -07:00
transmute-to-tail-with-err.rs
transmute-to-tail-with-err.stderr
trivial-bounds-sized.rs layout computation: eagerly error for unexpected unsized fields 2024-09-16 15:53:21 +02:00
unsafe-cell-hides-niche.rs Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
unsatisfiable-sized-ungated.rs layout computation: eagerly error for unexpected unsized fields 2024-09-16 15:53:21 +02:00
valid_range_oob.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
valid_range_oob.stderr
zero-sized-array-enum-niche.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
zero-sized-array-enum-niche.stderr tests: Bless rustc_abi::Abi::Aggregate => ::Memory 2024-10-30 01:41:31 -07:00
zero-sized-array-union.rs
zero-sized-array-union.stderr