Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov
Fix feature gate only being checked on first repr attr. Reported in https://github.com/rust-lang/rust/issues/33158#issuecomment-412185357.
This commit is contained in:
commit
0708a6a717
6 changed files with 32 additions and 3 deletions
|
|
@ -11,4 +11,8 @@
|
|||
#[repr(simd)] //~ error: SIMD types are experimental
|
||||
struct Foo(u64, u64);
|
||||
|
||||
#[repr(C)]
|
||||
#[repr(simd)] //~ error: SIMD types are experimental
|
||||
struct Bar(u64, u64);
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@ LL | #[repr(simd)] //~ error: SIMD types are experimental
|
|||
|
|
||||
= help: add #![feature(repr_simd)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0658]: SIMD types are experimental and possibly buggy (see issue #27731)
|
||||
--> $DIR/feature-gate-repr-simd.rs:15:1
|
||||
|
|
||||
LL | #[repr(simd)] //~ error: SIMD types are experimental
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(repr_simd)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -11,4 +11,8 @@
|
|||
#[repr(packed(1))] //~ error: the `#[repr(packed(n))]` attribute is experimental
|
||||
struct Foo(u64);
|
||||
|
||||
#[repr(C)]
|
||||
#[repr(packed(1))] //~ error: the `#[repr(packed(n))]` attribute is experimental
|
||||
struct Bar(u64);
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,14 @@ LL | #[repr(packed(1))] //~ error: the `#[repr(packed(n))]` attribute is experim
|
|||
|
|
||||
= help: add #![feature(repr_packed)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0658]: the `#[repr(packed(n))]` attribute is experimental (see issue #33158)
|
||||
--> $DIR/feature-gate-repr_packed.rs:15:1
|
||||
|
|
||||
LL | #[repr(packed(1))] //~ error: the `#[repr(packed(n))]` attribute is experimental
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(repr_packed)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue