Closed
Description
This should compile but no longer does:
use std::cell::RefCell;
trait Foo {
fn foo(&self) {}
}
impl<T> Foo for T where T: Clone {}
struct Bar;
impl Bar {
fn foo(&self) {}
}
fn main() {
let b = RefCell::new(Bar);
b.borrow().foo()
}
test.rs:17:5: 17:21 error: the trait `core::clone::Clone` is not implemented for the type `core::cell::Ref<'_,Bar>`
test.rs:17 b.borrow().foo()
^~~~~~~~~~~~~~~~
Note that calling Bar.foo()
directly works.