-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #103870 - TaKO8Ki:fix-103790, r=fee1-dead
Fix `inferred_kind` ICE Fixes #103790
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 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,10 @@ | ||
#![feature(generic_const_exprs)] | ||
#![allow(incomplete_features)] | ||
|
||
struct S<const S: (), const S: S = { S }>; | ||
//~^ ERROR the name `S` is already used for a generic parameter in this item's generic parameters | ||
//~| ERROR missing generics for struct `S` | ||
//~| ERROR cycle detected when computing type of `S::S` | ||
//~| ERROR cycle detected when computing type of `S` | ||
|
||
fn main() {} |
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,65 @@ | ||
error[E0403]: the name `S` is already used for a generic parameter in this item's generic parameters | ||
--> $DIR/issue-103790.rs:4:29 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| - ^ already used | ||
| | | ||
| first use of `S` | ||
|
||
error[E0107]: missing generics for struct `S` | ||
--> $DIR/issue-103790.rs:4:32 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^ expected at least 1 generic argument | ||
| | ||
note: struct defined here, with at least 1 generic parameter: `S` | ||
--> $DIR/issue-103790.rs:4:8 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^ ----------- | ||
help: add missing generic argument | ||
| | ||
LL | struct S<const S: (), const S: S<S> = { S }>; | ||
| ~~~~ | ||
|
||
error[E0391]: cycle detected when computing type of `S::S` | ||
--> $DIR/issue-103790.rs:4:32 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^ | ||
| | ||
= note: ...which immediately requires computing type of `S::S` again | ||
note: cycle used when computing type of `S` | ||
--> $DIR/issue-103790.rs:4:1 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0391]: cycle detected when computing type of `S` | ||
--> $DIR/issue-103790.rs:4:1 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing type of `S::S`... | ||
--> $DIR/issue-103790.rs:4:32 | ||
| | ||
LL | struct S<const S: (), const S: S = { S }>; | ||
| ^ | ||
= note: ...which again requires computing type of `S`, completing the cycle | ||
note: cycle used when collecting item types in top-level module | ||
--> $DIR/issue-103790.rs:1:1 | ||
| | ||
LL | / #![feature(generic_const_exprs)] | ||
LL | | #![allow(incomplete_features)] | ||
LL | | | ||
LL | | struct S<const S: (), const S: S = { S }>; | ||
... | | ||
LL | | | ||
LL | | fn main() {} | ||
| |____________^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0391, E0403. | ||
For more information about an error, try `rustc --explain E0107`. |