Skip to content

rustfmt hangs #5626

@matthiaskrgr

Description

@matthiaskrgr
// run-pass

pub fn main() { return isize(); }

pub mod foo {
    pub fn f() -> isize { return 2; }
    pub fn g() {
||||||||||||||H||||isize||||||||||||||(|| ||||isize||||||||||||||||isize||||||||||||||||||||||||||        isize!(f(), 2))();
        isize!(::f(), 1);
    }
}

pub fn main() { return ||||||||||||||H||||isize||||||||||||||(|| ||||H||||||||||||||||isize||||||||||||||||||||||||||        isize!(f(), 2))(); }

While rustc throws errors after 0.2 seconds, rustfmt (cargo fmt) seems to crunch this indefinitely (I gave up after 15 minutes) with no output whatsoever.

A lot of processing by
<rustfmt_nightly::comment::UngroupedCommentCodeSlices as core::iter::traits::iterator::Iterator>::next and <rustfmt_nightly::comment::CharClasses<core::str::iter::CharIndices> as core::iter::traits::iterator::Iterator>::next

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: closuresC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEP-lowLow priority

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions