Skip to content

Commit 4b1d83c

Browse files
committed
fix deprecated-mode lint warning to consider dtors
1 parent 457e78c commit 4b1d83c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/libcore/task.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,11 @@ enum AncestorList = option<unsafe::Exclusive<AncestorNode>>;
767767

768768
// Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
769769
#[inline(always)]
770-
fn access_group<U>(x: TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U {
770+
fn access_group<U>(x: &TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U {
771771
unsafe { x.with(blk) }
772772
}
773773
#[inline(always)]
774-
fn access_ancestors<U>(x: unsafe::Exclusive<AncestorNode>,
774+
fn access_ancestors<U>(x: &unsafe::Exclusive<AncestorNode>,
775775
blk: fn(x: &mut AncestorNode) -> U) -> U {
776776
unsafe { x.with(blk) }
777777
}
@@ -800,7 +800,7 @@ fn each_ancestor(list: &mut AncestorList,
800800
// Need to swap the list out to use it, to appease borrowck.
801801
let tmp_list = util::replace(list, AncestorList(none));
802802
let (coalesce_this, early_break) =
803-
iterate(tmp_list, bail_opt, forward_blk, last_generation);
803+
iterate(&tmp_list, bail_opt, forward_blk, last_generation);
804804
// What should our next ancestor end up being?
805805
if coalesce_this.is_some() {
806806
// Needed coalesce. Our next ancestor becomes our old
@@ -821,7 +821,7 @@ fn each_ancestor(list: &mut AncestorList,
821821
// bool:
822822
// True if the supplied block did 'break', here or in any recursive
823823
// calls. If so, must call the unwinder on all previous nodes.
824-
fn iterate(ancestors: AncestorList,
824+
fn iterate(ancestors: &AncestorList,
825825
bail_opt: option<fn@(TaskGroupInner)>,
826826
forward_blk: fn(TaskGroupInner) -> bool,
827827
last_generation: uint) -> (option<AncestorList>, bool) {
@@ -836,9 +836,9 @@ fn each_ancestor(list: &mut AncestorList,
836836

837837
// The map defaults to none, because if ancestors is none, we're at
838838
// the end of the list, which doesn't make sense to coalesce.
839-
return do (*ancestors).map_default((none,false)) |ancestor_arc| {
839+
return do (**ancestors).map_default((none,false)) |ancestor_arc| {
840840
// NB: Takes a lock! (this ancestor node)
841-
do access_ancestors(ancestor_arc) |nobe| {
841+
do access_ancestors(&ancestor_arc) |nobe| {
842842
// Check monotonicity
843843
assert last_generation > nobe.generation;
844844
/*##########################################################*
@@ -903,7 +903,7 @@ fn each_ancestor(list: &mut AncestorList,
903903
blk: fn(TaskGroupInner) -> U) -> U {
904904
// If this trips, more likely the problem is 'blk' failed inside.
905905
let tmp_arc = option::swap_unwrap(parent_group);
906-
let result = do access_group(tmp_arc) |tg_opt| { blk(tg_opt) };
906+
let result = do access_group(&tmp_arc) |tg_opt| { blk(tg_opt) };
907907
*parent_group <- some(tmp_arc);
908908
result
909909
}
@@ -934,12 +934,12 @@ struct Tcb {
934934
if rustrt::rust_task_is_unwinding(self.me) {
935935
self.notifier.iter(|x| { x.failed = true; });
936936
// Take everybody down with us.
937-
do access_group(self.tasks) |tg| {
937+
do access_group(&self.tasks) |tg| {
938938
kill_taskgroup(tg, self.me, self.is_main);
939939
}
940940
} else {
941941
// Remove ourselves from the group(s).
942-
do access_group(self.tasks) |tg| {
942+
do access_group(&self.tasks) |tg| {
943943
leave_taskgroup(tg, self.me, true);
944944
}
945945
}
@@ -1080,7 +1080,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
10801080
// it should be enabled only in debug builds.
10811081
let new_generation =
10821082
match *old_ancestors {
1083-
some(arc) => access_ancestors(arc, |a| a.generation+1),
1083+
some(arc) => access_ancestors(&arc, |a| a.generation+1),
10841084
none => 0 // the actual value doesn't really matter.
10851085
};
10861086
assert new_generation < uint::max_value;
@@ -1165,7 +1165,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
11651165
// send something on the notify channel.
11661166
let notifier = notify_chan.map(|c| AutoNotify(c));
11671167

1168-
if enlist_many(child, child_arc, &mut ancestors) {
1168+
if enlist_many(child, &child_arc, &mut ancestors) {
11691169
let group = @Tcb(child, child_arc, ancestors,
11701170
is_main, notifier);
11711171
unsafe { local_set(child, taskgroup_key!(), group); }
@@ -1178,7 +1178,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
11781178
// Set up membership in taskgroup and descendantship in all ancestor
11791179
// groups. If any enlistment fails, some task was already failing, so
11801180
// don't let the child task run, and undo every successful enlistment.
1181-
fn enlist_many(child: *rust_task, child_arc: TaskGroupArc,
1181+
fn enlist_many(child: *rust_task, child_arc: &TaskGroupArc,
11821182
ancestors: &mut AncestorList) -> bool {
11831183
// Join this taskgroup.
11841184
let mut result =

src/rustc/middle/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ fn remove_owned_send(k: kind) -> kind {
15191519
}
15201520
15211521
fn remove_copyable(k: kind) -> kind {
1522-
k - kind_(KIND_MASK_COPY)
1522+
k - kind_(KIND_MASK_COPY | KIND_MASK_DEFAULT_MODE)
15231523
}
15241524
15251525
impl kind: ops::bitand<kind,kind> {

0 commit comments

Comments
 (0)