rust/tests/ui/layout
Matthias Krüger a4f323ce9c
Rollup merge of #132583 - mejrs:tuples, r=compiler-errors
Suggest creating unary tuples when types don't match a trait

When you want to have a variadic function, a common workaround to implement this is to create a trait and then implement that trait for various tuples. For example in `pyo3` there exists
```rust
/// Calls the object with only positional arguments.
pub fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<&PyAny> {
   ...
}
```

with various impls like
```rust
impl<A: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A,)
impl<A: IntoPy<PyObject, B: IntoPy<PyObject> IntoPy<Py<PyAny>> for (A, B)
... etc
```

This means that if you want to call the method with a single item you have to create a unary tuple, like `(x,)`, rather than just `x`.

This PR implements a suggestion to do that, if applicable.
2024-11-04 18:12:48 +01:00
..
base-layout-is-sized-ice-123078.rs
base-layout-is-sized-ice-123078.stderr
big-type-no-err.rs
cannot-transmute-unnormalizable-type.rs
cannot-transmute-unnormalizable-type.stderr
debug.rs
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
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
ice-non-last-unsized-field-issue-121473.stderr
ice-type-error-in-tail-124031.rs
ice-type-error-in-tail-124031.stderr
invalid-unsized-const-eval.rs
invalid-unsized-const-eval.stderr
invalid-unsized-const-prop.rs
invalid-unsized-in-always-sized-tail.rs
invalid-unsized-in-always-sized-tail.stderr
issue-60431-unsized-tail-behind-projection.rs
issue-84108.rs
issue-84108.stderr
issue-96158-scalarpair-payload-might-be-uninit.rs
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
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
issue-unsized-tail-restatic-ice-122488.stderr
layout-cycle.rs
layout-cycle.stderr
malformed-unsized-type-in-union.rs
malformed-unsized-type-in-union.stderr
post-mono-layout-cycle-2.rs Revert "Emit error when calling/declaring functions with unavailable vectors." 2024-10-25 20:42:09 +00:00
post-mono-layout-cycle-2.stderr Revert "Emit error when calling/declaring functions with unavailable vectors." 2024-10-25 20:42:09 +00:00
post-mono-layout-cycle.rs Revert "Emit error when calling/declaring functions with unavailable vectors." 2024-10-25 20:42:09 +00:00
post-mono-layout-cycle.stderr Revert "Emit error when calling/declaring functions with unavailable vectors." 2024-10-25 20:42:09 +00: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
unsafe-cell-hides-niche.rs
unsatisfiable-sized-ungated.rs
valid_range_oob.rs
valid_range_oob.stderr
zero-sized-array-enum-niche.rs
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