about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-06-08 16:14:54 +0800
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-06-12 15:15:45 +0800
commit72421bfb0c2a2a0209fbc96bb9a7d332589661d9 (patch)
tree00c01db2169402a330a332ba04a719560be09810 /tests/ui/parser
parent37998ab508d5d9fa0d465d7b535dc673087dda8f (diff)
downloadrust-72421bfb0c2a2a0209fbc96bb9a7d332589661d9.tar.gz
rust-72421bfb0c2a2a0209fbc96bb9a7d332589661d9.zip
Fix debug ICE for extern type with where clauses
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/foreign-ty-semantic-fail.rs1
-rw-r--r--tests/ui/parser/foreign-ty-semantic-fail.stderr13
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/ui/parser/foreign-ty-semantic-fail.rs b/tests/ui/parser/foreign-ty-semantic-fail.rs
index 96b15232b10..4d30086e765 100644
--- a/tests/ui/parser/foreign-ty-semantic-fail.rs
+++ b/tests/ui/parser/foreign-ty-semantic-fail.rs
@@ -15,4 +15,5 @@ extern "C" {
     //~^ ERROR incorrect `type` inside `extern` block
 
     type E: where;
+    //~^ ERROR `type`s inside `extern` blocks cannot have `where` clauses
 }
diff --git a/tests/ui/parser/foreign-ty-semantic-fail.stderr b/tests/ui/parser/foreign-ty-semantic-fail.stderr
index 588e4966aae..2b400dfea3b 100644
--- a/tests/ui/parser/foreign-ty-semantic-fail.stderr
+++ b/tests/ui/parser/foreign-ty-semantic-fail.stderr
@@ -61,5 +61,16 @@ LL |     type D = u8;
    |
    = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
 
-error: aborting due to 6 previous errors
+error: `type`s inside `extern` blocks cannot have `where` clauses
+  --> $DIR/foreign-ty-semantic-fail.rs:17:13
+   |
+LL | extern "C" {
+   | ---------- `extern` block begins here
+...
+LL |     type E: where;
+   |             ^^^^^ help: remove the `where` clause
+   |
+   = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
+
+error: aborting due to 7 previous errors