-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 (OutputTypeParameterMismatch) with type_alias_impl_trait #72793
Comments
Just for reference - works fine with explicit lifetimes: fn with_positive<'a, F>(vals: &'a [i32], fun: F)
where
F: Fn(FilteredIter<'a>),
{
fun(filter_positive(vals));
} |
@rustbot modify labels: +requires-nightly +F-type_alias_impl_trait |
Smaller: #![feature(type_alias_impl_trait)]
trait T { type Item; }
type Alias<'a> = impl T<Item = &'a ()>;
struct S;
impl<'a> T for &'a S {
type Item = &'a ();
}
fn filter_positive<'a>() -> Alias<'a> {
&S
}
fn with_positive(fun: impl Fn(Alias<'_>)) {
fun(filter_positive());
}
fn main() {
with_positive(|_| ());
} |
Seems this is fixed in the latest nightly (not bisected yet). Marking as |
Still crashes with
|
Ohh, good catch! Still, the regression test here is useful but let's keep this open then :) Oops, closed by mistake XD |
Bisected, it's fixed by #75443. |
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
Add a regression test for issue-72793 Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
revert rust-lang#75443, update mir validator This PR reverts rust-lang#75443 to fix rust-lang#75992 and instead uses rust-lang#75419 to fix rust-lang#75313. Adapts rust-lang#75419 to correctly deal with unevaluated constants as otherwise some `feature(const_evaluatable_checked)` tests would ICE. Note that rust-lang#72793 was also fixed by rust-lang#75443, but as that issue only concerns `feature(type_alias_impl_trait)` I deleted that test case for now and would reopen that issue. rust-lang#75443 may have also allowed some other code to now successfully compile which would make this revert a breaking change after 2 stable versions, but I hope that this is a purely theoretical concern. See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/generator.20upvars/near/214617274 for more reasoning about this. r? `@nikomatsakis` `@eddyb` `@RalfJung`
This ICEs again now:
|
Because of #78410, dropped |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cc #85499 which probably fixes this |
Seems to be fixed again |
add test for 72793 Fixes rust-lang#72793 r? `@oli-obk`
add test for 72793 Fixes rust-lang#72793 r? ``@oli-obk``
add test for 72793 Fixes rust-lang#72793 r? ```@oli-obk```
add test for 72793 Fixes rust-lang#72793 r? ````@oli-obk````
Code
Here's MCVE: #72793 (comment) (Edited by JohnTitor)
Playground
Error output
Prettied a bit:
Backtrace
The text was updated successfully, but these errors were encountered: