2019-12-04 04:16:12 -06:00
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
|
|
|
|
//~^ ERROR expected expression, found `]`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
2022-11-16 14:46:06 -06:00
|
|
|
//~| ERROR an inner attribute is not permitted in this context
|
2019-12-04 04:16:12 -06:00
|
|
|
//~| ERROR expected expression, found `)`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
//~| ERROR expected expression, found `)`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = x #![attr] as Y; }
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = || #![attr] foo; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = move || #![attr] foo; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = || #![attr] {foo}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; }
|
|
|
|
//~^ ERROR expected expression, found `..`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = #[attr] ..; }
|
|
|
|
//~^ ERROR expected expression, found `..`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} #[attr] else {}; }
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; }
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
|
2020-03-07 10:16:29 -06:00
|
|
|
//~^ ERROR outer attributes are not allowed on `if`
|
2019-12-04 04:16:12 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted in this context
|
|
|
|
|
|
|
|
#[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted following an outer attribute
|
|
|
|
#[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted following an outer attribute
|
|
|
|
#[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
|
|
|
|
//~^ ERROR an inner attribute is not permitted following an outer attribute
|
|
|
|
#[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted following an outer attribute
|
|
|
|
#[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
|
|
|
|
//~^ ERROR an inner attribute is not permitted following an outer attribute
|
|
|
|
|
|
|
|
// FIXME: Allow attributes in pattern constexprs?
|
|
|
|
// note: requires parens in patterns to allow disambiguation
|
|
|
|
|
|
|
|
#[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
|
2019-12-11 03:04:34 -06:00
|
|
|
//~^ ERROR inclusive range with no end
|
2019-12-04 04:16:12 -06:00
|
|
|
//~| ERROR expected one of `=>`, `if`, or `|`, found `#`
|
|
|
|
#[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
|
2019-12-11 03:04:34 -06:00
|
|
|
//~^ ERROR inclusive range with no end
|
2019-12-04 04:16:12 -06:00
|
|
|
//~| ERROR expected one of `=>`, `if`, or `|`, found `#`
|
|
|
|
#[cfg(FALSE)] fn e() { match 0 { 0..=-#[attr] 10 => () } }
|
|
|
|
//~^ ERROR unexpected token: `#`
|
|
|
|
#[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
|
2019-12-11 03:04:34 -06:00
|
|
|
//~^ ERROR inclusive range with no end
|
2019-12-04 04:16:12 -06:00
|
|
|
//~| ERROR expected one of `=>`, `if`, or `|`, found `#`
|
|
|
|
|
2019-12-06 17:59:56 -06:00
|
|
|
#[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
|
|
|
|
//~^ ERROR unexpected token: `#`
|
|
|
|
//~| ERROR expected one of `.`
|
|
|
|
#[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
|
|
|
|
//~^ ERROR unexpected token: `#`
|
|
|
|
//~| ERROR expected one of `.`
|
|
|
|
|
2019-12-04 04:16:12 -06:00
|
|
|
// make sure we don't catch this bug again...
|
|
|
|
#[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
|
|
|
|
//~^ ERROR expected statement after outer attribute
|
|
|
|
#[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
|
2019-12-30 08:09:42 -06:00
|
|
|
//~^ ERROR expected statement after outer attribute
|