summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issues
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/issues')
-rw-r--r--tests/ui/parser/issues/issue-113110-non-item-at-module-root.rs1
-rw-r--r--tests/ui/parser/issues/issue-113110-non-item-at-module-root.stderr10
-rw-r--r--tests/ui/parser/issues/issue-17904-2.stderr2
-rw-r--r--tests/ui/parser/issues/issue-43196.stderr2
-rw-r--r--tests/ui/parser/issues/issue-62913.stderr2
-rw-r--r--tests/ui/parser/issues/issue-68890.stderr2
-rw-r--r--tests/ui/parser/issues/issue-89388.stderr7
-rw-r--r--tests/ui/parser/issues/issue-98601-delimiter-error-1.rs9
-rw-r--r--tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr16
-rw-r--r--tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.rs5
-rw-r--r--tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.stderr14
11 files changed, 69 insertions, 1 deletions
diff --git a/tests/ui/parser/issues/issue-113110-non-item-at-module-root.rs b/tests/ui/parser/issues/issue-113110-non-item-at-module-root.rs
new file mode 100644
index 000000000..3b6f43043
--- /dev/null
+++ b/tests/ui/parser/issues/issue-113110-non-item-at-module-root.rs
@@ -0,0 +1 @@
+ 5 //~ ERROR expected item, found `5`
diff --git a/tests/ui/parser/issues/issue-113110-non-item-at-module-root.stderr b/tests/ui/parser/issues/issue-113110-non-item-at-module-root.stderr
new file mode 100644
index 000000000..0789c4548
--- /dev/null
+++ b/tests/ui/parser/issues/issue-113110-non-item-at-module-root.stderr
@@ -0,0 +1,10 @@
+error: expected item, found `5`
+ --> $DIR/issue-113110-non-item-at-module-root.rs:1:2
+ |
+LL | 5
+ | ^ expected item
+ |
+ = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issues/issue-17904-2.stderr b/tests/ui/parser/issues/issue-17904-2.stderr
index 9c7fdf6cc..7185a5e57 100644
--- a/tests/ui/parser/issues/issue-17904-2.stderr
+++ b/tests/ui/parser/issues/issue-17904-2.stderr
@@ -3,6 +3,8 @@ error: expected item, found keyword `where`
|
LL | struct Bar<T> { x: T } where T: Copy
| ^^^^^ expected item
+ |
+ = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
error: aborting due to previous error
diff --git a/tests/ui/parser/issues/issue-43196.stderr b/tests/ui/parser/issues/issue-43196.stderr
index 4f7ed5cc6..15bbb158c 100644
--- a/tests/ui/parser/issues/issue-43196.stderr
+++ b/tests/ui/parser/issues/issue-43196.stderr
@@ -11,6 +11,8 @@ error: expected item, found `|`
|
LL | |
| ^ expected item
+ |
+ = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/issues/issue-62913.stderr b/tests/ui/parser/issues/issue-62913.stderr
index 6f385e8dc..c33e46837 100644
--- a/tests/ui/parser/issues/issue-62913.stderr
+++ b/tests/ui/parser/issues/issue-62913.stderr
@@ -17,6 +17,8 @@ error: expected item, found `"\u\"`
|
LL | "\u\"
| ^^^^^^ expected item
+ |
+ = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
error: aborting due to 3 previous errors
diff --git a/tests/ui/parser/issues/issue-68890.stderr b/tests/ui/parser/issues/issue-68890.stderr
index 2a3bf6b41..0d7b53a67 100644
--- a/tests/ui/parser/issues/issue-68890.stderr
+++ b/tests/ui/parser/issues/issue-68890.stderr
@@ -15,6 +15,8 @@ error: expected item, found `)`
|
LL | enum e{A((?'a a+?+l))}
| ^ expected item
+ |
+ = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
error: aborting due to 3 previous errors
diff --git a/tests/ui/parser/issues/issue-89388.stderr b/tests/ui/parser/issues/issue-89388.stderr
index cf28bef0f..366d05c2d 100644
--- a/tests/ui/parser/issues/issue-89388.stderr
+++ b/tests/ui/parser/issues/issue-89388.stderr
@@ -2,7 +2,12 @@ error: missing angle brackets in associated item path
--> $DIR/issue-89388.rs:5:24
|
LL | let _ = option.map([_]::to_vec);
- | ^^^^^^^^^^^ help: try: `<[_]>::to_vec`
+ | ^^^
+ |
+help: types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
+ |
+LL | let _ = option.map(<[_]>::to_vec);
+ | + +
error: aborting due to previous error
diff --git a/tests/ui/parser/issues/issue-98601-delimiter-error-1.rs b/tests/ui/parser/issues/issue-98601-delimiter-error-1.rs
new file mode 100644
index 000000000..cfbbd014d
--- /dev/null
+++ b/tests/ui/parser/issues/issue-98601-delimiter-error-1.rs
@@ -0,0 +1,9 @@
+fn foo() {
+ match 0 {
+ _ => {}
+ }
+ if foo
+ }
+} //~ ERROR unexpected closing delimiter: `}`
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr b/tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr
new file mode 100644
index 000000000..d568a4c58
--- /dev/null
+++ b/tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr
@@ -0,0 +1,16 @@
+error: unexpected closing delimiter: `}`
+ --> $DIR/issue-98601-delimiter-error-1.rs:7:1
+ |
+LL | fn foo() {
+ | - this delimiter might not be properly closed...
+LL | match 0 {
+LL | _ => {}
+ | -- block is empty, you might have not meant to close it
+...
+LL | }
+ | - ...as it matches this but it has different indentation
+LL | }
+ | ^ unexpected closing delimiter
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.rs b/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.rs
new file mode 100644
index 000000000..254e816cf
--- /dev/null
+++ b/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.rs
@@ -0,0 +1,5 @@
+fn main() {
+ todo!();
+}
+
+fn other(_: i32)) {} //~ ERROR unexpected closing delimiter: `)`
diff --git a/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.stderr b/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.stderr
new file mode 100644
index 000000000..81dd39bb7
--- /dev/null
+++ b/tests/ui/parser/issues/issue-98601-delimiter-error-unexpected-close.stderr
@@ -0,0 +1,14 @@
+error: unexpected closing delimiter: `)`
+ --> $DIR/issue-98601-delimiter-error-unexpected-close.rs:5:17
+ |
+LL | fn main() {
+ | - this opening brace...
+LL | todo!();
+LL | }
+ | - ...matches this closing brace
+LL |
+LL | fn other(_: i32)) {}
+ | ^ unexpected closing delimiter
+
+error: aborting due to previous error
+