1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-26 02:48:06 +03:00

Fix rust 1.64 compatibility

nixpkgs still have rust 1.64 on master.
This commit is contained in:
oxalica 2022-11-24 19:20:11 +08:00
parent 41de8c72c5
commit f1304942e3
2 changed files with 12 additions and 7 deletions

View File

@ -15,8 +15,9 @@ pub(super) fn convert_to_inherit(ctx: &mut AssistsCtx<'_>) -> Option<()> {
}
// RHS should be a single identifier.
let ast::Expr::Ref(rhs) = binding.value()?.flatten_paren()? else {
return None;
let rhs = match binding.value()?.flatten_paren()? {
ast::Expr::Ref(rhs) => rhs,
_ => return None,
};
// LHS should be a single static name.
@ -25,8 +26,9 @@ pub(super) fn convert_to_inherit(ctx: &mut AssistsCtx<'_>) -> Option<()> {
if attrs.next().is_some() {
return None;
}
let AttrKind::Static(Some(key)) = AttrKind::of(attr) else {
return None;
let key = match AttrKind::of(attr) {
AttrKind::Static(Some(key)) => key,
_ => return None,
};
// LHS should match RHS.

View File

@ -58,10 +58,13 @@
};
devShells.default = pkgs.mkShell {
packages = with pkgs; with rustPkgs; [
packages = with pkgs; [
# Override the stable rustfmt.
rust-nightly_2022-10-01.availableComponents.rustfmt
rust
rustPkgs.rust-nightly_2022-10-01.availableComponents.rustfmt
# Follows nixpkgs's version of rustc.
(let vers = lib.splitVersion rustc.version; in
rustPkgs."rust_${lib.elemAt vers 0}_${lib.elemAt vers 1}_${lib.elemAt vers 2}")
nix.out # For generation of builtins.
gdb
jq