I tried to let rust-analyzer run on my M2 Mac VS Code.
I tried to manually install rust analyzer using cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target aarch64-apple-darwin --release, and the rust-analyzer binary in ./target/aarch64-apple-darwin/release/rust-analyzer, but my rust analyzer cannot build. Here's the output of the Rust Analyzer Language Server:
[ERROR rust_analyzer::lsp_utils] failed to run build scripts
warning: the feature `let_else` has been stable since 1.65.0 and no longer requires an attribute to enable
--> vir/src/lib.rs:29:12
|
29 | #![feature(let_else)]
| ^^^^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: 1 warning emitted
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:240:3
|
240 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:241:20
|
241 | pub struct Ghost<#[verifier(strictly_positive)] A> {
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:245:3
|
245 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:246:22
|
246 | pub struct Tracked<#[verifier(strictly_positive)] A> {
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:257:7
|
257 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:263:7
|
263 | #[verifier(external)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:271:7
|
271 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:278:7
|
278 | #[verifier(external)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:291:7
|
291 | #[verifier(external)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:298:7
|
298 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:299:7
|
299 | #[verifier(returns(proof))]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:306:7
|
306 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:307:7
|
307 | #[verifier(returns(proof))]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:314:7
|
314 | #[verifier(external_body)]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:315:7
|
315 | #[verifier(returns(proof))]
| ^^^^^^^^
error: cannot find attribute `verifier` in this scope
--> builtin/src/lib.rs:322:7
|
322 | #[verifier(external_body)]
| ^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:1:1
|
1 | #![feature(rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:2:1
|
2 | #![feature(negative_impls)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:4:1
|
4 | #![feature(unboxed_closures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:5:1
|
5 | #![feature(fn_traits)]
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:6:1
|
6 | #![feature(register_tool)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> builtin/src/lib.rs:5:12
|
5 | #![feature(fn_traits)]
| ^^^^^^^^^
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
--> builtin/src/lib.rs:964:20
|
964 | impl<Args, Output> FnOnce<Args> for FnSpec<Args, Output> {
| ^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `FnOnce`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:242:24
|
242 | pub trait FnOnce<Args: Tuple> {
| ^^^^^ required by this bound in `FnOnce`
help: consider restricting type parameter `Args`
|
964 | impl<Args: core::marker::Tuple, Output> FnOnce<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0059]: type parameter to bare `FnMut` trait must be a tuple
--> builtin/src/lib.rs:971:20
|
971 | impl<Args, Output> FnMut<Args> for FnSpec<Args, Output> {
| ^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `FnMut`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:163:23
|
163 | pub trait FnMut<Args: Tuple>: FnOnce<Args> {
| ^^^^^ required by this bound in `FnMut`
help: consider restricting type parameter `Args`
|
971 | impl<Args: core::marker::Tuple, Output> FnMut<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0059]: type parameter to bare `Fn` trait must be a tuple
--> builtin/src/lib.rs:977:20
|
977 | impl<Args, Output> Fn<Args> for FnSpec<Args, Output> {
| ^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `Fn`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:76:20
|
76 | pub trait Fn<Args: Tuple>: FnMut<Args> {
| ^^^^^ required by this bound in `Fn`
help: consider restricting type parameter `Args`
|
977 | impl<Args: core::marker::Tuple, Output> Fn<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
--> builtin/src/lib.rs:984:36
|
984 | pub fn closure_to_fn_spec<Args, F: FnOnce<Args>>(_f: F) -> FnSpec<Args, F::Output> {
| ^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `FnOnce`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:242:24
|
242 | pub trait FnOnce<Args: Tuple> {
| ^^^^^ required by this bound in `FnOnce`
help: consider restricting type parameter `Args`
|
984 | pub fn closure_to_fn_spec<Args: core::marker::Tuple, F: FnOnce<Args>>(_f: F) -> FnSpec<Args, F::Output> {
| +++++++++++++++++++++
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
--> builtin/src/lib.rs:994:15
|
994 | impl<Args, F: FnOnce<Args>> FnWithSpecification<Args> for F {
| ^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `FnOnce`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:242:24
|
242 | pub trait FnOnce<Args: Tuple> {
| ^^^^^ required by this bound in `FnOnce`
help: consider restricting type parameter `Args`
|
994 | impl<Args: core::marker::Tuple, F: FnOnce<Args>> FnWithSpecification<Args> for F {
| +++++++++++++++++++++
error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument
--> builtin/src/lib.rs:966:5
|
966 | extern "rust-call" fn call_once(self, _: Args) -> <Self as FnOnce<Args>>::Output {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
help: consider restricting type parameter `Args`
|
964 | impl<Args: core::marker::Tuple, Output> FnOnce<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument
--> builtin/src/lib.rs:972:5
|
972 | extern "rust-call" fn call_mut(&mut self, _: Args) -> <Self as FnOnce<Args>>::Output {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
help: consider restricting type parameter `Args`
|
971 | impl<Args: core::marker::Tuple, Output> FnMut<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument
--> builtin/src/lib.rs:978:5
|
978 | extern "rust-call" fn call(&self, _: Args) -> <Self as FnOnce<Args>>::Output {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
help: consider restricting type parameter `Args`
|
977 | impl<Args: core::marker::Tuple, Output> Fn<Args> for FnSpec<Args, Output> {
| +++++++++++++++++++++
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
--> builtin/src/lib.rs:995:19
|
995 | type Output = F::Output;
| ^^^^^^^^^ the trait `Tuple` is not implemented for `Args`
|
note: required by a bound in `FnOnce`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:242:24
|
242 | pub trait FnOnce<Args: Tuple> {
| ^^^^^ required by this bound in `FnOnce`
help: consider restricting type parameter `Args`
|
994 | impl<Args: core::marker::Tuple, F: FnOnce<Args>> FnWithSpecification<Args> for F {
| +++++++++++++++++++++
error: aborting due to 31 previous errors
Some errors have detailed explanations: E0059, E0277, E0554.
For more information about an error, try `rustc --explain E0059`.
error: could not compile `builtin` due to 32 previous errors
error[E0463]: can't find crate for `rustc_typeck`
--> rust_verify/src/lib.rs:22:1
|
22 | extern crate rustc_typeck;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`
error[E0432]: unresolved import `rustc_ast::MacArgs`
--> rust_verify/src/attributes.rs:4:38
|
4 | use rustc_ast::{AttrKind, Attribute, MacArgs};
| ^^^^^^^ no `MacArgs` in the root
error[E0432]: unresolved import `rustc_ast::ast::Lit`
--> rust_verify/src/erase.rs:60:69
|
60 | GenericParam, GenericParamKind, Generics, Impl, Item, ItemKind, Lit, LitIntType, LitKind,
| ^^^ no `Lit` in `ast`
|
= help: consider importing one of these items instead:
crate::erase::ExprKind::Lit
crate::erase::PatKind::Lit
rustc_ast::ExprKind::Lit
rustc_ast::ExprPrecedence::Lit
rustc_ast::NestedMetaItem::Lit
rustc_ast::PatKind::Lit
rustc_ast::token::Lit
rustc_hir::ExprKind::Lit
rustc_hir::Lit
rustc_hir::PatKind::Lit
error[E0432]: unresolved import `rustc_data_structures::thin_vec`
--> rust_verify/src/erase.rs:65:28
|
65 | use rustc_data_structures::thin_vec::ThinVec;
| ^^^^^^^^ could not find `thin_vec` in `rustc_data_structures`
error[E0432]: unresolved imports `rustc_hir::Visibility`, `rustc_hir::VisibilityKind`
--> rust_verify/src/rust_to_vir_base.rs:8:65
|
8 | GenericParam, GenericParamKind, Generics, HirId, QPath, Ty, Visibility, VisibilityKind,
| ^^^^^^^^^^ ^^^^^^^^^^^^^^ no `VisibilityKind` in the root
| |
| no `Visibility` in the root
|
= help: consider importing one of these items instead:
rustc_ast::Visibility
rustc_middle::mir::mono::Visibility
rustc_middle::ty::Visibility
vir::ast::Visibility
= help: consider importing this enum instead:
rustc_ast::VisibilityKind
error[E0432]: unresolved import `rustc_middle::ty::ProjectionTy`
--> rust_verify/src/rust_to_vir_base.rs:13:5
|
13 | use rustc_middle::ty::ProjectionTy;
| ^^^^^^^^^^^^^^^^^^------------
| | |
| | help: a similar name exists in the module: `Projection`
| no `ProjectionTy` in `ty`
error[E0432]: unresolved import `rustc_middle::ty::FormalVerifierTyping`
--> rust_verify/src/typecheck.rs:5:24
|
5 | use rustc_middle::ty::{FormalVerifierTyping, Ty, TyCtxt, TyKind};
| ^^^^^^^^^^^^^^^^^^^^ no `FormalVerifierTyping` in `ty`
error[E0432]: unresolved import `rustc_span::MultiSpan`
--> rust_verify/src/verifier.rs:17:37
|
17 | use rustc_span::{CharPos, FileName, MultiSpan, Span};
| ^^^^^^^^^ no `MultiSpan` in the root
|
= help: consider importing this struct instead:
rustc_errors::MultiSpan
error[E0433]: failed to resolve: could not find `DiagnosticOutput` in `rustc_session`
--> rust_verify/src/driver.rs:101:55
|
101 | config.diagnostic_output = rustc_session::DiagnosticOutput::Raw(Box::new(
| ^^^^^^^^^^^^^^^^ could not find `DiagnosticOutput` in `rustc_session`
error[E0433]: failed to resolve: could not find `DiagnosticOutput` in `rustc_session`
--> rust_verify/src/erase.rs:1488:32
|
1488 | rustc_session::DiagnosticOutput::Raw(Box::new(DiagnosticOutputBuffer {
| ^^^^^^^^^^^^^^^^ could not find `DiagnosticOutput` in `rustc_session`
error[E0433]: failed to resolve: could not find `DiagnosticOutput` in `rustc_session`
--> rust_verify/src/lifetime.rs:225:28
|
225 | rustc_session::DiagnosticOutput::Raw(Box::new(DiagnosticOutputBuffer {
| ^^^^^^^^^^^^^^^^ could not find `DiagnosticOutput` in `rustc_session`
error[E0433]: failed to resolve: could not find `NestedVisitorMap` in `intravisit`
--> rust_verify/src/rust_to_vir.rs:503:32
|
503 | rustc_hir::intravisit::NestedVisitorMap::All(self.tcx.hir())
| ^^^^^^^^^^^^^^^^ could not find `NestedVisitorMap` in `intravisit`
error[E0433]: failed to resolve: could not find `NestedVisitorMap` in `intravisit`
--> rust_verify/src/typecheck.rs:33:32
|
33 | rustc_hir::intravisit::NestedVisitorMap::None
| ^^^^^^^^^^^^^^^^ could not find `NestedVisitorMap` in `intravisit`
error[E0433]: failed to resolve: could not find `DiagnosticOutput` in `rustc_session`
--> rust_verify/src/verifier.rs:1556:32
|
1556 | rustc_session::DiagnosticOutput::Raw(Box::new(DiagnosticOutputBuffer {
| ^^^^^^^^^^^^^^^^ could not find `DiagnosticOutput` in `rustc_session`
error[E0412]: cannot find type `ErrorReported` in crate `rustc_errors`
--> rust_verify/src/driver.rs:23:31
|
23 | ) -> Result<(), rustc_errors::ErrorReported> {
| ^^^^^^^^^^^^^ not found in `rustc_errors`
error[E0412]: cannot find type `ErrorReported` in crate `rustc_errors`
--> rust_verify/src/driver.rs:133:31
|
133 | ) -> Result<(), rustc_errors::ErrorReported> {
| ^^^^^^^^^^^^^ not found in `rustc_errors`
error[E0405]: cannot find trait `FormalVerifierRewrite` in crate `rustc_lint`
--> rust_verify/src/erase.rs:1458:18
|
1458 | impl rustc_lint::FormalVerifierRewrite for CompilerCallbacksEraseAst {
| ^^^^^^^^^^^^^^^^^^^^^ not found in `rustc_lint`
error[E0412]: cannot find type `NestedVisitorMap` in module `rustc_hir::intravisit`
--> rust_verify/src/rust_to_vir.rs:502:62
|
502 | fn nested_visit_map(&mut self) -> rustc_hir::intravisit::NestedVisitorMap<Self::Map> {
| ^^^^^^^^^^^^^^^^ not found in `rustc_hir::intravisit`
error[E0412]: cannot find type `TyS` in module `rustc_middle::ty`
--> rust_verify/src/rust_to_vir_base.rs:525:33
|
525 | ty: &'tcx rustc_middle::ty::TyS<'tcx>,
| ^^^ help: a struct with a similar name exists: `Ty`
--> /Users/byc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/compiler/rustc_middle/src/ty/mod.rs:454:1
|
= note: similarly named struct `Ty` defined here
error[E0412]: cannot find type `ErasedMap` in module `rustc_hir::intravisit`
--> rust_verify/src/typecheck.rs:30:39
|
30 | type Map = rustc_hir::intravisit::ErasedMap<'tcx>;
| ^^^^^^^^^ not found in `rustc_hir::intravisit`
error[E0412]: cannot find type `NestedVisitorMap` in module `rustc_hir::intravisit`
--> rust_verify/src/typecheck.rs:32:62
|
32 | fn nested_visit_map(&mut self) -> rustc_hir::intravisit::NestedVisitorMap<Self::Map> {
| ^^^^^^^^^^^^^^^^ not found in `rustc_hir::intravisit`
error[E0422]: cannot find struct, variant or union type `ErrorReported` in crate `rustc_errors`
--> rust_verify/src/verifier.rs:1371:31
|
1371 | Err(rustc_errors::ErrorReported {}) => {
| ^^^^^^^^^^^^^ not found in `rustc_errors`
error[E0405]: cannot find trait `FormalVerifierRewrite` in crate `rustc_lint`
--> rust_verify/src/verifier.rs:1538:18
|
1538 | impl rustc_lint::FormalVerifierRewrite for Rewrite {
| ^^^^^^^^^^^^^^^^^^^^^ not found in `rustc_lint`
error[E0554]: `#![feature]` may not be used on the stable release channel
--> rust_verify/src/lib.rs:1:1
|
1 | #![feature(rustc_private)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> rust_verify/src/lib.rs:2:1
|
2 | #![feature(internal_output_capture)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> rust_verify/src/lib.rs:3:1
|
3 | #![feature(box_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the stable release channel
--> rust_verify/src/lib.rs:2:12
|
2 | #![feature(internal_output_capture)]
| ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 27 previous errors
Some errors have detailed explanations: E0405, E0412, E0422, E0432, E0433, E0463, E0554.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `rust_verify` due to 28 previous errors
[crates/flycheck/src/lib.rs:84] "not verus" = "not verus"
[crates/parser/src/grammar/verus.rs:142] "requires parse error" = "requires parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/parser/src/grammar/verus.rs:142] "requires parse error" = "requires parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/parser/src/grammar/verus.rs:142] "requires parse error" = "requires parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/parser/src/grammar/verus.rs:142] "requires parse error" = "requires parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/parser/src/grammar/verus.rs:199] "ensures parse error" = "ensures parse error"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
[crates/rust-analyzer/src/main_loop.rs:879] "no specific flycheck was triggered" = "no specific flycheck was triggered"
I tried to let rust-analyzer run on my M2 Mac VS Code.
I tried to manually install rust analyzer using
cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --target aarch64-apple-darwin --release
, and the rust-analyzer binary in./target/aarch64-apple-darwin/release/rust-analyzer
, but my rust analyzer cannot build. Here's the output of the Rust Analyzer Language Server: