rust/src/test/ui/attr-usage-inline.rs
Danuel 8bbb2d057d Fixed #[inline] to be warned in fields, arms, macro defs
Add visitors for checking #[inline]

Add visitors for checking #[inline] with struct field

Fix test for #[inline]

Add visitors for checking #[inline] with #[macro_export] macro

Add visitors for checking #[inline] without #[macro_export] macro

Add use alias with Visitor

Fix lint error

Reduce unnecessary variable

Co-authored-by: LingMan <LingMan@users.noreply.github.com>

Change error to warning

Add warning for checking field, arm with #[allow_internal_unstable]

Add name resolver

Formatting

Formatting

Fix error fixture

Add checking field, arm, macro def
2021-02-01 23:36:19 +09:00

26 lines
346 B
Rust

#![allow(dead_code)]
#[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() {}