-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ICE: Type parameter W/#1 out of range when substituting #55872
Comments
Confirmed this is still reproducible as of latest nightly (rustc 1.36.0-nightly (00859e3 2019-04-29)) |
This is about as small as I can get it to repro:
|
Marking as blocking -- thanks for the minimal reproduction @gilescope, that's fantastic! |
@rustbot claim Going to investigate this with @nikomatsakis, see this message. |
Not really related to async-await. This minimization does not involve async/await but gets a very similar ICE: #![feature(existential_type)]
pub trait Bar
{
type E: Copy;
fn foo<T>() -> Self::E;
}
impl <S> Bar for S
{
existential type E: Copy;
fn foo<T>() -> Self::E
{
|| ()
}
}
fn main() {} |
Preferred minimization (no annoying closures): #![feature(existential_type)]
pub trait Bar
{
type E: Copy;
fn foo<T>() -> Self::E;
}
impl <S: Default> Bar for S
{
existential type E: Copy;
fn foo<T: Default>() -> Self::E
{
(S::default(), T::default())
}
}
fn main() {} The problem here is that the inferred type for |
The Zulip thread diagnoses the problem and explains everything in a lot of detail. |
…nge-substitution, r=nikomatsakis typeck: merge opaque type inference logic Fixes rust-lang#55872. See [relevant Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/type.20parameter.20out.20of.20range.20.2355872). r? @nikomatsakis
…nge-substitution, r=nikomatsakis typeck: merge opaque type inference logic Fixes rust-lang#55872. See [relevant Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/type.20parameter.20out.20of.20range.20.2355872). r? @nikomatsakis
…nge-substitution, r=nikomatsakis typeck: merge opaque type inference logic Fixes rust-lang#55872. See [relevant Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/type.20parameter.20out.20of.20range.20.2355872). r? @nikomatsakis
…nge-substitution, r=nikomatsakis typeck: merge opaque type inference logic Fixes rust-lang#55872. See [relevant Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/type.20parameter.20out.20of.20range.20.2355872). r? @nikomatsakis
Playing with async/await, using
and some nightly features, I stumbled upon this ICE.
(possibly related to #55265)
Backtrace:
No ICE happens when writing the trait and implementation like this (notice the Generic parameters are now on the trait definition rather than on the function):
The text was updated successfully, but these errors were encountered: