aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/tools/rust
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/rust')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix8
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix2
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix2
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix2
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix8
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix47
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix6
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/downgrade-smol_str.patch82
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix14
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-loop-in-const-fn.patch223
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-match-unsizing-in-const-fn.patch30
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-option-zip.patch52
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch120
-rwxr-xr-xinfra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh12
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix5
21 files changed, 89 insertions, 560 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix
index 0c476a58e3d8..01e29036dbc7 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/bindgen/default.nix
@@ -3,7 +3,7 @@
rustPlatform.buildRustPackage rec {
pname = "rust-bindgen";
- version = "0.54.1";
+ version = "0.55.1";
RUSTFLAGS = "--cap-lints warn"; # probably OK to remove after update
@@ -11,10 +11,10 @@ rustPlatform.buildRustPackage rec {
owner = "rust-lang";
repo = pname;
rev = "v${version}";
- sha256 = "116np72w6agsi94xa1bdn6h7sa9gd522h358zlixk9xrhrx7yfn3";
+ sha256 = "0cbc78zrhda4adza88g05sy04chixqay2ylgdjgmf13h607hp3kn";
};
- cargoSha256 = "12a7bd2579jcnkss073v5w5w68fxwvhq6c6ndjy8vp78wg83qich";
+ cargoSha256 = "1dv1ywdy701bnc2jv5jq0hnpal1snlizaj9w6k1wxyrp9szjd48w";
libclang = llvmPackages.libclang.lib; #for substituteAll
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix
index 8374e0653560..51d19f5ad6fd 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-bloat/default.nix
@@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-bloat";
- version = "0.9.3";
+ version = "0.10.0";
src = fetchFromGitHub {
owner = "RazrFalcon";
repo = pname;
rev = "v${version}";
- sha256 = "04h9yyna47cgn2d232v2fpbgki9gg4lykpmx46ncpsq4g6azl1a9";
+ sha256 = "0bqzzh8vfqm7dpnb0fv4calnhsg9p3c5j06ycvg621p4zp4fydh2";
};
- cargoSha256 = "0lzc2nwz9lpwxv704k40d1416qnf3wy3g6ad8w8xbkfc6ydcaa4l";
+ cargoSha256 = "1323lcl8fa21pgx3jhwl4w9f8qz3jjxb5qdvib9jdzqxnnw320xs";
meta = with lib; {
description = "A tool and Cargo subcommand that helps you find out what takes most of the space in your executable";
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
index 41c03923ec05..ee0074f7d839 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
@@ -5,7 +5,7 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-c";
- version = "0.6.15";
+ version = "0.6.18";
src = stdenv.mkDerivation rec {
name = "${pname}-source-${version}";
@@ -14,11 +14,11 @@ rustPlatform.buildRustPackage rec {
owner = "lu-zero";
repo = pname;
rev = "v${version}";
- sha256 = "04hrk3vy8294vxcsggdpcs8hg3ykzj2564ifsqc4zwz4b4wd1p8l";
+ sha256 = "1dh5z210nl8grjxb8zxch8h7799w61bah7r2j0s07091rcpfsrsb";
};
cargoLock = fetchurl {
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
- sha256 = "0rqb6ssqsdlm8zbshbxkwxlyy7j7p2gyficavzz33cw9g6fpmzbd";
+ sha256 = "1h5wmfmm2a2ilyw3ar88rqm7yvdc2vhyx4pgg781615ax52fhjli";
};
installPhase = ''
@@ -28,7 +28,7 @@ rustPlatform.buildRustPackage rec {
'';
};
- cargoSha256 = "1q2s28nqd6l9qmhmdksdjjlypxry5ff18i2pgwmgiilcry51mj4b";
+ cargoSha256 = "0ll9p2rbnw46zd9m2bmdmn99v9jjjf8i33xpkvd1rx42ki7sys62";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix
index 0f3571045d67..3271e7951fac 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-cache/default.nix
@@ -21,6 +21,6 @@ rustPlatform.buildRustPackage rec {
description = "Manage cargo cache (\${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively";
homepage = "https://github.com/matthiaskrgr/cargo-cache";
license = with licenses; [ asl20 /* or */ mit ];
- maintainers = with maintainers; [ filalex77 ];
+ maintainers = with maintainers; [ Br1ght0ne ];
};
}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix
index 750b651651c4..6c85a5238039 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-crev/default.nix
@@ -11,16 +11,16 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-crev";
- version = "0.17.0";
+ version = "0.18.0";
src = fetchFromGitHub {
owner = "crev-dev";
repo = "cargo-crev";
rev = "v${version}";
- sha256 = "1s5wb5m0d77qi90pyxld98ap37xnxrz3sz5gazq0pp5i9c9xa124";
+ sha256 = "1ccwa44hpmpd57ff6w02rvrs63wxwmgls2i1rn285rxypmbysrp0";
};
- cargoSha256 = "10dzvzjqib751h2p1pl0z3dy2d17xwrcp9vyfrfr185yximcw2wx";
+ cargoSha256 = "1sffivpgrn4my57pcrg46b2yg6fmhxj61d2sqvg60fjljrg595zn";
nativeBuildInputs = [ perl pkg-config ];
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix
index a9c18b021bf5..e4c5d8ab48c7 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-embed/default.nix
@@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "A cargo extension for working with microcontrollers";
- homepage = "http://probe.rs/";
+ homepage = "https://probe.rs/";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ fooker ];
};
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix
index c32a87e7839f..09650e8a3868 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-expand/default.nix
@@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-expand";
- version = "1.0.0";
+ version = "1.0.4";
src = fetchFromGitHub {
owner = "dtolnay";
repo = pname;
rev = version;
- sha256 = "0bdv6h3mzmv46pdyvwl0v0bg719dlsxlx378ws6vgi1cga24g37i";
+ sha256 = "09jdqf1f8kl2c3k4cp8j3qqb96gclhncvfdwg2l3bmh5r10id9b3";
};
- cargoSha256 = "0qpihfgfqxw5fyhn124c5lbfaxr717bqf8mrbagh3vdgvk75j0qz";
+ cargoSha256 = "0mx01h2zv7mpyi8s1545b7hjxn9aslzpbngrq4ii9rfqznz3r8k9";
meta = with lib; {
description =
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix
index e5d23c9258cd..dbd79f179aa3 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-flash/default.nix
@@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "A cargo extension for working with microcontrollers";
- homepage = "http://probe.rs/";
+ homepage = "https://probe.rs/";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ fooker ];
};
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix
index a1e9f7971f4d..881a53872c96 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-make/default.nix
@@ -4,11 +4,11 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-make";
- version = "0.32.4";
+ version = "0.32.9";
src = fetchCrate {
inherit pname version;
- sha256 = "04x363wz82f0sr4128f1nk1wxnnszxsmaxjs92mbvmpbvry82ivq";
+ sha256 = "0f6avprq0d65v5fk3kn2kvw3w024f21yq6v8y7d9rbwqxxf87jlf";
};
nativeBuildInputs = [ pkg-config ];
@@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ openssl ]
++ stdenv.lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
- cargoSha256 = "1fgcxgm800sr0y6ab7c42l335b6c00cx0f2r5rgayi645a47a1zf";
+ cargoSha256 = "0v0657hh8ivqaq4sn0saaiz06shxavhrh9mksjlzj7c2ym6cxkih";
# Some tests fail because they need network access.
# However, Travis ensures a proper build.
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix
index b7879adcc31c..840f2ae27c3c 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cargo-udeps/default.nix
@@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "cargo-udeps";
- version = "0.1.14";
+ version = "0.1.16";
src = fetchFromGitHub {
owner = "est31";
repo = pname;
rev = "v${version}";
- sha256 = "0imvq63i3s9qmm0x8cbaknjap2yfmpzva3y0sxmgkcm8ajkvp114";
+ sha256 = "1h89xq91gbnbagfmvig5lkxyl08qwgdaf9vr55p599pmv190xq8s";
};
- cargoSha256 = "196w9rgz4pwqvkiy839kqz765ljqx1k129w4nvxgxv3rcmy4lbzm";
+ cargoSha256 = "17931z5nbigfzvvhr6k64s2j9p1sp9nvmy5fyf92j3ci02dplm5c";
nativeBuildInputs = [ pkgconfig ];
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix
index 62b9a616644d..0b557af42585 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/cbindgen/default.nix
@@ -2,16 +2,16 @@
rustPlatform.buildRustPackage rec {
pname = "rust-cbindgen";
- version = "0.14.4";
+ version = "0.15.0";
src = fetchFromGitHub {
owner = "eqrion";
repo = "cbindgen";
rev = "v${version}";
- sha256 = "06bis9kk3r0gishzmsq5wk3vv8r78ggk4m800562q2yhnhc37lfd";
+ sha256 = "19bwllrajks286wl4zc5axgh4m9qqxdnc5024c30hyk0xnjffd0c";
};
- cargoSha256 = "0x8lxlik4n8rmlydcp0vqyiqwqm98cgwvw3h5hm2zviv8v0y8jnr";
+ cargoSha256 = "1lzzckzcgj496chbfd6lhwxcangv0krx8m5k2jwffnb9mfgac7hx";
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
@@ -24,6 +24,6 @@ rustPlatform.buildRustPackage rec {
description = "A project for generating C bindings from Rust code";
homepage = "https://github.com/eqrion/cbindgen";
license = licenses.mpl20;
- maintainers = with maintainers; [ jtojnar andir ];
+ maintainers = with maintainers; [ jtojnar ];
};
}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix
new file mode 100644
index 000000000000..a941d43bb9d8
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/crate2nix/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, makeWrapper
+
+, cargo
+, nix
+, nix-prefetch-git
+}:
+
+rustPlatform.buildRustPackage rec {
+ pname = "crate2nix";
+ version = "0.8.0";
+
+ src = fetchFromGitHub
+ {
+ owner = "kolloch";
+ repo = pname;
+ rev = version;
+ sha256 = "sha256-pqg1BsEq3kGmUzt1zpQvXgdnRcIsiuIyvtUBi3VxtZ4=";
+ } + "/crate2nix";
+
+ cargoSha256 = "sha256-dAMWrGNMleQ3lDbG46Hr4qvCyxR+QcPOUZw9r2/CxV4=";
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ # Tests use nix(1), which tries (and fails) to set up /nix/var inside the
+ # sandbox
+ doCheck = false;
+
+ postFixup = ''
+ wrapProgram $out/bin/crate2nix \
+ --suffix PATH ":" ${lib.makeBinPath [ cargo nix nix-prefetch-git ]}
+ '';
+
+ meta = with lib; {
+ description = "A Nix build file generator for Rust crates.";
+ longDescription = ''
+ Crate2nix generates Nix files from Cargo.toml/lock files
+ so that you can build every crate individually in a Nix sandbox.
+ '';
+ homepage = "https://github.com/kolloch/crate2nix";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ kolloch andir cole-h ];
+ platforms = platforms.all;
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix
index 77a0328fc375..a398b7e504df 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/default.nix
@@ -2,10 +2,10 @@
{
rust-analyzer-unwrapped = callPackage ./generic.nix rec {
- rev = "2020-10-12";
+ rev = "2020-11-09";
version = "unstable-${rev}";
- sha256 = "194xax87pwdh3p8zx46igvqwznlpnl4jp8lj987616gyldfgall0";
- cargoSha256 = "1rvf3a2fpqpf4q52pi676qzq7h0xfqlcbp15sc5vqc8nbbs7c7vw";
+ sha256 = "sha256-SX9dvx2JtYZBxA3+dHQKX/jrjbAMy37/SAybDjlYcSs=";
+ cargoSha256 = "sha256-+td+wMmI+MyGz9oPC+SPO2TmAV0+3lOORNY7xf6s3vI=";
};
rust-analyzer = callPackage ./wrapper.nix {} {
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/downgrade-smol_str.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/downgrade-smol_str.patch
deleted file mode 100644
index c3ceb0963336..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/downgrade-smol_str.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-This patch revert 875ad9b5c410200f5072515ae91b4ff51cff0448 (Bump smol_str from 0.1.16 to 0.1.17 ).
-
-diff --git a/Cargo.lock b/Cargo.lock
-index 477af57aa..8b9055879 100644
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -1470,9 +1470,9 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
-
- [[package]]
- name = "smol_str"
--version = "0.1.17"
-+version = "0.1.16"
- source = "registry+https://github.com/rust-lang/crates.io-index"
--checksum = "6ca0f7ce3a29234210f0f4f0b56f8be2e722488b95cb522077943212da3b32eb"
-+checksum = "2f7909a1d8bc166a862124d84fdc11bda0ea4ed3157ccca662296919c2972db1"
- dependencies = [
- "serde",
- ]
-diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
-index a5750d829..49841c7a1 100644
---- a/crates/hir_expand/src/name.rs
-+++ b/crates/hir_expand/src/name.rs
-@@ -43,8 +43,8 @@ impl Name {
- }
-
- /// Shortcut to create inline plain text name
-- const fn new_inline(text: &str) -> Name {
-- Name::new_text(SmolStr::new_inline(text))
-+ const fn new_inline_ascii(text: &[u8]) -> Name {
-+ Name::new_text(SmolStr::new_inline_from_ascii(text.len(), text))
- }
-
- /// Resolve a name from the text of token.
-@@ -127,7 +127,7 @@ pub mod known {
- $(
- #[allow(bad_style)]
- pub const $ident: super::Name =
-- super::Name::new_inline(stringify!($ident));
-+ super::Name::new_inline_ascii(stringify!($ident).as_bytes());
- )*
- };
- }
-@@ -210,8 +210,8 @@ pub mod known {
- );
-
- // self/Self cannot be used as an identifier
-- pub const SELF_PARAM: super::Name = super::Name::new_inline("self");
-- pub const SELF_TYPE: super::Name = super::Name::new_inline("Self");
-+ pub const SELF_PARAM: super::Name = super::Name::new_inline_ascii(b"self");
-+ pub const SELF_TYPE: super::Name = super::Name::new_inline_ascii(b"Self");
-
- #[macro_export]
- macro_rules! name {
-diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
-index 9a7785c76..2b53b8297 100644
---- a/crates/hir_ty/src/infer.rs
-+++ b/crates/hir_ty/src/infer.rs
-@@ -555,7 +555,7 @@ impl<'a> InferenceContext<'a> {
-
- fn resolve_lang_item(&self, name: &str) -> Option<LangItemTarget> {
- let krate = self.resolver.krate()?;
-- let name = SmolStr::new_inline(name);
-+ let name = SmolStr::new_inline_from_ascii(name.len(), name.as_bytes());
- self.db.lang_item(krate, name)
- }
-
-diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
-index d987b2500..a8ad917fb 100644
---- a/crates/mbe/src/syntax_bridge.rs
-+++ b/crates/mbe/src/syntax_bridge.rs
-@@ -636,10 +636,7 @@ impl<'a> TreeSink for TtTreeSink<'a> {
- let (text, id) = match leaf {
- tt::Leaf::Ident(ident) => (ident.text.clone(), ident.id),
- tt::Leaf::Punct(punct) => {
-- assert!(punct.char.is_ascii());
-- let char = &(punct.char as u8);
-- let text = std::str::from_utf8(std::slice::from_ref(char)).unwrap();
-- (SmolStr::new_inline(text), punct.id)
-+ (SmolStr::new_inline_from_ascii(1, &[punct.char as u8]), punct.id)
- }
- tt::Leaf::Literal(lit) => (lit.text.clone(), lit.id),
- };
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix
index b25f74b90f66..1bab5b951837 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/generic.nix
@@ -16,18 +16,6 @@ rustPlatform.buildRustPackage {
inherit rev sha256;
};
- # FIXME: Temporary fixes for our rust 1.45.0
- cargoPatches = [
- ./downgrade-smol_str.patch # Requires rustc 1.46.0
- ];
-
- patches = [
- ./no-track_env_var.patch # Requires rustc 1.47.0
- ./no-match-unsizing-in-const-fn.patch # Requires rustc 1.46.0
- ./no-loop-in-const-fn.patch # Requires rustc 1.46.0
- ./no-option-zip.patch # Requires rustc 1.46.0
- ];
-
buildAndTestSubdir = "crates/rust-analyzer";
cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc";
@@ -41,7 +29,7 @@ rustPlatform.buildRustPackage {
inherit doCheck;
preCheck = lib.optionalString doCheck ''
- export RUST_SRC_PATH=${rustPlatform.rustcSrc}
+ export RUST_SRC_PATH=${rustPlatform.rustLibSrc}
'';
doInstallCheck = true;
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-loop-in-const-fn.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-loop-in-const-fn.patch
deleted file mode 100644
index e750b3c4e122..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-loop-in-const-fn.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-This patch revert 4b989009e3839cfc6f021d1552a46561cee6cde2 (CONST LOOPS ARE HERE).
-
-diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs
-index 5f885edfd..e72929f8c 100644
---- a/crates/parser/src/grammar/expressions.rs
-+++ b/crates/parser/src/grammar/expressions.rs
-@@ -316,7 +316,7 @@ fn expr_bp(p: &mut Parser, mut r: Restrictions, bp: u8) -> (Option<CompletedMark
- }
-
- const LHS_FIRST: TokenSet =
-- atom::ATOM_EXPR_FIRST.union(TokenSet::new(&[T![&], T![*], T![!], T![.], T![-]]));
-+ atom::ATOM_EXPR_FIRST.union(token_set![T![&], T![*], T![!], T![.], T![-]]);
-
- fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> {
- let m;
-diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
-index 66a92a4e1..ba6dd2fbc 100644
---- a/crates/parser/src/grammar/expressions/atom.rs
-+++ b/crates/parser/src/grammar/expressions/atom.rs
-@@ -15,7 +15,7 @@ use super::*;
- // let _ = b"e";
- // let _ = br"f";
- // }
--pub(crate) const LITERAL_FIRST: TokenSet = TokenSet::new(&[
-+pub(crate) const LITERAL_FIRST: TokenSet = token_set![
- TRUE_KW,
- FALSE_KW,
- INT_NUMBER,
-@@ -25,8 +25,8 @@ pub(crate) const LITERAL_FIRST: TokenSet = TokenSet::new(&[
- STRING,
- RAW_STRING,
- BYTE_STRING,
-- RAW_BYTE_STRING,
--]);
-+ RAW_BYTE_STRING
-+];
-
- pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
- if !p.at_ts(LITERAL_FIRST) {
-@@ -39,7 +39,7 @@ pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
-
- // E.g. for after the break in `if break {}`, this should not match
- pub(super) const ATOM_EXPR_FIRST: TokenSet =
-- LITERAL_FIRST.union(paths::PATH_FIRST).union(TokenSet::new(&[
-+ LITERAL_FIRST.union(paths::PATH_FIRST).union(token_set![
- T!['('],
- T!['{'],
- T!['['],
-@@ -59,9 +59,9 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet =
- T![loop],
- T![for],
- LIFETIME,
-- ]));
-+ ]);
-
--const EXPR_RECOVERY_SET: TokenSet = TokenSet::new(&[LET_KW, R_DOLLAR]);
-+const EXPR_RECOVERY_SET: TokenSet = token_set![LET_KW, R_DOLLAR];
-
- pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> {
- if let Some(m) = literal(p) {
-diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
-index 22810e6fb..8fd8f3b80 100644
---- a/crates/parser/src/grammar/items.rs
-+++ b/crates/parser/src/grammar/items.rs
-@@ -26,7 +26,7 @@ pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) {
- }
- }
-
--pub(super) const ITEM_RECOVERY_SET: TokenSet = TokenSet::new(&[
-+pub(super) const ITEM_RECOVERY_SET: TokenSet = token_set![
- FN_KW,
- STRUCT_KW,
- ENUM_KW,
-@@ -41,7 +41,7 @@ pub(super) const ITEM_RECOVERY_SET: TokenSet = TokenSet::new(&[
- USE_KW,
- MACRO_KW,
- T![;],
--]);
-+];
-
- pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) {
- let m = p.start();
-diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs
-index 5d297e2d6..52562afa4 100644
---- a/crates/parser/src/grammar/paths.rs
-+++ b/crates/parser/src/grammar/paths.rs
-@@ -3,7 +3,7 @@
- use super::*;
-
- pub(super) const PATH_FIRST: TokenSet =
-- TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![:], T![<]]);
-+ token_set![IDENT, T![self], T![super], T![crate], T![:], T![<]];
-
- pub(super) fn is_path_start(p: &Parser) -> bool {
- is_use_path_start(p) || p.at(T![<])
-diff --git a/crates/parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs
-index 796f206e1..07b1d6dd5 100644
---- a/crates/parser/src/grammar/patterns.rs
-+++ b/crates/parser/src/grammar/patterns.rs
-@@ -2,18 +2,9 @@
-
- use super::*;
-
--pub(super) const PATTERN_FIRST: TokenSet =
-- expressions::LITERAL_FIRST.union(paths::PATH_FIRST).union(TokenSet::new(&[
-- T![box],
-- T![ref],
-- T![mut],
-- T!['('],
-- T!['['],
-- T![&],
-- T![_],
-- T![-],
-- T![.],
-- ]));
-+pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST
-+ .union(paths::PATH_FIRST)
-+ .union(token_set![T![box], T![ref], T![mut], T!['('], T!['['], T![&], T![_], T![-], T![.]]);
-
- pub(crate) fn pattern(p: &mut Parser) {
- pattern_r(p, PAT_RECOVERY_SET);
-@@ -83,7 +74,7 @@ fn pattern_single_r(p: &mut Parser, recovery_set: TokenSet) {
- }
-
- const PAT_RECOVERY_SET: TokenSet =
-- TokenSet::new(&[LET_KW, IF_KW, WHILE_KW, LOOP_KW, MATCH_KW, R_PAREN, COMMA]);
-+ token_set![LET_KW, IF_KW, WHILE_KW, LOOP_KW, MATCH_KW, R_PAREN, COMMA];
-
- fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option<CompletedMarker> {
- let m = match p.nth(0) {
-diff --git a/crates/parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs
-index 1ea130ac5..9d00eb9b9 100644
---- a/crates/parser/src/grammar/types.rs
-+++ b/crates/parser/src/grammar/types.rs
-@@ -2,7 +2,7 @@
-
- use super::*;
-
--pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(TokenSet::new(&[
-+pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![
- T!['('],
- T!['['],
- T![<],
-@@ -16,16 +16,16 @@ pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(TokenSet::new(&[
- T![for],
- T![impl],
- T![dyn],
--]));
-+]);
-
--const TYPE_RECOVERY_SET: TokenSet = TokenSet::new(&[
-+const TYPE_RECOVERY_SET: TokenSet = token_set![
- T![')'],
- T![,],
- L_DOLLAR,
- // test_err struct_field_recover
- // struct S { f pub g: () }
- T![pub],
--]);
-+];
-
- pub(crate) fn type_(p: &mut Parser) {
- type_with_bounds_cond(p, true);
-diff --git a/crates/parser/src/token_set.rs b/crates/parser/src/token_set.rs
-index a68f0144e..994017acf 100644
---- a/crates/parser/src/token_set.rs
-+++ b/crates/parser/src/token_set.rs
-@@ -9,21 +9,15 @@ pub(crate) struct TokenSet(u128);
- impl TokenSet {
- pub(crate) const EMPTY: TokenSet = TokenSet(0);
-
-- pub(crate) const fn new(kinds: &[SyntaxKind]) -> TokenSet {
-- let mut res = 0u128;
-- let mut i = 0;
-- while i < kinds.len() {
-- res |= mask(kinds[i]);
-- i += 1
-- }
-- TokenSet(res)
-+ pub(crate) const fn singleton(kind: SyntaxKind) -> TokenSet {
-+ TokenSet(mask(kind))
- }
-
- pub(crate) const fn union(self, other: TokenSet) -> TokenSet {
- TokenSet(self.0 | other.0)
- }
-
-- pub(crate) const fn contains(&self, kind: SyntaxKind) -> bool {
-+ pub(crate) fn contains(&self, kind: SyntaxKind) -> bool {
- self.0 & mask(kind) != 0
- }
- }
-@@ -32,10 +26,16 @@ const fn mask(kind: SyntaxKind) -> u128 {
- 1u128 << (kind as usize)
- }
-
-+#[macro_export]
-+macro_rules! token_set {
-+ ($($t:expr),*) => { TokenSet::EMPTY$(.union(TokenSet::singleton($t)))* };
-+ ($($t:expr),* ,) => { token_set!($($t),*) };
-+}
-+
- #[test]
- fn token_set_works_for_tokens() {
- use crate::SyntaxKind::*;
-- let ts = TokenSet::new(&[EOF, SHEBANG]);
-+ let ts = token_set![EOF, SHEBANG];
- assert!(ts.contains(EOF));
- assert!(ts.contains(SHEBANG));
- assert!(!ts.contains(PLUS));
-diff --git a/xtask/src/install.rs b/xtask/src/install.rs
-index d829790d7..b25a6e301 100644
---- a/xtask/src/install.rs
-+++ b/xtask/src/install.rs
-@@ -7,7 +7,7 @@ use anyhow::{bail, format_err, Context, Result};
- use crate::not_bash::{pushd, run};
-
- // Latest stable, feel free to send a PR if this lags behind.
--const REQUIRED_RUST_VERSION: u32 = 46;
-+const REQUIRED_RUST_VERSION: u32 = 43;
-
- pub struct InstallCmd {
- pub client: Option<ClientOpt>,
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-match-unsizing-in-const-fn.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-match-unsizing-in-const-fn.patch
deleted file mode 100644
index 3bdd4c8a727b..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-match-unsizing-in-const-fn.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/crates/assists/src/handlers/convert_integer_literal.rs b/crates/assists/src/handlers/convert_integer_literal.rs
-index ea35e833a..4df80a3c0 100644
---- a/crates/assists/src/handlers/convert_integer_literal.rs
-+++ b/crates/assists/src/handlers/convert_integer_literal.rs
-@@ -105,7 +105,7 @@ impl IntegerLiteralBase {
- }
- }
-
-- const fn base(&self) -> u32 {
-+ fn base(&self) -> u32 {
- match self {
- Self::Binary => 2,
- Self::Octal => 8,
-@@ -114,14 +114,14 @@ impl IntegerLiteralBase {
- }
- }
-
-- const fn prefix_len(&self) -> usize {
-+ fn prefix_len(&self) -> usize {
- match self {
- Self::Decimal => 0,
- _ => 2,
- }
- }
-
-- const fn bases() -> &'static [IntegerLiteralBase] {
-+ fn bases() -> &'static [IntegerLiteralBase] {
- &[
- IntegerLiteralBase::Binary,
- IntegerLiteralBase::Octal,
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-option-zip.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-option-zip.patch
deleted file mode 100644
index 5b1089ba9b87..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-option-zip.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git a/crates/assists/src/handlers/merge_imports.rs b/crates/assists/src/handlers/merge_imports.rs
-index fe33cee53..2184a4154 100644
---- a/crates/assists/src/handlers/merge_imports.rs
-+++ b/crates/assists/src/handlers/merge_imports.rs
-@@ -32,7 +32,7 @@ pub(crate) fn merge_imports(acc: &mut Assists, ctx: &AssistContext) -> Option<()
- if let Some(use_item) = tree.syntax().parent().and_then(ast::Use::cast) {
- let (merged, to_delete) =
- next_prev().filter_map(|dir| neighbor(&use_item, dir)).find_map(|use_item2| {
-- try_merge_imports(&use_item, &use_item2, MergeBehaviour::Full).zip(Some(use_item2))
-+ Some((try_merge_imports(&use_item, &use_item2, MergeBehaviour::Full)?, use_item2))
- })?;
-
- rewriter.replace_ast(&use_item, &merged);
-@@ -44,7 +44,7 @@ pub(crate) fn merge_imports(acc: &mut Assists, ctx: &AssistContext) -> Option<()
- } else {
- let (merged, to_delete) =
- next_prev().filter_map(|dir| neighbor(&tree, dir)).find_map(|use_tree| {
-- try_merge_trees(&tree, &use_tree, MergeBehaviour::Full).zip(Some(use_tree))
-+ Some((try_merge_trees(&tree, &use_tree, MergeBehaviour::Full)?, use_tree))
- })?;
-
- rewriter.replace_ast(&tree, &merged);
-diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs
-index f6025c99a..f9bd31cf3 100644
---- a/crates/assists/src/utils/insert_use.rs
-+++ b/crates/assists/src/utils/insert_use.rs
-@@ -274,7 +274,7 @@ fn common_prefix(lhs: &ast::Path, rhs: &ast::Path) -> Option<(ast::Path, ast::Pa
- }
- res = Some((lhs_curr.clone(), rhs_curr.clone()));
-
-- match lhs_curr.parent_path().zip(rhs_curr.parent_path()) {
-+ match zip(lhs_curr.parent_path(), rhs_curr.parent_path()) {
- Some((lhs, rhs)) => {
- lhs_curr = lhs;
- rhs_curr = rhs;
-@@ -452,7 +452,7 @@ fn find_insert_position(
- let path_node_iter = scope
- .as_syntax_node()
- .children()
-- .filter_map(|node| ast::Use::cast(node.clone()).zip(Some(node)))
-+ .filter_map(|node| Some((ast::Use::cast(node.clone())?, node)))
- .flat_map(|(use_, node)| {
- let tree = use_.use_tree()?;
- let path = tree.path()?;
-@@ -989,3 +989,7 @@ use foo::bar::baz::Qux;",
- assert_eq!(result.map(|u| u.to_string()), None);
- }
- }
-+
-+fn zip<T, U>(x: Option<T>, y: Option<U>) -> Option<(T, U)> {
-+ Some((x?, y?))
-+}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch
deleted file mode 100644
index f5173c4bacbc..000000000000
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/no-track_env_var.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-This patch revert 3d169bd3f4cdc2dc3dd09eadbbc17c19214d69f3 (Add track_env_var to the proc macro server).
-
-diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/client.rs b/crates/proc_macro_srv/src/proc_macro/bridge/client.rs
-index 55d6330cc..cb4b3bdb0 100644
---- a/crates/proc_macro_srv/src/proc_macro/bridge/client.rs
-+++ b/crates/proc_macro_srv/src/proc_macro/bridge/client.rs
-@@ -160,7 +160,6 @@ macro_rules! define_handles {
- }
- define_handles! {
- 'owned:
-- FreeFunctions,
- TokenStream,
- TokenStreamBuilder,
- TokenStreamIter,
-diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs b/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs
-index b97886eb9..aeb05aad4 100644
---- a/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs
-+++ b/crates/proc_macro_srv/src/proc_macro/bridge/mod.rs
-@@ -57,10 +57,6 @@ use std::thread;
- macro_rules! with_api {
- ($S:ident, $self:ident, $m:ident) => {
- $m! {
-- FreeFunctions {
-- fn drop($self: $S::FreeFunctions);
-- fn track_env_var(var: &str, value: Option<&str>);
-- },
- TokenStream {
- fn drop($self: $S::TokenStream);
- fn clone($self: &$S::TokenStream) -> $S::TokenStream;
-diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs
-index 3acb239af..45d41ac02 100644
---- a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs
-+++ b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs
-@@ -11,8 +11,6 @@ use super::client::HandleStore;
- /// Declare an associated item of one of the traits below, optionally
- /// adjusting it (i.e., adding bounds to types and default bodies to methods).
- macro_rules! associated_item {
-- (type FreeFunctions) =>
-- (type FreeFunctions: 'static;);
- (type TokenStream) =>
- (type TokenStream: 'static + Clone;);
- (type TokenStreamBuilder) =>
-diff --git a/crates/proc_macro_srv/src/proc_macro/mod.rs b/crates/proc_macro_srv/src/proc_macro/mod.rs
-index fc6e7344f..ee0dc9722 100644
---- a/crates/proc_macro_srv/src/proc_macro/mod.rs
-+++ b/crates/proc_macro_srv/src/proc_macro/mod.rs
-@@ -924,25 +924,3 @@ impl fmt::Debug for Literal {
- self.0.fmt(f)
- }
- }
--
--pub mod tracked_env {
-- use std::env::{self, VarError};
-- use std::ffi::OsStr;
--
-- /// Retrieve an environment variable and add it to build dependency info.
-- /// Build system executing the compiler will know that the variable was accessed during
-- /// compilation, and will be able to rerun the build when the value of that variable changes.
-- /// Besides the dependency tracking this function should be equivalent to `env::var` from the
-- /// standard library, except that the argument must be UTF-8.
-- pub fn var<K: AsRef<OsStr> + AsRef<str>>(key: K) -> Result<String, VarError> {
-- use std::ops::Deref;
--
-- let key: &str = key.as_ref();
-- let value = env::var(key);
-- super::bridge::client::FreeFunctions::track_env_var(
-- key,
-- value.as_ref().map(|t| t.deref()).ok(),
-- );
-- value
-- }
--}
-diff --git a/crates/proc_macro_srv/src/rustc_server.rs b/crates/proc_macro_srv/src/rustc_server.rs
-index c5fe3591e..7d1695c86 100644
---- a/crates/proc_macro_srv/src/rustc_server.rs
-+++ b/crates/proc_macro_srv/src/rustc_server.rs
-@@ -242,8 +242,6 @@ impl TokenStreamBuilder {
- }
- }
-
--pub struct FreeFunctions;
--
- #[derive(Clone)]
- pub struct TokenStreamIter {
- trees: IntoIter<TokenTree>,
-@@ -256,7 +254,6 @@ pub struct Rustc {
- }
-
- impl server::Types for Rustc {
-- type FreeFunctions = FreeFunctions;
- type TokenStream = TokenStream;
- type TokenStreamBuilder = TokenStreamBuilder;
- type TokenStreamIter = TokenStreamIter;
-@@ -270,13 +267,6 @@ impl server::Types for Rustc {
- type MultiSpan = Vec<Span>;
- }
-
--impl server::FreeFunctions for Rustc {
-- fn track_env_var(&mut self, _var: &str, _value: Option<&str>) {
-- // FIXME: track env var accesses
-- // https://github.com/rust-lang/rust/pull/71858
-- }
--}
--
- impl server::TokenStream for Rustc {
- fn new(&mut self) -> Self::TokenStream {
- Self::TokenStream::new()
-diff --git a/xtask/src/install.rs b/xtask/src/install.rs
-index fcc4f05e4..d829790d7 100644
---- a/xtask/src/install.rs
-+++ b/xtask/src/install.rs
-@@ -7,7 +7,7 @@ use anyhow::{bail, format_err, Context, Result};
- use crate::not_bash::{pushd, run};
-
- // Latest stable, feel free to send a PR if this lags behind.
--const REQUIRED_RUST_VERSION: u32 = 47;
-+const REQUIRED_RUST_VERSION: u32 = 46;
-
- pub struct InstallCmd {
- pub client: Option<ClientOpt>,
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh
index b0435be72083..f08ea67cf22d 100755
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/update.sh
@@ -24,24 +24,24 @@ echo "$old_rev -> $rev"
sha256=$(nix-prefetch -f "$nixpkgs" rust-analyzer-unwrapped.src --rev "$rev")
# Clear cargoSha256 to avoid inconsistency.
-sed -e "s/rev = \".*\"/rev = \"$rev\"/" \
- -e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" \
- -e "s/cargoSha256 = \".*\"/cargoSha256 = \"\"/" \
+sed -e "s#rev = \".*\"#rev = \"$rev\"#" \
+ -e "s#sha256 = \".*\"#sha256 = \"$sha256\"#" \
+ -e "s#cargoSha256 = \".*\"#cargoSha256 = \"\"#" \
--in-place ./default.nix
node_src="$(nix-build "$nixpkgs" -A rust-analyzer.src --no-out-link)/editors/code"
# Check vscode compatibility
req_vscode_ver="$(jq '.engines.vscode' "$node_src/package.json" --raw-output)"
req_vscode_ver="${req_vscode_ver#^}"
-cur_vscode_ver="$(nix eval --raw -f "$nixpkgs" vscode.version)"
-if [[ "$(nix eval "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then
+cur_vscode_ver="$(nix-instantiate --eval --strict "$nixpkgs" -A vscode.version | tr -d '"')"
+if [[ "$(nix-instantiate --eval --strict -E "(builtins.compareVersions \"$req_vscode_ver\" \"$cur_vscode_ver\")")" -gt 0 ]]; then
echo "vscode $cur_vscode_ver is incompatible with the extension requiring ^$req_vscode_ver"
exit 1
fi
echo "Prebuilding for cargoSha256"
cargo_sha256=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).rust-analyzer-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
-sed "s/cargoSha256 = \".*\"/cargoSha256 = \"$cargo_sha256\"/" \
+sed "s#cargoSha256 = \".*\"#cargoSha256 = \"$cargo_sha256\"#" \
--in-place ./default.nix
# Update vscode extension
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
index 8ca3ff1a6d20..bed206281826 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
@@ -4,7 +4,8 @@ lib.makeOverridable ({
unwrapped,
pname ? "rust-analyzer",
version ? unwrapped.version,
- rustcSrc ? rustPlatform.rustcSrc,
+ # Use name from `RUST_SRC_PATH`
+ rustSrc ? rustPlatform.rustLibSrc,
}: runCommandNoCC "${pname}-${version}" {
inherit pname version;
inherit (unwrapped) src meta;
@@ -12,5 +13,5 @@ lib.makeOverridable ({
} ''
mkdir -p $out/bin
makeWrapper ${unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
- --set-default RUST_SRC_PATH "${rustcSrc}"
+ --set-default RUST_SRC_PATH "${rustSrc}"
'')