Skip to content

Latest release breaks on .collect() invocation #10868

Closed
@NinnOgTonic

Description

@NinnOgTonic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions