提交 b85d5f1f 编写于 作者: F Flavio Percoco

Relax interner's Share bound

The interner uses `RefCell` internally which opted out from Share.
上级 12ecafb3
......@@ -1159,14 +1159,6 @@ mod test {
use std::vec_ng::Vec;
fn is_share<T: Share>() {}
// Assert that the AST remains sharable.
#[test]
fn ast_is_share() {
is_share::<Item>();
}
// are ASTs encodable?
#[test]
fn check_asts_encodable() {
......
......@@ -23,16 +23,13 @@
use std::rc::Rc;
use std::vec_ng::Vec;
#[cfg(stage0)]
use std::kinds::Share;
pub struct Interner<T> {
priv map: RefCell<HashMap<T, Name>>,
priv vect: RefCell<Vec<T> >,
}
// when traits can extend traits, we should extend index<Name,T> to get []
impl<T: Eq + Hash + Share + Clone + 'static> Interner<T> {
impl<T: Eq + Hash + Clone + 'static> Interner<T> {
pub fn new() -> Interner<T> {
Interner {
map: RefCell::new(HashMap::new()),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册