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

Incorrect type mismatch diagnostic between trait objects with supertrait autotrait bound #18692

Open
Veykril opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
A-chalk chalk related issue A-ty type system / type inference / traits / method resolution C-bug Category: bug

Comments

@Veykril
Copy link
Member

Veykril commented Dec 15, 2024

trait Trait: Send {}

fn f(_: *const (dyn Trait + Send)) {} 
fn g(it: *const (dyn Trait)) {
    f(it);
    // ^^ expected *const (dyn Trait + Send), found *const dyn Trait
}

rustc accepts this code

@Veykril Veykril added A-ty type system / type inference / traits / method resolution C-bug Category: bug labels Dec 15, 2024
@ChayimFriedman2 ChayimFriedman2 self-assigned this Dec 16, 2024
@ChayimFriedman2
Copy link
Contributor

This is a problem in Chalk. It assembles the Unsize candidates, and doesn't consider auto traits from supertraits, which rustc does. Given that the next trait solver also cares about this, I think we should leave that for now unless it's urgent.

@Veykril Veykril added the A-chalk chalk related issue label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chalk chalk related issue A-ty type system / type inference / traits / method resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants