mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-08-16 15:20:40 +03:00
[sc-440] Update rust toolchain, solve new deprecation warnings
This commit is contained in:
parent
1c5e06ed18
commit
b76a8fdf5c
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
profile = "minimal"
|
||||
channel = "nightly-2023-07-10"
|
||||
channel = "nightly-2023-12-10"
|
||||
components = ["rustfmt", "clippy"]
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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() });
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user