Implement repr(transparent)

This commit is contained in:
Robin Kruppe 2018-01-03 17:43:30 +01:00
parent 79a521bb9a
commit 2be697bc21
21 changed files with 881 additions and 12 deletions

View file

@ -0,0 +1,14 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[repr(transparent)] //~ error: the `#[repr(transparent)]` attribute is experimental
struct Foo(u64);
fn main() {}

View file

@ -0,0 +1,10 @@
error[E0658]: the `#[repr(transparent)]` attribute is experimental (see issue #43036)
--> $DIR/feature-gate-repr_transparent.rs:11:1
|
11 | #[repr(transparent)] //~ error: the `#[repr(transparent)]` attribute is experimental
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(repr_transparent)] to the crate attributes to enable
error: aborting due to previous error