diff --git a/crates/base_db/Cargo.toml b/crates/base_db/Cargo.toml index de88617464..20a4b111e3 100644 --- a/crates/base_db/Cargo.toml +++ b/crates/base_db/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/cfg/Cargo.toml b/crates/cfg/Cargo.toml index 6d4ff45b18..df652c41d8 100644 --- a/crates/cfg/Cargo.toml +++ b/crates/cfg/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml index 2b95ded2ac..929089a9e2 100644 --- a/crates/flycheck/Cargo.toml +++ b/crates/flycheck/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/hir/Cargo.toml b/crates/hir/Cargo.toml index c80605c16c..316167d7e1 100644 --- a/crates/hir/Cargo.toml +++ b/crates/hir/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/hir_def/Cargo.toml b/crates/hir_def/Cargo.toml index bdfad530b0..3261577df0 100644 --- a/crates/hir_def/Cargo.toml +++ b/crates/hir_def/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/hir_expand/Cargo.toml b/crates/hir_expand/Cargo.toml index 520c2208d6..f17e1e857b 100644 --- a/crates/hir_expand/Cargo.toml +++ b/crates/hir_expand/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index fcb2e1d2e9..14ef3e52ce 100644 --- a/crates/hir_ty/Cargo.toml +++ b/crates/hir_ty/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 62043b82ad..aef8e367f2 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide_assists/Cargo.toml b/crates/ide_assists/Cargo.toml index f9f9b3936f..de5dd6cb79 100644 --- a/crates/ide_assists/Cargo.toml +++ b/crates/ide_assists/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide_completion/Cargo.toml b/crates/ide_completion/Cargo.toml index 27abf77938..8ade88fdd1 100644 --- a/crates/ide_completion/Cargo.toml +++ b/crates/ide_completion/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml index 754b6f1a09..d6586185c5 100644 --- a/crates/ide_db/Cargo.toml +++ b/crates/ide_db/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide_diagnostics/Cargo.toml b/crates/ide_diagnostics/Cargo.toml index adb3c2f72f..160293c7da 100644 --- a/crates/ide_diagnostics/Cargo.toml +++ b/crates/ide_diagnostics/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/ide_ssr/Cargo.toml b/crates/ide_ssr/Cargo.toml index ad6e37f50a..efa8fd243a 100644 --- a/crates/ide_ssr/Cargo.toml +++ b/crates/ide_ssr/Cargo.toml @@ -5,6 +5,7 @@ description = "Structural search and replace of Rust code" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-analyzer/rust-analyzer" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/limit/Cargo.toml b/crates/limit/Cargo.toml index 0bee06b0c8..04a3889c82 100644 --- a/crates/limit/Cargo.toml +++ b/crates/limit/Cargo.toml @@ -5,6 +5,7 @@ description = "TBD" license = "MIT OR Apache-2.0" authors = ["rust-analyzer developers"] edition = "2021" +rust-version = "1.56" [features] tracking = [] diff --git a/crates/mbe/Cargo.toml b/crates/mbe/Cargo.toml index 3cb06f3d8a..cff7224e02 100644 --- a/crates/mbe/Cargo.toml +++ b/crates/mbe/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index d74c903686..c31cfaafc7 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml index 446b8a5d68..f9ea5018cc 100644 --- a/crates/paths/Cargo.toml +++ b/crates/paths/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/proc_macro_api/Cargo.toml b/crates/proc_macro_api/Cargo.toml index 75ab9c13a4..42687355c3 100644 --- a/crates/proc_macro_api/Cargo.toml +++ b/crates/proc_macro_api/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/proc_macro_srv/Cargo.toml b/crates/proc_macro_srv/Cargo.toml index fab9cceb70..458bea1aa6 100644 --- a/crates/proc_macro_srv/Cargo.toml +++ b/crates/proc_macro_srv/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/proc_macro_test/Cargo.toml b/crates/proc_macro_test/Cargo.toml index 547a95d6e0..b5f18276ca 100644 --- a/crates/proc_macro_test/Cargo.toml +++ b/crates/proc_macro_test/Cargo.toml @@ -3,6 +3,7 @@ name = "proc_macro_test" version = "0.0.0" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" publish = false [lib] diff --git a/crates/proc_macro_test/imp/Cargo.toml b/crates/proc_macro_test/imp/Cargo.toml index 27ea2d9a8b..760c867817 100644 --- a/crates/proc_macro_test/imp/Cargo.toml +++ b/crates/proc_macro_test/imp/Cargo.toml @@ -3,6 +3,7 @@ name = "proc_macro_test_impl" version = "0.0.0" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" publish = false [lib] diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index 05b1c0b392..1d4f6d9147 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml index 7c930f6896..97c73ca11c 100644 --- a/crates/project_model/Cargo.toml +++ b/crates/project_model/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 5d3aac42e3..4ad91e8da8 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -8,6 +8,7 @@ documentation = "https://rust-analyzer.github.io/manual.html" license = "MIT OR Apache-2.0" autobins = false edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/sourcegen/Cargo.toml b/crates/sourcegen/Cargo.toml index 20954dfb47..34cebb34ec 100644 --- a/crates/sourcegen/Cargo.toml +++ b/crates/sourcegen/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/stdx/Cargo.toml b/crates/stdx/Cargo.toml index e37ecc8241..c456883a70 100644 --- a/crates/stdx/Cargo.toml +++ b/crates/stdx/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 377e8aeab2..080697b96f 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -5,6 +5,7 @@ description = "Comment and whitespace preserving parser for the Rust language" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-analyzer/rust-analyzer" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/syntax/fuzz/Cargo.toml b/crates/syntax/fuzz/Cargo.toml index 37394c5ba8..119a5651b8 100644 --- a/crates/syntax/fuzz/Cargo.toml +++ b/crates/syntax/fuzz/Cargo.toml @@ -4,6 +4,7 @@ name = "syntax-fuzz" version = "0.0.1" publish = false edition = "2021" +rust-version = "1.56" [package.metadata] cargo-fuzz = true diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 199155c0df..d0e4b465fa 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/text_edit/Cargo.toml b/crates/text_edit/Cargo.toml index cce0d85c52..7cbe3412c9 100644 --- a/crates/text_edit/Cargo.toml +++ b/crates/text_edit/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/toolchain/Cargo.toml b/crates/toolchain/Cargo.toml index 76f61519b7..f0dc019fb9 100644 --- a/crates/toolchain/Cargo.toml +++ b/crates/toolchain/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/tt/Cargo.toml b/crates/tt/Cargo.toml index 5b3d8c4ee4..23b56e3309 100644 --- a/crates/tt/Cargo.toml +++ b/crates/tt/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/vfs-notify/Cargo.toml b/crates/vfs-notify/Cargo.toml index 4f24c595eb..7f7a9df375 100644 --- a/crates/vfs-notify/Cargo.toml +++ b/crates/vfs-notify/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/crates/vfs/Cargo.toml b/crates/vfs/Cargo.toml index ca0def4f34..f77e56f13e 100644 --- a/crates/vfs/Cargo.toml +++ b/crates/vfs/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" description = "TBD" license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/lib/arena/Cargo.toml b/lib/arena/Cargo.toml index 3fc690ff26..39b005d094 100644 --- a/lib/arena/Cargo.toml +++ b/lib/arena/Cargo.toml @@ -7,3 +7,4 @@ repository = "https://github.com/rust-analyzer/rust-analyzer" documentation = "https://docs.rs/la-arena" categories = ["data-structures", "memory-management", "rust-patterns"] edition = "2021" +rust-version = "1.56" diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index c743cd884d..a111b9d94f 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,9 +1,10 @@ [package] -edition = "2021" name = "xtask" version = "0.1.0" publish = false license = "MIT OR Apache-2.0" +edition = "2021" +rust-version = "1.56" [dependencies] anyhow = "1.0.26" diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 412132f60e..6bae5123a6 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -7,9 +7,6 @@ use xshell::{cmd, pushd}; use crate::flags; -// Latest stable, feel free to send a PR if this lags behind. -const REQUIRED_RUST_VERSION: u32 = 56; - impl flags::Install { pub(crate) fn run(self) -> Result<()> { if cfg!(target_os = "macos") { @@ -137,19 +134,6 @@ fn install_client(client_opt: ClientOpt) -> 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 { Malloc::System => &[][..], 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 res = 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?; + cmd.run()?; 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 = version_output.split('.').nth(1).and_then(|it| it.parse().ok()); - match minor { - None => true, - Some(minor) => minor >= min_minor_version, - } -}