Skip to content

Infinite loop when inlining #78573

Closed
@tmiasko

Description

@tmiasko
fn main() {
    f();
}

#[inline]
fn a<T: FnOnce()>(t: T) {
    t();
}

#[inline]
fn f() {
    a(f);
}
$ rustc -Zmir-opt-level=2 a.rs
...

It was already possible before, but #68965 made it much easier to trigger.

@rustbot modify labels: +A-mir-opt, +A-mir-opt-inlining

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningC-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions