Skip to content

Missing impls for tuples? #16154

Closed
Closed

Description

@cynecx

rust-analyzer version: current master 0ed815fa

rustc version:

rustc 1.76.0-nightly (6a6287132 2023-12-17)
binary: rustc
commit-hash: 6a62871320e262661bb1a0ea7f8aec9d3abeddf2
commit-date: 2023-12-17
host: aarch64-apple-darwin
release: 1.76.0-nightly
LLVM version: 17.0.6
trait Boba {
    type Foo;
}

impl<T: Eq + std::hash::Hash> Boba for T {
    type Foo = String;
}

fn test() {
    let a: <(bool, bool) as Boba>::Foo;
    //  ^ currently: <(isize, isize) as Boba>::Foo. This should've been `String`.
    let a: <isize as Boba>::Foo;
    //  ^ currently: String
}

I could've sworn that this worked before but I might be wrong.

Activity

  1. Veykril commented on Dec 18, 2023

    @Veykril
    Member

    Might've been #15970? Only thing I can think of that looks relevant and that has been merged recently (assuming this used to work)

  2. cynecx commented on Dec 19, 2023

    @cynecx
    ContributorAuthor

    Okay, I might have imagined things because I can reproduce this with a build from early November 🤷‍♂️.

  3. added
    A-tytype system / type inference / traits / method resolution
    on Dec 19, 2023
  4. Veykril commented on Dec 19, 2023

    @Veykril
    Member

    Actually, this isn't a rust-analyzer regression. It's a core library change that trips over r-a rust-lang/rust#117050.

    The impl macro makes use of nightly features (surprise surprise ...), and the behavior of those features has changed, which now breaks tuple impls for r-a because the expansion is wrong.

    This also explains why r-a is giving me errors on our database traits now that I updated my toolchain yesterday

  5. added
    Broken WindowBugs / technical debt to be addressed immediately
    on Dec 19, 2023
  6. added a commit that references this issue on Dec 20, 2023
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

    A-tytype system / type inference / traits / method resolutionBroken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions