summaryrefslogtreecommitdiff
path: root/src/eval/scope.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-31 16:06:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-01-31 16:47:00 +0100
commit20b1a38414101f842a6d9201133a5aaaa45a7cec (patch)
tree2365453d4dfdebfa11d618baad1a36c65b62d7c7 /src/eval/scope.rs
parentfa57d86ed981373b66804972147bf59cab920e6b (diff)
Switch from `Rc` to `Arc`
Diffstat (limited to 'src/eval/scope.rs')
-rw-r--r--src/eval/scope.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/eval/scope.rs b/src/eval/scope.rs
index 5178c819..34da68d4 100644
--- a/src/eval/scope.rs
+++ b/src/eval/scope.rs
@@ -2,14 +2,14 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt::{self, Debug, Formatter};
use std::iter;
-use std::rc::Rc;
+use std::sync::Arc;
use super::{Args, Class, Construct, EvalContext, Function, Set, Value};
use crate::diag::TypResult;
use crate::util::EcoString;
/// A slot where a variable is stored.
-pub type Slot = Rc<RefCell<Value>>;
+pub type Slot = Arc<RefCell<Value>>;
/// A stack of scopes.
#[derive(Debug, Default, Clone)]
@@ -85,12 +85,12 @@ impl Scope {
// FIXME: Use Ref::leak once stable.
std::mem::forget(cell.borrow());
- self.values.insert(var.into(), Rc::new(cell));
+ self.values.insert(var.into(), Arc::new(cell));
}
/// Define a mutable variable with a value.
pub fn def_mut(&mut self, var: impl Into<EcoString>, value: impl Into<Value>) {
- self.values.insert(var.into(), Rc::new(RefCell::new(value.into())));
+ self.values.insert(var.into(), Arc::new(RefCell::new(value.into())));
}
/// Define a variable with a slot.