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

Commit 288260a

Browse files
committed
Auto merge of #1709 - m-ou-se:2021, r=Xanewok
Add edition 2021. See rust-lang/rust#80576. This un-breaks the build of RLS after rust-lang/rust#79576 broke it.
2 parents 2cf84ba + 956c2e2 commit 288260a

File tree

8 files changed

+55
-47
lines changed

8 files changed

+55
-47
lines changed

Cargo.lock

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ lsp-types = { version = "0.60", features = ["proposed"] }
4242
lazy_static = "1"
4343
log = "0.4"
4444
num_cpus = "1"
45-
racer = { version = "2.1.41", default-features = false }
45+
racer = { version = "2.1.42", default-features = false }
4646
rand = "0.7"
4747
rayon = "1"
4848
rustc_tools_util = "0.2"
49-
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.29" }
49+
rustfmt-nightly = { git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.31" }
5050
serde = "1.0"
5151
serde_json = "1.0"
5252
serde_derive = "1.0"

rls-ipc/src/rpc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ pub enum Edition {
7373
Edition2015,
7474
/// Rust 2018
7575
Edition2018,
76+
/// Rust 2021
77+
Edition2021,
7678
}

rls-rustc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ impl Callbacks for ShimCalls {
140140
edition: match sess.edition() {
141141
rustc_span::edition::Edition::Edition2015 => Edition::Edition2015,
142142
rustc_span::edition::Edition::Edition2018 => Edition::Edition2018,
143+
rustc_span::edition::Edition::Edition2021 => Edition::Edition2021,
143144
},
144145
};
145146

rls/src/actions/requests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ fn reformat(
696696
let edition = match edition {
697697
Edition::Edition2015 => RustfmtEdition::Edition2015,
698698
Edition::Edition2018 => RustfmtEdition::Edition2018,
699+
Edition::Edition2021 => RustfmtEdition::Edition2021,
699700
};
700701
config.set().edition(edition);
701702
trace!("Detected edition {:?} for file `{}`", edition, path.display());

rls/src/build/ipc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ mod callbacks {
106106
edition: match krate.edition {
107107
rls_ipc::rpc::Edition::Edition2015 => crate::build::plan::Edition::Edition2015,
108108
rls_ipc::rpc::Edition::Edition2018 => crate::build::plan::Edition::Edition2018,
109+
rls_ipc::rpc::Edition::Edition2021 => crate::build::plan::Edition::Edition2021,
109110
},
110111
disambiguator: krate.disambiguator,
111112
}

rls/src/build/plan.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ pub struct Crate {
236236
pub enum Edition {
237237
Edition2015,
238238
Edition2018,
239+
Edition2021,
239240
}
240241

241242
impl Default for Edition {
@@ -251,6 +252,7 @@ impl std::convert::TryFrom<&str> for Edition {
251252
Ok(match val {
252253
"2015" => Edition::Edition2015,
253254
"2018" => Edition::Edition2018,
255+
"2021" => Edition::Edition2021,
254256
_ => return Err("unknown"),
255257
})
256258
}

rls/src/build/rustc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ impl rustc_driver::Callbacks for RlsRustcCalls {
254254
edition: match sess.edition() {
255255
RustcEdition::Edition2015 => Edition::Edition2015,
256256
RustcEdition::Edition2018 => Edition::Edition2018,
257+
RustcEdition::Edition2021 => Edition::Edition2021,
257258
},
258259
};
259260

0 commit comments

Comments
 (0)