Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Sync with rustc_span changes #1736

Merged
merged 2 commits into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ racer = { version = "2.1.46", default-features = false }
rand = "0.7"
rayon = "1"
rustc_tools_util = "0.2"
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", rev = "2a3635d5d1218c726ff58af4bc35418836143f69" }
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", rev = "927561ace1ef9485206a9e6a9482e39fb3e1f31b" }
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions rls-rustc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Callbacks for ShimCalls {
let sess = compiler.session();
let input = compiler.input();

let cwd = &sess.working_dir.0;
let cwd = &sess.working_dir.local_path_if_available();

let src_path = match input {
Input::File(ref name) => Some(name.to_path_buf()),
Expand Down Expand Up @@ -209,14 +209,14 @@ impl Callbacks for ShimCalls {

#[cfg(feature = "ipc")]
fn fetch_input_files(sess: &rustc_session::Session) -> Vec<PathBuf> {
let cwd = &sess.working_dir.0;
let cwd = &sess.working_dir.local_path_if_available();

sess.source_map()
.files()
.iter()
.filter(|fmap| fmap.is_real_file())
.filter(|fmap| !fmap.is_imported())
.map(|fmap| fmap.name.to_string())
.map(|fmap| fmap.name.prefer_local().to_string())
.map(|fmap| src_path(Some(cwd), fmap).unwrap())
.collect()
}
Expand Down
6 changes: 3 additions & 3 deletions rls/src/build/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
let input = compiler.input();
let crate_name = queries.crate_name().unwrap().peek().clone();

let cwd = &sess.working_dir.0;
let cwd = &sess.working_dir.local_path_if_available();

let src_path = match input {
Input::File(ref name) => Some(name.to_path_buf()),
Expand Down Expand Up @@ -327,14 +327,14 @@ fn clippy_config(config: &mut interface::Config) {
}

fn fetch_input_files(sess: &Session) -> Vec<PathBuf> {
let cwd = &sess.working_dir.0;
let cwd = &sess.working_dir.local_path_if_available();

sess.source_map()
.files()
.iter()
.filter(|fmap| fmap.is_real_file())
.filter(|fmap| !fmap.is_imported())
.map(|fmap| fmap.name.to_string())
.map(|fmap| fmap.name.prefer_local().to_string())
.map(|fmap| src_path(Some(cwd), fmap).unwrap())
.collect()
}
Expand Down