about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexis Beingessner <a.beingessner@gmail.com>2015-08-14 16:53:24 -0700
committerAlexis Beingessner <a.beingessner@gmail.com>2015-08-19 15:52:12 -0700
commit5bbaa3c9ac64cbd324240d6aa079c5d4b0e7f82e (patch)
tree9dae7c0dfc19463c2d1d7a1e1cfc7042804f61ff
parentdfa4bca88932a9503d0600bfa7ca24e6950935e6 (diff)
fallout of reworking rc and arc APIs
-rw-r--r--src/librustc_resolve/build_reduced_graph.rs6
-rw-r--r--src/librustc_resolve/lib.rs2
-rw-r--r--src/librustc_trans/lib.rs2
-rw-r--r--src/librustc_trans/trans/debuginfo/namespace.rs2
-rw-r--r--src/test/run-pass/dst-coerce-rc.rs5
5 files changed, 9 insertions, 8 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs
index aa2eaa866ff..17fb1ee2cb4 100644
--- a/src/librustc_resolve/build_reduced_graph.rs
+++ b/src/librustc_resolve/build_reduced_graph.rs
@@ -258,7 +258,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
     }
 
     fn get_parent_link(&mut self, parent: &Rc<Module>, name: Name) -> ParentLink {
-        ModuleParentLink(parent.downgrade(), name)
+        ModuleParentLink(Rc::downgrade(parent), name)
     }
 
     /// Constructs the reduced graph for one item.
@@ -390,7 +390,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
                 if let Some(crate_id) = self.session.cstore.find_extern_mod_stmt_cnum(item.id) {
                     let def_id = DefId { krate: crate_id, node: 0 };
                     self.external_exports.insert(def_id);
-                    let parent_link = ModuleParentLink(parent.downgrade(), name);
+                    let parent_link = ModuleParentLink(Rc::downgrade(parent), name);
                     let external_module = Rc::new(Module::new(parent_link,
                                                               Some(def_id),
                                                               NormalModuleKind,
@@ -638,7 +638,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
                    block_id);
 
             let new_module = Rc::new(Module::new(
-                BlockParentLink(parent.downgrade(), block_id),
+                BlockParentLink(Rc::downgrade(parent), block_id),
                 None,
                 AnonymousModuleKind,
                 false,
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index da6ece73f79..e5ca4c4c6f0 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -21,11 +21,11 @@
 
 #![feature(associated_consts)]
 #![feature(borrow_state)]
-#![feature(rc_weak)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_private)]
 #![feature(slice_splits)]
 #![feature(staged_api)]
+#![feature(rc_weak)]
 
 #[macro_use] extern crate log;
 #[macro_use] extern crate syntax;
diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs
index 23f21f337f3..b42a37e78dc 100644
--- a/src/librustc_trans/lib.rs
+++ b/src/librustc_trans/lib.rs
@@ -36,13 +36,13 @@
 #![feature(path_relative_from)]
 #![feature(path_relative_from)]
 #![feature(quote)]
-#![feature(rc_weak)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_private)]
 #![feature(staged_api)]
 #![feature(unicode)]
 #![feature(unicode)]
 #![feature(vec_push_all)]
+#![feature(rc_weak)]
 
 #![allow(trivial_casts)]
 
diff --git a/src/librustc_trans/trans/debuginfo/namespace.rs b/src/librustc_trans/trans/debuginfo/namespace.rs
index fa92fb0baae..f294a48b575 100644
--- a/src/librustc_trans/trans/debuginfo/namespace.rs
+++ b/src/librustc_trans/trans/debuginfo/namespace.rs
@@ -109,7 +109,7 @@ pub fn namespace_for_item(cx: &CrateContext, def_id: ast::DefId) -> Rc<Namespace
                     let node = Rc::new(NamespaceTreeNode {
                         name: name,
                         scope: scope,
-                        parent: parent_node.map(|parent| parent.downgrade()),
+                        parent: parent_node.map(|parent| Rc::downgrade(&parent)),
                     });
 
                     debug_context(cx).namespace_map.borrow_mut()
diff --git a/src/test/run-pass/dst-coerce-rc.rs b/src/test/run-pass/dst-coerce-rc.rs
index f147a2dca63..039f4d8fd51 100644
--- a/src/test/run-pass/dst-coerce-rc.rs
+++ b/src/test/run-pass/dst-coerce-rc.rs
@@ -36,7 +36,7 @@ fn main() {
     let b: Rc<Baz> = a.clone();
     assert_eq!(b.get(), 42);
 
-    let c: Weak<i32> = a.downgrade();
+    let c: Weak<i32> = Rc::downgrade(&a);
     let d: Weak<Baz> = c.clone();
 
     let _c = b.clone();
@@ -44,5 +44,6 @@ fn main() {
     let a: Rc<RefCell<i32>> = Rc::new(RefCell::new(42));
     let b: Rc<RefCell<Baz>> = a.clone();
     assert_eq!(b.borrow().get(), 42);
-    let c: Weak<RefCell<Baz>> = a.downgrade();
+    // FIXME
+    let c: Weak<RefCell<Baz>> = Rc::downgrade(&a) as Weak<_>;
 }