mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge #10617
10617: Set MSRV r=Veykril a=lnicola Set the MSRV to `1.56` since we're already on the 2021 edition and building with older version fails. From now on, there'll be a change in behavior: `xtask install` used to warn on old toolchains, but now the user will get an error. This isn't so bad because: - the check in `xtask install` wasn't always working (because sometimes `xtask` itself required a newer toolchain) - we generally bump the required version for a reason (when using a newer feature). We might forget to bump it, but when we do, older toolchains won't work Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
9d33d05d85
37 changed files with 38 additions and 37 deletions
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -5,6 +5,7 @@ description = "Structural search and replace of Rust code"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -5,6 +5,7 @@ description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
authors = ["rust-analyzer developers"]
|
authors = ["rust-analyzer developers"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
tracking = []
|
tracking = []
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -3,6 +3,7 @@ name = "proc_macro_test"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|
|
@ -3,6 +3,7 @@ name = "proc_macro_test_impl"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -8,6 +8,7 @@ documentation = "https://rust-analyzer.github.io/manual.html"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
autobins = false
|
autobins = false
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -5,6 +5,7 @@ description = "Comment and whitespace preserving parser for the Rust language"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ name = "syntax-fuzz"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
publish = false
|
publish = false
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
cargo-fuzz = true
|
cargo-fuzz = true
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -4,6 +4,7 @@ version = "0.0.0"
|
||||||
description = "TBD"
|
description = "TBD"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
|
@ -7,3 +7,4 @@ repository = "https://github.com/rust-analyzer/rust-analyzer"
|
||||||
documentation = "https://docs.rs/la-arena"
|
documentation = "https://docs.rs/la-arena"
|
||||||
categories = ["data-structures", "memory-management", "rust-patterns"]
|
categories = ["data-structures", "memory-management", "rust-patterns"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
[package]
|
[package]
|
||||||
edition = "2021"
|
|
||||||
name = "xtask"
|
name = "xtask"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
publish = false
|
publish = false
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.26"
|
anyhow = "1.0.26"
|
||||||
|
|
|
@ -7,9 +7,6 @@ use xshell::{cmd, pushd};
|
||||||
|
|
||||||
use crate::flags;
|
use crate::flags;
|
||||||
|
|
||||||
// Latest stable, feel free to send a PR if this lags behind.
|
|
||||||
const REQUIRED_RUST_VERSION: u32 = 56;
|
|
||||||
|
|
||||||
impl flags::Install {
|
impl flags::Install {
|
||||||
pub(crate) fn run(self) -> Result<()> {
|
pub(crate) fn run(self) -> Result<()> {
|
||||||
if cfg!(target_os = "macos") {
|
if cfg!(target_os = "macos") {
|
||||||
|
@ -137,19 +134,6 @@ fn install_client(client_opt: ClientOpt) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_server(opts: ServerOpt) -> Result<()> {
|
fn install_server(opts: ServerOpt) -> Result<()> {
|
||||||
let mut old_rust = false;
|
|
||||||
if let Ok(stdout) = cmd!("cargo --version").read() {
|
|
||||||
if !check_version(&stdout, REQUIRED_RUST_VERSION) {
|
|
||||||
old_rust = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if old_rust {
|
|
||||||
eprintln!(
|
|
||||||
"\nWARNING: at least rust 1.{}.0 is required to compile rust-analyzer\n",
|
|
||||||
REQUIRED_RUST_VERSION,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
let features = match opts.malloc {
|
let features = match opts.malloc {
|
||||||
Malloc::System => &[][..],
|
Malloc::System => &[][..],
|
||||||
Malloc::Mimalloc => &["--features", "mimalloc"],
|
Malloc::Mimalloc => &["--features", "mimalloc"],
|
||||||
|
@ -157,25 +141,6 @@ fn install_server(opts: ServerOpt) -> Result<()> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let cmd = cmd!("cargo install --path crates/rust-analyzer --locked --force --features force-always-assert {features...}");
|
let cmd = cmd!("cargo install --path crates/rust-analyzer --locked --force --features force-always-assert {features...}");
|
||||||
let res = cmd.run();
|
cmd.run()?;
|
||||||
|
|
||||||
if res.is_err() && old_rust {
|
|
||||||
eprintln!(
|
|
||||||
"\nWARNING: at least rust 1.{}.0 is required to compile rust-analyzer\n",
|
|
||||||
REQUIRED_RUST_VERSION,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
res?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_version(version_output: &str, min_minor_version: u32) -> bool {
|
|
||||||
// Parse second the number out of
|
|
||||||
// cargo 1.39.0-beta (1c6ec66d5 2019-09-30)
|
|
||||||
let minor: Option<u32> = version_output.split('.').nth(1).and_then(|it| it.parse().ok());
|
|
||||||
match minor {
|
|
||||||
None => true,
|
|
||||||
Some(minor) => minor >= min_minor_version,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue