diff options
| author | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:40:02 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:51:42 +0100 |
| commit | 02e812af4d936a0984802bb76bb3e423e2fb94a5 (patch) | |
| tree | 196fe8bde7074c1a5fa2b0af4a74892c51c8188c /tests/ui/trailing_empty_array.rs | |
| parent | 17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff) | |
| parent | 15180d4eb9dcff9441a8c3ff3382804123c5b0a1 (diff) | |
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/trailing_empty_array.rs')
| -rw-r--r-- | tests/ui/trailing_empty_array.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/ui/trailing_empty_array.rs b/tests/ui/trailing_empty_array.rs index ea3b8ff01af..a8c3ffdb0da 100644 --- a/tests/ui/trailing_empty_array.rs +++ b/tests/ui/trailing_empty_array.rs @@ -4,39 +4,39 @@ // Do lint: struct RarelyUseful { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; 0], } struct OnlyField { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array first_and_last: [usize; 0], } struct GenericArrayType<T> { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [T; 0], } #[must_use] struct OnlyAnotherAttribute { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; 0], } #[derive(Debug)] struct OnlyADeriveAttribute { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; 0], } const ZERO: usize = 0; struct ZeroSizedWithConst { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; ZERO], } @@ -46,7 +46,7 @@ const fn compute_zero() -> usize { (4 + 6) - (2 * 5) } struct ZeroSizedWithConstFunction { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; compute_zero()], } @@ -55,19 +55,19 @@ const fn compute_zero_from_arg(x: usize) -> usize { x - 1 } struct ZeroSizedWithConstFunction2 { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array field: i32, last: [usize; compute_zero_from_arg(1)], } struct ZeroSizedArrayWrapper([usize; 0]); -//~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib +//~^ trailing_empty_array struct TupleStruct(i32, [usize; 0]); -//~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib +//~^ trailing_empty_array struct LotsOfFields { - //~^ ERROR: trailing zero-sized array in a struct which is not marked with a `repr` attrib + //~^ trailing_empty_array f1: u32, f2: u32, f3: u32, |
