use creusot_std::prelude::*;
use std::alloc::Allocator;
use std::rc::Rc;
extern_spec! {
impl<T: ?Sized, A: Allocator> Rc<T, A> {
#[check(terminates)]
#[ensures(match result {
Some(r) => *r == *(*this)@ && *(^this)@ == ^r,
None => ^this == *this,
})]
fn get_mut(this: &mut Rc<T, A>) -> Option<&mut T>;
#[check(terminates)]
fn strong_count(this: &Rc<T, A>) -> usize;
}
impl<T: Clone, A: Allocator> Rc<T, A> {
#[ensures(result == *this@ || T::clone.postcondition((&*this@,), result))]
fn unwrap_or_clone(this: Rc<T, A>) -> T;
}
}