Skip to content

Crash on tuple of tuples access #4410

@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

Activity

added
bugPanic, non-idempotency, invalid code, etc.
on Sep 2, 2020
changed the title [-]Crash on [/-] [+]Crash on tuple of tuples access[/+] on Sep 2, 2020
kov

kov commented on Sep 2, 2020

@kov
Author

Duplicate of #4355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @kov@calebcartwright

        Issue actions

          Crash on tuple of tuples access · Issue #4410 · rust-lang/rustfmt