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

Type mismatch false positive (dyn) #11824

Closed
danielhuang opened this issue Mar 25, 2022 · 2 comments
Closed

Type mismatch false positive (dyn) #11824

danielhuang opened this issue Mar 25, 2022 · 2 comments

Comments

@danielhuang
Copy link

danielhuang commented Mar 25, 2022

With the following code:

fn test(x: Box<dyn Display>) {}

fn example() {
    test(Box::new(5))
}

rust-analyzer complains expected Box<dyn Display, Global>, found Box<i32, Global>, even though this code is valid.

rust-analyzer version: 2022-03-25 dev

rustc version: not applicable

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)

Experimental diagnostics enabled

@danielhuang
Copy link
Author

This is a duplicate. Sorry, closing this issue.

@rkuhn
Copy link

rkuhn commented Mar 26, 2022

for completeness: #11818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants