Skip to content

Type mismatch when aliasing Fn trait #13957

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

Closed
dbofmmbt opened this issue Jan 15, 2023 · 1 comment
Closed

Type mismatch when aliasing Fn trait #13957

dbofmmbt opened this issue Jan 15, 2023 · 1 comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug

Comments

@dbofmmbt
Copy link
Contributor

dbofmmbt commented Jan 15, 2023

In my codebase, when I alias a Fn trait, although rustc compiles it fine, R-A complains about type mismatch:

expected bool, found <dyn Alias as FnOnce<(bool,)>>::Output

I extracted a short example based on what I implemented:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=75d946a49d2296d3defd525590b366b5

I couldn't find any related issue. It looks like R-A doesn't know that the Output is actually a bool.

rust-analyzer version: 0.3.1361-standalone
rustc: 1.66.1 (90743e729 2023-01-10)

@lnicola lnicola added A-ty type system / type inference / traits / method resolution C-bug Category: bug labels Jan 15, 2023
@lowr
Copy link
Contributor

lowr commented Jan 16, 2023

This is a duplicate of #13169. Chalk has some problems when trait objects interact with supertraits and unfortunately we can only wait for upstream to fix the underlying problem.

@lowr lowr closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants