-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE infering higher-ranked lifetime with a builder pattern #80409
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-inference
Area: Type inference
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
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.
Comments
use std::marker::PhantomData;
struct FsmBuilder<TFsm> {
_fsm: PhantomData<TFsm>,
}
impl<TFsm> FsmBuilder<TFsm> {
fn state(&mut self) -> FsmStateBuilder<TFsm> {
todo!()
}
}
struct FsmStateBuilder<TFsm> {
_state: PhantomData<TFsm>,
}
impl<TFsm> FsmStateBuilder<TFsm> {
fn on_entry<TAction: Fn(&mut StateContext<'_, TFsm>)>(&self, _action: TAction) {}
}
trait Fsm {
type Context;
}
struct StateContext<'a, TFsm: Fsm> {
context: &'a mut TFsm::Context
}
fn main() {
let mut builder: FsmBuilder<usize> = todo!();
builder.state().on_entry(|_| {});
} |
Note the error goes away if you add |
fanninpm
added a commit
to fanninpm/glacier
that referenced
this issue
Dec 29, 2020
Issue: rust-lang/rust#80409
Triage: no change |
No longe crashes with master toolchain |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Apr 5, 2023
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 5, 2023
…errors Add regression test for rust-lang#80409 r? `@compiler-errors` Closes rust-lang#80409
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 5, 2023
Rollup of 7 pull requests Successful merges: - rust-lang#109909 (Deny `use`ing tool paths) - rust-lang#109921 (Don't ICE when encountering `dyn*` in statics or consts) - rust-lang#109922 (Disable `has_thread_local` on OpenHarmony) - rust-lang#109926 (write threads info into log only when debugging) - rust-lang#109968 (Add regression test for rust-lang#80409) - rust-lang#109969 (Add regression test for rust-lang#86351) - rust-lang#109973 (rustdoc: Improve logo display very small screen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Crashing again after #118553 |
This is also a compiles -> ice regression |
This never should have passed. Removing regression label; this can remain open to track the ICE. |
no longer produces an ICE as of rust 1.81.0 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-inference
Area: Type inference
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
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.
I haven't been able to minimize this yet. The similar, already resolved, bug report #56199 doesn't seem to help - changing the
on_entry
's return signature fromSelf
to the full definition doesn't help here.Code
Meta
The bug is also present in the nightly build (
bb1fbbf84 2020-12-22
).Error output
Backtrace
The text was updated successfully, but these errors were encountered: