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 with dyn Trait #14005

Closed
allan2 opened this issue Jan 23, 2023 · 1 comment
Closed

Type mismatch with dyn Trait #14005

allan2 opened this issue Jan 23, 2023 · 1 comment

Comments

@allan2
Copy link

allan2 commented Jan 23, 2023

rust-analyzer version: 0.3.1369-standalone
rustc version: tried both 1.66.0-nightly and 1.64.0 stable

lib.rs

pub fn type_mismatch_ex() {
    let mut params = Vec::<&(dyn Sync)>::with_capacity(2);
    let nums = vec![1, 2];
    for n in &nums {
        params.push(n);
    }
}

screenshot

I got this error in rust-analyzer but the code compiles.

Maybe related to PR #13112?

@lowr
Copy link
Contributor

lowr commented Jan 23, 2023

Duplicate of #11847.

@lowr lowr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
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