Skip to content
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

higher ranked projections: ICE -> compile change #107564

Closed
lcnr opened this issue Feb 1, 2023 · 1 comment · Fixed by #126137
Closed

higher ranked projections: ICE -> compile change #107564

lcnr opened this issue Feb 1, 2023 · 1 comment · Fixed by #126137
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Feb 1, 2023

trait Trait<'a> {
    type Assoc;
}

fn foo<T: for<'a> Trait<'a>>() -> for<'a> fn(<T as Trait<'a>>::Assoc) {
    todo!()
}

fn bar<T: for<'a> Trait<'a>>() {
    let _: for<'a> fn(<_ as Trait<'a>>::Assoc) = foo::<T>();
}

This changed from an ICE on stable to compiling on beta and nightly: https://godbolt.org/z/E45bfa1d1

this shouldn't happen unintentionally and afaik we haven't added a test for this behavior either.

It would be very good to figure out which PR is responsible for this change.

@lcnr lcnr added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc T-types Relevant to the types team, which will review and decide on the PR/issue. labels Feb 1, 2023
@lukas-code
Copy link
Member

searched nightlies: from nightly-2023-01-07 to nightly-2023-01-29
regressed nightly: nightly-2023-01-10
searched commit range: cc47b06...3020239
regressed commit: af58fc8 (#101947)

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --regress=non-ice -- check 

@Noratrieb Noratrieb removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Feb 1, 2023
@lcnr lcnr changed the title higher ranked projections: bisect ICE -> compile change higher ranked projections: ICE -> compile change Feb 17, 2023
@fmease fmease added A-trait-system Area: Trait system E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. C-bug Category: This is a bug. labels Jun 8, 2024
@bors bors closed this as completed in 39fe991 Jun 9, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 9, 2024
Rollup merge of rust-lang#126137 - Enselic:normalize-generic-arg, r=compiler-errors

tests: Add ui/higher-ranked/trait-bounds/normalize-generic-arg.rs

This adds a regression test for an ICE "accidentally" fixed by rust-lang#101947 that does not add a test for this particular case.

Closes rust-lang#107564.

I have confirmed the added test code fails with `nightly-2023-01-09` (and passes with `nightly-2023-01-10` and of course recent `nightly`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants