diff --git a/crates/base_db/Cargo.toml b/crates/base_db/Cargo.toml index de88617464b..20a4b111e3c 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 6d4ff45b18f..df652c41d8a 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 2b95ded2ac1..929089a9e23 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 c80605c16c7..316167d7e1b 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 bdfad530b03..3261577df05 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 520c2208d64..f17e1e857ba 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 fcb2e1d2e91..14ef3e52ce9 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 62043b82ad1..aef8e367f20 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 f9f9b3936fd..de5dd6cb79f 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 27abf779380..8ade88fdd16 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 754b6f1a094..d6586185c54 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 adb3c2f72fc..160293c7dae 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 ad6e37f50a8..efa8fd243a3 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 0bee06b0c81..04a3889c82b 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 3cb06f3d8a2..cff7224e020 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 d74c9036862..c31cfaafc7e 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 446b8a5d681..f9ea5018ccc 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 75ab9c13a45..42687355c31 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 fab9cceb705..458bea1aa61 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 547a95d6e03..b5f18276ca1 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 27ea2d9a8b2..760c8678171 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 05b1c0b392b..1d4f6d9147b 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 7c930f6896a..97c73ca11c3 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 5d3aac42e39..4ad91e8da89 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 20954dfb47a..34cebb34ec2 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 e37ecc82419..c456883a701 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 377e8aeab25..080697b96ff 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 37394c5ba86..119a5651b86 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 199155c0dff..d0e4b465fa9 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 cce0d85c521..7cbe3412c99 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 76f61519b74..f0dc019fb98 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 5b3d8c4ee43..23b56e3309a 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 4f24c595eb5..7f7a9df375f 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 ca0def4f346..f77e56f13ed 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 3fc690ff26f..39b005d0945 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 c743cd884d7..a111b9d94f5 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 412132f60ed..6bae5123a60 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, - } -}