summary refs log tree commit diff
path: root/tests/ui/attributes/malformed-fn-align.rs
blob: da5284fd4bd4e2beb2229a42ba6a7ef2aa7e33c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ignore-tidy-linelength

// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
#![feature(fn_align)]

#![crate_type = "lib"]

trait MyTrait {
    #[rustc_align] //~ ERROR malformed `rustc_align` attribute input
    fn myfun1();

    #[rustc_align(1, 2)] //~ ERROR malformed `rustc_align` attribute input
    fn myfun2();
}

#[rustc_align = 16] //~ ERROR malformed `rustc_align` attribute input
fn f1() {}

#[rustc_align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer
fn f2() {}

#[rustc_align(0)] //~ ERROR invalid alignment value: not a power of two
fn f3() {}

#[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on function items
fn f4() {}

#[rustc_align(16)] //~ ERROR `#[rustc_align(...)]` is not supported on struct items
struct S1;