-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #112416 - jieyouxu:issue-112363, r=wesleywiser
Fix debug ICE for extern type with where clauses Fixes #112363.
- Loading branch information
Showing
5 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
extern "C" { | ||
type Item = [T] where [T]: Sized; | ||
//~^ incorrect `type` inside `extern` block | ||
//~| `type`s inside `extern` blocks cannot have `where` clauses | ||
//~| cannot find type `T` in this scope | ||
//~| cannot find type `T` in this scope | ||
//~| extern types are experimental | ||
} | ||
|
||
fn main() {} |
47 changes: 47 additions & 0 deletions
47
tests/ui/extern/issue-112363-extern-item-where-clauses-debug-ice.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
error: incorrect `type` inside `extern` block | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:10 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` blocks define existing foreign types and types inside of them cannot have a body | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^ --- the invalid body | ||
| | | ||
| cannot have a body | ||
| | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error: `type`s inside `extern` blocks cannot have `where` clauses | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:21 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` block begins here | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^^^^^^^^^^^^^ help: remove the `where` clause | ||
| | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:28 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^ not found in this scope | ||
|
||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:18 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^ not found in this scope | ||
|
||
error[E0658]: extern types are experimental | ||
--> $DIR/issue-112363-extern-item-where-clauses-debug-ice.rs:2:5 | ||
| | ||
LL | type Item = [T] where [T]: Sized; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #43467 <https://github.com/rust-lang/rust/issues/43467> for more information | ||
= help: add `#![feature(extern_types)]` to the crate attributes to enable | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0412, E0658. | ||
For more information about an error, try `rustc --explain E0412`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters