-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This runs _just_ enough of typeck that later queries don't panic. Because this is in the same part of the compiler that errors on `impl Trait`, this special-cases impl Trait for rustdoc and no one else. Everything is fine.
- Loading branch information
Showing
7 changed files
with
64 additions
and
25 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
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
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 @@ | ||
fn f() -> impl Sized { | ||
enum E { | ||
//~^ ERROR recursive type `f::E` has infinite size | ||
V(E), | ||
} | ||
unimplemented!() | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/rustdoc-ui/infinite-recursive-type-impl-trait.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,17 @@ | ||
error[E0072]: recursive type `f::E` has infinite size | ||
--> $DIR/infinite-recursive-type-impl-trait.rs:2:5 | ||
| | ||
LL | enum E { | ||
| ^^^^^^ recursive type has infinite size | ||
LL | | ||
LL | V(E), | ||
| - recursive without indirection | ||
| | ||
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `f::E` representable | ||
| | ||
LL | V(Box<E>), | ||
| ^^^^ ^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0072`. |
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 |
---|---|---|
@@ -1,26 +1,17 @@ | ||
error: internal compiler error[E0391]: cycle detected when computing `Sized` constraints for `E` | ||
error[E0072]: recursive type `E` has infinite size | ||
--> $DIR/infinite-recursive-type.rs:1:1 | ||
| | ||
LL | enum E { | ||
| ^^^^^^ | ||
| ^^^^^^ recursive type has infinite size | ||
LL | | ||
LL | V(E), | ||
| - recursive without indirection | ||
| | ||
= note: ...which again requires computing `Sized` constraints for `E`, completing the cycle | ||
= note: cycle used when evaluating trait selection obligation `E: std::convert::From<E>` | ||
|
||
error: internal compiler error: TyKind::Error constructed but no error reported | ||
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E` representable | ||
| | ||
= note: delayed at /home/joshua/rustc/src/librustc_session/session.rs:436:27 | ||
|
||
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17 | ||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace | ||
|
||
error: internal compiler error: unexpected panic | ||
|
||
note: the compiler unexpectedly panicked. this is a bug. | ||
|
||
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md | ||
|
||
note: rustc 1.47.0-dev running on x86_64-unknown-linux-gnu | ||
LL | V(Box<E>), | ||
| ^^^^ ^ | ||
|
||
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z unstable-options -C debuginfo=0 | ||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0072`. |