Skip to content

Crash on tuple of tuples access #4410

Closed
@kov

Description

@kov

Describe the bug

rustfmt crashes:

thread 'main' panicked at 'bad span: .: ``', src/tools/rustfmt/src/source_map.rs:52:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

It seems to be caused by having the tuple of tuples access chained. Removing the final .0 and .1 makes it disappear.

To Reproduce

impl Drop for LockGuard {
    fn drop(&mut self) {
        LockMap::unlock(&self.0.0, &self.0.1);
    }
}

Meta

  • rustfmt version: rustfmt 1.4.20-nightly (48f6c32 2020-08-09)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: cargo fmt, but it reproduces when running manually too

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions