about summary refs log tree commit diff
path: root/tests/ui/attributes/inline/attr-usage-inline.rs
blob: d8ca0fce1631df1530027e55ae65094466ba1b77 (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
//! Check that `#[inline]` attribute can only be applied to fn-like targets (e.g. function or
//! closure), and when misapplied to other targets an error is emitted.

#[inline]
fn f() {}

#[inline] //~ ERROR: attribute should be applied to function or closure
struct S;

struct I {
    #[inline]
    i: u8,
}

#[macro_export]
#[inline]
macro_rules! m_e {
    () => {};
}

#[inline] //~ ERROR: attribute should be applied to function or closure
macro_rules! m {
    () => {};
}

fn main() {}