Closed
Description
Similar to #19128
#![feature(core, unboxed_closures)]
use std::ops::Fn;
#[derive(Clone)]
struct NotCopy;
#[derive(Clone)]
struct Derp {
foo: NotCopy
}
impl Fn<()> for Derp {
type Output = ();
extern "rust-call" fn call(&self, _: ()) {
}
}
fn with_clone<F>(_f: F) where F: Fn() + Clone {
}
fn main() {
let foo = NotCopy;
with_clone(Derp { foo: NotCopy }); // works
with_clone(move || { // errors
let _ = foo; // <- should be like Derp, accessing self.foo
});
}