Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on tuple of tuples access #4410

Closed
kov opened this issue Sep 2, 2020 · 1 comment
Closed

Crash on tuple of tuples access #4410

kov opened this issue Sep 2, 2020 · 1 comment
Labels
bug Panic, non-idempotency, invalid code, etc. duplicate

Comments

@kov
Copy link

kov commented Sep 2, 2020

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
@kov kov added the bug Panic, non-idempotency, invalid code, etc. label Sep 2, 2020
@kov kov changed the title Crash on Crash on tuple of tuples access Sep 2, 2020
@kov
Copy link
Author

kov commented Sep 2, 2020

Duplicate of #4355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. duplicate
Projects
None yet
Development

No branches or pull requests

2 participants