summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/parser/attr-stmt-expr-attr-bad.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/parser/attr-stmt-expr-attr-bad.rs')
-rw-r--r--src/test/ui/parser/attr-stmt-expr-attr-bad.rs109
1 files changed, 0 insertions, 109 deletions
diff --git a/src/test/ui/parser/attr-stmt-expr-attr-bad.rs b/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
deleted file mode 100644
index 469c3855c..000000000
--- a/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
+++ /dev/null
@@ -1,109 +0,0 @@
-fn main() {}
-
-#[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
-//~^ ERROR an inner attribute is not permitted in this context
-#[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
-//~| 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] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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 {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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 {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
-//~^ ERROR outer attributes are not allowed on `if`
-#[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 => () } }
-//~^ ERROR inclusive range with no end
-//~| ERROR expected one of `=>`, `if`, or `|`, found `#`
-#[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
-//~^ ERROR inclusive range with no end
-//~| 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 => () } }
-//~^ ERROR inclusive range with no end
-//~| ERROR expected one of `=>`, `if`, or `|`, found `#`
-
-#[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 `.`
-
-// 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] } } }
-//~^ ERROR expected statement after outer attribute