-
Notifications
You must be signed in to change notification settings - Fork 13.4k
move super_relate_consts
hack to normalize_param_env_or_error
#111623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
#[derive(Default)] | ||
struct Foo { | ||
x: i32, | ||
} | ||
|
||
impl MyDefault for Foo { | ||
fn my_default() -> Self { | ||
Self { | ||
x: 0, | ||
} | ||
} | ||
} | ||
|
||
trait MyDefault { | ||
fn my_default() -> Self; | ||
} | ||
|
||
impl MyDefault for [Foo; 0] { | ||
fn my_default() -> Self { | ||
[] | ||
} | ||
} | ||
impl MyDefault for [Foo; 1] { | ||
fn my_default() -> Self { | ||
[Foo::my_default(); 1] | ||
} | ||
} | ||
|
||
fn main() { | ||
let mut xs = <[Foo; 1]>::default(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. attemtping to prove This PR is fine to land even with this, new solver is completely experimental and needs to have const normalization implemented at some point anyway. |
||
let mut xs = <[Foo; 1]>::my_default(); | ||
xs[0].x = 1; | ||
(&mut xs[0]).x = 2; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.