Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Closed
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
155 changes: 71 additions & 84 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ lsp-types = { version = "0.60", features = ["proposed"] }
lazy_static = "1"
log = "0.4"
num_cpus = "1"
racer = { version = "2.1.47", default-features = false }
racer = { version = "2.1.48", default-features = false }
rand = "0.7"
rayon = "1"
rustc_tools_util = "0.2"
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", rev = "28460e1e9aff317fa1bbca95b22421e7ccd7723d" }
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", rev = "a5f85058ac2e3f330bd48dd8de26bf429fc28c30" }
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
Expand Down
5 changes: 2 additions & 3 deletions rls-ipc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ pub mod callbacks {
/// Build system-agnostic, basic compilation unit
#[derive(PartialEq, Eq, Hash, Debug, Clone, Deserialize, Serialize)]
pub struct Crate {
/// A crate identifier calculated by rustc that's stable between compilation sessions.
pub stable_crate_id: u64,
/// Crate name
pub name: String,
/// Optional path to a crate root
pub src_path: Option<PathBuf>,
/// Edition in which a given crate is compiled
pub edition: Edition,
/// From rustc; mainly used to group other properties used to disambiguate a
/// given compilation unit.
pub disambiguator: (u64, u64),
}

/// Rust edition
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.local_path_if_available();
let cwd = &sess.opts.working_dir.local_path_if_available();

let src_path = match input {
Input::File(ref name) => Some(name.to_path_buf()),
Expand All @@ -132,7 +132,7 @@ impl Callbacks for ShimCalls {
let krate = Crate {
name: queries.crate_name().unwrap().peek().to_owned(),
src_path,
disambiguator: sess.local_crate_disambiguator().to_fingerprint().as_value(),
stable_crate_id: sess.local_stable_crate_id().to_u64(),
edition: match sess.edition() {
rustc_span::edition::Edition::Edition2015 => Edition::Edition2015,
rustc_span::edition::Edition::Edition2018 => Edition::Edition2018,
Expand Down Expand Up @@ -209,7 +209,7 @@ impl Callbacks for ShimCalls {

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

sess.source_map()
.files()
Expand Down
2 changes: 1 addition & 1 deletion rls/src/build/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ mod callbacks {
rls_ipc::rpc::Edition::Edition2018 => crate::build::plan::Edition::Edition2018,
rls_ipc::rpc::Edition::Edition2021 => crate::build::plan::Edition::Edition2021,
},
disambiguator: krate.disambiguator,
stable_crate_id: krate.stable_crate_id,
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions rls/src/build/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,11 @@ impl JobQueue {
/// Build system-agnostic, basic compilation unit
#[derive(PartialEq, Eq, Hash, Debug, Clone, Deserialize, Serialize)]
pub struct Crate {
/// A crate identifier calculated by rustc that's stable between compilation sessions.
pub stable_crate_id: u64,
pub name: String,
pub src_path: Option<PathBuf>,
pub edition: Edition,
/// From rustc; mainly used to group other properties used to disambiguate a
/// given compilation unit.
pub disambiguator: (u64, u64),
}

// Temporary, until Edition from rustfmt is available
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.local_path_if_available();
let cwd = &sess.opts.working_dir.local_path_if_available();

let src_path = match input {
Input::File(ref name) => Some(name.to_path_buf()),
Expand All @@ -250,7 +250,7 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
let krate = Crate {
name: crate_name,
src_path,
disambiguator: sess.local_crate_disambiguator().to_fingerprint().as_value(),
stable_crate_id: sess.local_stable_crate_id().to_u64(),
edition: match sess.edition() {
RustcEdition::Edition2015 => Edition::Edition2015,
RustcEdition::Edition2018 => Edition::Edition2018,
Expand Down Expand Up @@ -327,7 +327,7 @@ fn clippy_config(config: &mut interface::Config) {
}

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

sess.source_map()
.files()
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2021-05-19"
channel = "nightly-2021-10-20"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]