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:
kennytm 2018-11-07 18:01:53 +08:00 committed by GitHub
commit 0708a6a717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 3 deletions

View file

@ -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() {}

View file

@ -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`.

View file

@ -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() {}

View file

@ -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`.