@@ -24,6 +24,8 @@ rustPlatform.buildRustPackage {
24 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin
24 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin
25 [ darwin.apple_sdk.frameworks.CoreServices ];
25 [ darwin.apple_sdk.frameworks.CoreServices ];
27+ RUST_ANALYZER_REV = rev;
27 inherit doCheck;
29 inherit doCheck;
28 # Skip tests running `rustup` for `cargo fmt`.
30 # Skip tests running `rustup` for `cargo fmt`.
29 preCheck = ''
31 preCheck = ''
@@ -33,6 +35,15 @@ rustPlatform.buildRustPackage {
33 export RUST_SRC_PATH=${rustPlatform.rustcSrc}
35 export RUST_SRC_PATH=${rustPlatform.rustcSrc}
38+ doInstallCheck = true;
39+ installCheckPhase = ''
40+ runHook preInstallCheck
41+ versionOutput="$($out/bin/rust-analyzer --version)"
42+ echo "'rust-analyzer --version' returns: $versionOutput"
43+ [[ "$versionOutput" == "rust-analyzer ${rev}" ]]
44+ runHook postInstallCheck
36 meta = with stdenv.lib; {
47 meta = with stdenv.lib; {
37 description = "An experimental modular compiler frontend for the Rust language";
48 description = "An experimental modular compiler frontend for the Rust language";
38 homepage = "https://github.com/rust-analyzer/rust-analyzer";
49 homepage = "https://github.com/rust-analyzer/rust-analyzer";