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

regression: as_place unwrap None #115778

Closed
Mark-Simulacrum opened this issue Sep 12, 2023 · 10 comments · Fixed by #116156
Closed

regression: as_place unwrap None #115778

Mark-Simulacrum opened this issue Sep 12, 2023 · 10 comments · Fixed by #116156
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

[INFO] [stderr] thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:253:31:
[INFO] [stderr] called `Option::unwrap()` on a `None` value
@Mark-Simulacrum Mark-Simulacrum added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Sep 12, 2023
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 12, 2023
@Mark-Simulacrum Mark-Simulacrum added this to the 1.73.0 milestone Sep 12, 2023
@Mark-Simulacrum Mark-Simulacrum removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2023
@matthiaskrgr
Copy link
Member

Might be related to #110453

@apiraino
Copy link
Contributor

I've tried the first 2 crates (bonedaddy.ellidri and edu-sync), they compile on the current stable fail to compile on beta and nightly.

Provisionally assigning P-high waiting for more investigation (Zulip discussion).

@rustbot label -I-prioritize +P-high +T-compiler

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 13, 2023
@apiraino apiraino added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Sep 14, 2023
@apiraino
Copy link
Contributor

apiraino commented Sep 14, 2023

bisected to commit 7e4f5ecde93e629a44ad3678059c5cd364791d27, where in this commit originates the issue:
Regression in rust-lang-ci@7e4f5ec i.e. rollup PR #113120

@rustbot label -e-needs-bisection

@apiraino
Copy link
Contributor

Bisection probably leads to #111571 cc @jhpratt

TIL to look at the perf builds results, they help getting more context. They told me tha PR 111571 is actually commit 7e4f5ecde93e629a44ad3678059c5cd364791d27

@lqd lqd removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Sep 14, 2023
@jhpratt
Copy link
Member

jhpratt commented Sep 14, 2023

I'll take a look at this after RustConf.

@jhpratt
Copy link
Member

jhpratt commented Sep 20, 2023

@apiraino Is it possible the bisection contained an error? I'm not seeing any possible connection. The errors seem unrelated, .unwrap() is not used anywhere in my PR, and proc_macro is not even present in any of the three linked logs.

@apiraino
Copy link
Contributor

apiraino commented Sep 20, 2023

Ok, I give up on reproducing using the crate ellidri (in the latest nightlies the error changed, I can't track the original error anymore). So I've started again using the crate edu-sync I now have a stable reproducible.

I am now a bit more confident the regression is in 34ccd04 (specifically #114022) cc @oli-obk (I see in that patch some code that is in the stacktraces).

sorry @jhpratt for the ping and thanks for pointing me into the right direction :)

@jhpratt
Copy link
Member

jhpratt commented Sep 20, 2023

No worries! Someone mentioned that it may have been incorrect at RustConf, but I wanted to have a chance to look into it myself before saying anything.

I'll be unsubscribing from this issue; please ping if something needs my attention :)

@oli-obk oli-obk self-assigned this Sep 21, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Sep 22, 2023

small, but not yet minimal repro. Should be good enough for the test suite. I'm looking into a fix now.

use std::future::Future;

async fn bop() {
    fold(run(), |mut foo| async move {
        &mut foo.bar;
    })
}

fn fold<Fut, F, U>(_: Foo<U>, f: F)
where
    F: FnMut(Foo<U>) -> Fut,
{
    loop {}
}

struct Foo<F> {
    bar: Vec<F>,
}

fn run() -> Foo<impl Future<Output = ()>> {
    loop {}
}

@oli-obk
Copy link
Contributor

oli-obk commented Sep 22, 2023

I reverted all changes from #114022 and it does not appear to change behaviour. trying a local bisect on the minimal repro.

edit: hmm weird, it also points to that PR. Trying again
edit2: ok now it works, weird

@bors bors closed this as completed in e1636a0 Sep 27, 2023
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Sep 27, 2023
Only prevent field projections into opaque types, not types containing opaque types

fixes rust-lang/rust#115778

I did not think that original condition through properly... I'll also need to check the similar check around the other `ProjectionKind::OpaqueCast` creation site (this one is in hir, the other one is in mir), but I'll do that change in another PR that doesn't go into a beta backport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants