forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#131150 - bvanjoi:issue-128327, r=chenyukang only query `params_in_repr` if def kind is adt Fixes rust-lang#128327 `params_in_repr` was only stored in `encode_info_for_adt`, so we only query it when the def kind belongs to them. https://github.com/rust-lang/rust/blob/9e3e5174462afaf6c3b9db9b35c6d1934521848a/compiler/rustc_metadata/src/rmeta/encoder.rs#L1566-L1567
- Loading branch information
Showing
5 changed files
with
45 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
This file was deleted.
Oops, something went wrong.
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,2 +1,5 @@ | ||
pub struct W<T>(T); | ||
pub type Wrapper<T> = W<T>; | ||
pub trait Trait { | ||
type T; | ||
} |
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,16 @@ | ||
//@ aux-build: alias.rs | ||
|
||
// issue#128327 | ||
|
||
extern crate alias; | ||
|
||
use alias::Trait; | ||
struct S; | ||
impl Trait for S { | ||
type T = (); | ||
} | ||
struct A((A, <S as Trait>::T<NOT_EXIST?>)); | ||
//~^ ERROR: invalid `?` in type | ||
//~| ERROR: recursive type `A` has infinite size | ||
|
||
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,25 @@ | ||
error: invalid `?` in type | ||
--> $DIR/infinite-assoc.rs:12:39 | ||
| | ||
LL | struct A((A, <S as Trait>::T<NOT_EXIST?>)); | ||
| ^ `?` is only allowed on expressions, not types | ||
| | ||
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | ||
| | ||
LL | struct A((A, <S as Trait>::T<Option<NOT_EXIST>>)); | ||
| +++++++ ~ | ||
|
||
error[E0072]: recursive type `A` has infinite size | ||
--> $DIR/infinite-assoc.rs:12:1 | ||
| | ||
LL | struct A((A, <S as Trait>::T<NOT_EXIST?>)); | ||
| ^^^^^^^^ - recursive without indirection | ||
| | ||
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | ||
| | ||
LL | struct A((Box<A>, <S as Trait>::T<NOT_EXIST?>)); | ||
| ++++ + | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0072`. |