mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
18 lines
505 B
Rust
18 lines
505 B
Rust
#![feature(rustc_attrs, stmt_expr_attributes)]
|
|
|
|
fn foo(_: u32, _: u32) {}
|
|
fn bar(_: u32) {}
|
|
|
|
fn main() {
|
|
#[rustc_box]
|
|
Box::new(1); // OK
|
|
#[rustc_box]
|
|
Box::pin(1); //~ ERROR `#[rustc_box]` attribute used incorrectly
|
|
#[rustc_box]
|
|
foo(1, 1); //~ ERROR `#[rustc_box]` attribute used incorrectly
|
|
#[rustc_box]
|
|
bar(1); //~ ERROR `#[rustc_box]` attribute used incorrectly
|
|
#[rustc_box] //~ ERROR `#[rustc_box]` attribute used incorrectly
|
|
#[rustfmt::skip]
|
|
Box::new(1);
|
|
}
|