forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#65777 - matthewjasper:allow-impl-trait-expa…
…nsion, r=davidtwco Don't ICE for completely unexpandable `impl Trait` types Save the resolution of these types (to themselves) to the typeck tables so that they will eventually reach E0720. closes rust-lang#65561
- Loading branch information
Showing
7 changed files
with
48 additions
and
28 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
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,7 @@ | ||
// Test that an `impl Trait` type that expands to itself is an error. | ||
|
||
fn test() -> impl Sized { //~ ERROR E0720 | ||
test() | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/impl-trait/recursive-impl-trait-type-direct.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,11 @@ | ||
error[E0720]: opaque type expands to a recursive type | ||
--> $DIR/recursive-impl-trait-type-direct.rs:3:14 | ||
| | ||
LL | fn test() -> impl Sized { | ||
| ^^^^^^^^^^ expands to a recursive type | ||
| | ||
= note: type resolves to itself | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0720`. |
File renamed without changes.
40 changes: 20 additions & 20 deletions
40
...pl-trait/recursive-impl-trait-type.stderr → ...recursive-impl-trait-type-indirect.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
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...-trait-type--through-non-recursize.stderr → ...l-trait-type-through-non-recursive.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