Skip to content
New issue

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

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

Already on GitHub? # to your account

Missing impls for tuples? #16154

Closed
cynecx opened this issue Dec 18, 2023 · 3 comments · Fixed by #16165
Closed

Missing impls for tuples? #16154

cynecx opened this issue Dec 18, 2023 · 3 comments · Fixed by #16165
Labels
A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@cynecx
Copy link
Contributor

cynecx commented Dec 18, 2023

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.

@cynecx cynecx added the C-bug Category: bug label Dec 18, 2023
@Veykril
Copy link
Member

Veykril commented Dec 18, 2023

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

@cynecx
Copy link
Contributor Author

cynecx commented Dec 19, 2023

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

@Veykril Veykril added the A-ty type system / type inference / traits / method resolution label Dec 19, 2023
@Veykril
Copy link
Member

Veykril commented Dec 19, 2023

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

@Veykril Veykril added the Broken Window Bugs / technical debt to be addressed immediately label Dec 19, 2023
@bors bors closed this as completed in 7bdf48c Dec 20, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants