Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Wrong search paths for the standard lib #189

Closed
AnyCPU opened this issue Nov 14, 2017 · 1 comment
Closed

Wrong search paths for the standard lib #189

AnyCPU opened this issue Nov 14, 2017 · 1 comment

Comments

@AnyCPU
Copy link

AnyCPU commented Nov 14, 2017

Windows 10 Pro 64 bit, Rust rls 0.3.2, rustc 1.23.0-nightly (e21df8020 2017-11-13)

I get a lot of errors like that

Unable to open 'cmp.rs': File not found (file:///c:/Program Files/Microsoft VS Code/src/libcore/cmp.rs

when I press the F12.

I think something is wrong and either stable or nightly installation paths should be used.

Example code:

extern crate rand;

use std::io;
use std::cmp::Ordering;
use rand::Rng;

fn hello(){ println!("{}", "Hello!")}

fn main () {
    println!("Guess the number!");
    let secret_number = rand::thread_rng().gen_range(1, 100);
    println!("Please input your guess.");
    let mut guess = String::new();
    io::stdin().read_line(&mut guess).expect("Failed to read line");
    println!("You guessed: {}", guess);
    let num : u32 = guess.trim().parse().expect("Please type a number!");
    match num.cmp(&secret_number) {
        Ordering::Less => println!{"Too small!"},
        Ordering::Greater => println!("Too big!"),
        Ordering::Equal => println!("You win!")
    }
    hello();
}
@nrc
Copy link
Member

nrc commented Nov 14, 2017

This is a known issue and is tracked on the RLS issue, there is even a PR under review to fix it, so hopefully it will be addressed soon.

@nrc nrc closed this as completed Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants