Skip to content

Commit 5bbaa3c

Browse files
committed
fallout of reworking rc and arc APIs
1 parent dfa4bca commit 5bbaa3c

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/librustc_resolve/build_reduced_graph.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
258258
}
259259

260260
fn get_parent_link(&mut self, parent: &Rc<Module>, name: Name) -> ParentLink {
261-
ModuleParentLink(parent.downgrade(), name)
261+
ModuleParentLink(Rc::downgrade(parent), name)
262262
}
263263

264264
/// Constructs the reduced graph for one item.
@@ -390,7 +390,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
390390
if let Some(crate_id) = self.session.cstore.find_extern_mod_stmt_cnum(item.id) {
391391
let def_id = DefId { krate: crate_id, node: 0 };
392392
self.external_exports.insert(def_id);
393-
let parent_link = ModuleParentLink(parent.downgrade(), name);
393+
let parent_link = ModuleParentLink(Rc::downgrade(parent), name);
394394
let external_module = Rc::new(Module::new(parent_link,
395395
Some(def_id),
396396
NormalModuleKind,
@@ -638,7 +638,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
638638
block_id);
639639

640640
let new_module = Rc::new(Module::new(
641-
BlockParentLink(parent.downgrade(), block_id),
641+
BlockParentLink(Rc::downgrade(parent), block_id),
642642
None,
643643
AnonymousModuleKind,
644644
false,

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
#![feature(associated_consts)]
2323
#![feature(borrow_state)]
24-
#![feature(rc_weak)]
2524
#![feature(rustc_diagnostic_macros)]
2625
#![feature(rustc_private)]
2726
#![feature(slice_splits)]
2827
#![feature(staged_api)]
28+
#![feature(rc_weak)]
2929

3030
#[macro_use] extern crate log;
3131
#[macro_use] extern crate syntax;

src/librustc_trans/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
#![feature(path_relative_from)]
3737
#![feature(path_relative_from)]
3838
#![feature(quote)]
39-
#![feature(rc_weak)]
4039
#![feature(rustc_diagnostic_macros)]
4140
#![feature(rustc_private)]
4241
#![feature(staged_api)]
4342
#![feature(unicode)]
4443
#![feature(unicode)]
4544
#![feature(vec_push_all)]
45+
#![feature(rc_weak)]
4646

4747
#![allow(trivial_casts)]
4848

src/librustc_trans/trans/debuginfo/namespace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn namespace_for_item(cx: &CrateContext, def_id: ast::DefId) -> Rc<Namespace
109109
let node = Rc::new(NamespaceTreeNode {
110110
name: name,
111111
scope: scope,
112-
parent: parent_node.map(|parent| parent.downgrade()),
112+
parent: parent_node.map(|parent| Rc::downgrade(&parent)),
113113
});
114114

115115
debug_context(cx).namespace_map.borrow_mut()

src/test/run-pass/dst-coerce-rc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ fn main() {
3636
let b: Rc<Baz> = a.clone();
3737
assert_eq!(b.get(), 42);
3838

39-
let c: Weak<i32> = a.downgrade();
39+
let c: Weak<i32> = Rc::downgrade(&a);
4040
let d: Weak<Baz> = c.clone();
4141

4242
let _c = b.clone();
4343

4444
let a: Rc<RefCell<i32>> = Rc::new(RefCell::new(42));
4545
let b: Rc<RefCell<Baz>> = a.clone();
4646
assert_eq!(b.borrow().get(), 42);
47-
let c: Weak<RefCell<Baz>> = a.downgrade();
47+
// FIXME
48+
let c: Weak<RefCell<Baz>> = Rc::downgrade(&a) as Weak<_>;
4849
}

0 commit comments

Comments
 (0)