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

Latest release breaks on .collect() invocation #10868

Closed
NinnOgTonic opened this issue Nov 26, 2021 · 3 comments
Closed

Latest release breaks on .collect() invocation #10868

NinnOgTonic opened this issue Nov 26, 2021 · 3 comments
Labels
S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@NinnOgTonic
Copy link

I've created the following reproduction and confirmed that this seems to break when i run rust-analyzer version: 183ef048f 2021-11-22 stable.

Meanwhile it does seems to work on rust-analyzer version: 73668334f 2021-11-15 stable.

  1. Create new crate: cargo new hello_world --bin
  2. Fill main.rs with:
use std::{
    collections::HashMap,
    ffi::OsStr,
    fs::{self, DirEntry, File},
    io::{self, Read},
    path::PathBuf,
    sync::mpsc::channel,
    time::Duration,
};

#[derive(Debug, Clone)]
struct BootInfo {
    pub id: String,
    pub idx: u32,
    pub start_time: String,
    pub end_time: String,
}

fn find_boots() -> io::Result<HashMap<String, BootInfo>> {
    let mut res: HashMap<String, BootInfo> = HashMap::new();
    Ok(res)
}
fn gg() -> io::Result<()> {
    let boots = find_boots()?;

    
    let foo = boots.values().cloned().collect::<Vec<BootInfo>>();
    println!("{:?}", foo);
    Ok(())
}
fn main() {
    gg().unwrap();
}
  1. Inline typehits and hover types missing after .collect::<Vec<BootInfo>>(); in line 24:

Screenshot 2021-11-26 at 14 17 05

@jhgg
Copy link
Contributor

jhgg commented Nov 27, 2021

What version of rustc are you using?

@jhgg
Copy link
Contributor

jhgg commented Nov 27, 2021

This is most definitely #10851 - I cannot reproduce on rustc 1.52.0, but can on 1.51.0.

Please upgrade to a rustc stable version >= 1.52.0 and your issue should be resolved!

@vallentin
Copy link

If that's the case, then this solves the issue, as we're currently upgrading from Rust 1.49 to Rust 1.54.

@lnicola lnicola added the S-unactionable Issue requires feedback, design decisions or is blocked on other work label Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

5 participants