2018-03-27 10:39:15 -05:00
|
|
|
#![feature(stmt_expr_attributes)]
|
|
|
|
|
2018-03-22 10:57:26 -05:00
|
|
|
fn main() {
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
let _a = 4;
|
2018-04-27 00:20:46 -05:00
|
|
|
//~^^ ERROR attribute should be applied to function or closure
|
2018-03-22 10:57:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
#[inline(XYZ)]
|
|
|
|
let _b = 4;
|
2018-04-27 00:20:46 -05:00
|
|
|
//~^^ ERROR attribute should be applied to function or closure
|
2018-03-22 10:57:26 -05:00
|
|
|
|
|
|
|
#[repr(nothing)]
|
|
|
|
let _x = 0;
|
2018-03-27 10:39:15 -05:00
|
|
|
//~^^ ERROR attribute should not be applied to a statement
|
2018-03-22 10:57:26 -05:00
|
|
|
|
|
|
|
#[repr(something_not_real)]
|
|
|
|
loop {
|
|
|
|
()
|
|
|
|
};
|
|
|
|
//~^^^^ ERROR attribute should not be applied to an expression
|
|
|
|
|
|
|
|
#[repr]
|
|
|
|
let _y = "123";
|
2018-03-27 10:39:15 -05:00
|
|
|
//~^^ ERROR attribute should not be applied to a statement
|
2019-05-21 19:47:23 -05:00
|
|
|
//~| ERROR malformed `repr` attribute
|
2018-03-26 21:41:19 -05:00
|
|
|
|
|
|
|
fn foo() {}
|
|
|
|
|
|
|
|
#[inline(ABC)]
|
|
|
|
foo();
|
2018-04-27 00:20:46 -05:00
|
|
|
//~^^ ERROR attribute should be applied to function or closure
|
2018-03-27 10:39:15 -05:00
|
|
|
|
|
|
|
let _z = #[repr] 1;
|
|
|
|
//~^ ERROR attribute should not be applied to an expression
|
2019-05-21 19:47:23 -05:00
|
|
|
//~| ERROR malformed `repr` attribute
|
2018-03-22 10:57:26 -05:00
|
|
|
}
|