blob: 2b0bbaa08357012cd744f2d28397583c10fb2e2a [file] [log] [blame]
//@ compile-flags: --crate-type=lib
//@ revisions: with_gate without_gate
//@ [with_gate] check-pass
#![cfg_attr(with_gate, feature(unsafe_fields))] //[with_gate]~ WARNING
#[cfg(false)]
struct Foo {
unsafe field: (), //[without_gate]~ ERROR
}
// This should not parse as an unsafe field definition.
struct FooTuple(unsafe fn());
#[cfg(false)]
enum Bar {
Variant { unsafe field: () }, //[without_gate]~ ERROR
// This should not parse as an unsafe field definition.
VariantTuple(unsafe fn()),
}
#[cfg(false)]
union Baz {
unsafe field: (), //[without_gate]~ ERROR
}