[sc-440] Update rust toolchain, solve new deprecation warnings

This commit is contained in:
Nicolas Abril 2024-02-12 14:58:34 +01:00
parent 1c5e06ed18
commit b76a8fdf5c
7 changed files with 13 additions and 12 deletions

4
Cargo.lock generated
View File

@ -228,9 +228,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "2.1.0"
version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177"
dependencies = [
"equivalent",
"hashbrown 0.14.3",

View File

@ -24,7 +24,7 @@ chumsky = "= 1.0.0-alpha.4"
clap = { version = "4.4.1", features = ["derive"], optional = true }
highlight_error = "0.1.1"
hvm-core = { git = "https://github.com/HigherOrderCO/hvm-core" }
indexmap = "2.1.0"
indexmap = "2.2.3"
itertools = "0.11.0"
logos = "0.13.0"

View File

@ -1,4 +1,4 @@
[toolchain]
profile = "minimal"
channel = "nightly-2023-07-10"
channel = "nightly-2023-12-10"
components = ["rustfmt", "clippy"]

View File

@ -351,7 +351,7 @@ impl Term {
Term::Lam { nam: Some(nam), bod, .. } => {
let mut new_scope = IndexMap::new();
go(bod, &mut new_scope);
new_scope.remove(nam);
new_scope.shift_remove(nam);
free_vars.extend(new_scope);
}
@ -366,7 +366,7 @@ impl Term {
go(nxt, &mut new_scope);
for bind in pat.names() {
new_scope.remove(bind);
new_scope.shift_remove(bind);
}
free_vars.extend(new_scope);
@ -377,8 +377,8 @@ impl Term {
let mut new_scope = IndexMap::new();
go(nxt, &mut new_scope);
fst.as_ref().map(|fst| new_scope.remove(fst));
snd.as_ref().map(|snd| new_scope.remove(snd));
fst.as_ref().map(|fst| new_scope.shift_remove(fst));
snd.as_ref().map(|snd| new_scope.shift_remove(snd));
free_vars.extend(new_scope);
}
@ -397,7 +397,7 @@ impl Term {
go(term, &mut new_scope);
if let Pattern::Num(MatchNum::Succ(Some(Some(nam)))) = rule {
new_scope.remove(nam);
new_scope.shift_remove(nam);
}
free_vars.extend(new_scope);

View File

@ -243,12 +243,13 @@ impl<'a> Reader<'a> {
let node_kind = &self.net.node(node).kind;
// Eta-reduce the readback inet.
// This is not valid for all kinds of nodes, only CON/TUP/DUP, due to their interaction rules.
if matches!(node_kind, Con { .. } | Tup | Dup { .. }) {
match (fst_port, snd_port) {
(Port(fst_node, 1), Port(snd_node, 2)) if fst_node == snd_node => {
if self.net.node(fst_node).kind == *node_kind {
self.scope.remove(&fst_node);
self.scope.shift_remove(&fst_node);
let port_zero = self.net.enter_port(Port(fst_node, 0));
let term = self.read_term(port_zero);

View File

@ -39,7 +39,7 @@ impl Book {
self.defs.insert(new_name.clone(), new_def);
// Remove the old ones and write the map of old names to new ones.
for name in equal_defs {
self.defs.remove(&name);
self.defs.swap_remove(&name);
name_map.insert(name, new_name.clone());
}
} else {

View File

@ -80,7 +80,7 @@ impl Book {
for def_name in unused {
let def = &self.defs[&def_name];
if prune_all || def.builtin {
self.defs.remove(&def_name);
self.defs.swap_remove(&def_name);
} else if !def_name.is_generated() {
warnings.push(Warning::UnusedDefinition { def_name: def_name.clone() });
}