Remove unnecessary unboxed_closures feature usage

It has been possible to clone closures for a while now
This commit is contained in:
bjorn3 2021-05-31 12:06:54 +02:00
parent 59579907ab
commit b4ed7114bd
2 changed files with 1 additions and 20 deletions

View file

@ -10,9 +10,7 @@
#![feature(array_windows)]
#![feature(control_flow_enum)]
#![feature(in_band_lifetimes)]
#![feature(unboxed_closures)]
#![feature(generator_trait)]
#![feature(fn_traits)]
#![feature(min_specialization)]
#![feature(auto_traits)]
#![feature(nll)]

View file

@ -597,7 +597,7 @@ impl<O: ForestObligation> ObligationForest<O> {
Some(rpos) => {
// Cycle detected.
processor.process_backedge(
stack[rpos..].iter().map(GetObligation(&self.nodes)),
stack[rpos..].iter().map(|&i| &self.nodes[i].obligation),
PhantomData,
);
}
@ -705,20 +705,3 @@ impl<O: ForestObligation> ObligationForest<O> {
});
}
}
// I need a Clone closure.
#[derive(Clone)]
struct GetObligation<'a, O>(&'a [Node<O>]);
impl<'a, 'b, O> FnOnce<(&'b usize,)> for GetObligation<'a, O> {
type Output = &'a O;
extern "rust-call" fn call_once(self, args: (&'b usize,)) -> &'a O {
&self.0[*args.0].obligation
}
}
impl<'a, 'b, O> FnMut<(&'b usize,)> for GetObligation<'a, O> {
extern "rust-call" fn call_mut(&mut self, args: (&'b usize,)) -> &'a O {
&self.0[*args.0].obligation
}
}