Skip to content

Commit b4ed711

Browse files
committed
Remove unnecessary unboxed_closures feature usage
It has been possible to clone closures for a while now
1 parent 5957990 commit b4ed711

File tree

2 files changed

+1
-20
lines changed
  • compiler/rustc_data_structures/src

2 files changed

+1
-20
lines changed

compiler/rustc_data_structures/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#![feature(array_windows)]
1111
#![feature(control_flow_enum)]
1212
#![feature(in_band_lifetimes)]
13-
#![feature(unboxed_closures)]
1413
#![feature(generator_trait)]
15-
#![feature(fn_traits)]
1614
#![feature(min_specialization)]
1715
#![feature(auto_traits)]
1816
#![feature(nll)]

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-18
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl<O: ForestObligation> ObligationForest<O> {
597597
Some(rpos) => {
598598
// Cycle detected.
599599
processor.process_backedge(
600-
stack[rpos..].iter().map(GetObligation(&self.nodes)),
600+
stack[rpos..].iter().map(|&i| &self.nodes[i].obligation),
601601
PhantomData,
602602
);
603603
}
@@ -705,20 +705,3 @@ impl<O: ForestObligation> ObligationForest<O> {
705705
});
706706
}
707707
}
708-
709-
// I need a Clone closure.
710-
#[derive(Clone)]
711-
struct GetObligation<'a, O>(&'a [Node<O>]);
712-
713-
impl<'a, 'b, O> FnOnce<(&'b usize,)> for GetObligation<'a, O> {
714-
type Output = &'a O;
715-
extern "rust-call" fn call_once(self, args: (&'b usize,)) -> &'a O {
716-
&self.0[*args.0].obligation
717-
}
718-
}
719-
720-
impl<'a, 'b, O> FnMut<(&'b usize,)> for GetObligation<'a, O> {
721-
extern "rust-call" fn call_mut(&mut self, args: (&'b usize,)) -> &'a O {
722-
&self.0[*args.0].obligation
723-
}
724-
}

0 commit comments

Comments
 (0)