Optimize RefCell refcount tracking

This commit is contained in:
Joshua Liebow-Feeser 2018-06-27 00:07:18 -07:00
parent 9cc3d44b93
commit 851cc39503
5 changed files with 40 additions and 34 deletions

View file

@ -19,5 +19,5 @@ fn assert<T: UnwindSafe + ?Sized>() {}
fn main() {
assert::<Rc<RefCell<i32>>>();
//~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a
}

View file

@ -19,5 +19,5 @@ fn assert<T: UnwindSafe + ?Sized>() {}
fn main() {
assert::<Arc<RefCell<i32>>>();
//~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a
}

View file

@ -18,5 +18,5 @@ fn assert<T: UnwindSafe + ?Sized>() {}
fn main() {
assert::<&RefCell<i32>>();
//~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a
}

View file

@ -18,5 +18,5 @@ fn assert<T: UnwindSafe + ?Sized>() {}
fn main() {
assert::<*mut RefCell<i32>>();
//~^ ERROR the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<usize>` may contain interior mutability and a
//~| ERROR the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a
}