@@ -24,6 +24,8 @@ rustPlatform.buildRustPackage {
2424 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin
2525 [ darwin.apple_sdk.frameworks.CoreServices ];
2626
27+ RUST_ANALYZER_REV = rev;
28+
2729 inherit doCheck;
2830 # Skip tests running `rustup` for `cargo fmt`.
2931 preCheck = ''
@@ -33,6 +35,15 @@ rustPlatform.buildRustPackage {
3335 export RUST_SRC_PATH=${rustPlatform.rustcSrc}
3436 '';
3537
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
45+ '';
46+
3647 meta = with stdenv.lib; {
3748 description = "An experimental modular compiler frontend for the Rust language";
3849 homepage = "https://github.com/rust-analyzer/rust-analyzer";