rust/tests/ui/attributes/inline/attr-usage-inline.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
491 B
Rust
Raw Normal View History

//! 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.
2015-09-25 06:25:59 +00:00
#[inline]
fn f() {}
#[inline] //~ ERROR: attribute should be applied to function or closure
2015-09-25 06:25:59 +00:00
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 {
() => {};
}
2015-09-25 06:25:59 +00:00
fn main() {}