// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // pretty-expanded FIXME #23616 use std::ops::{Deref, DerefMut}; // Generic unique/owned smaht pointer. struct Own { value: *mut T } impl Deref for Own { type Target = T; fn deref<'a>(&'a self) -> &'a T { unsafe { &*self.value } } } impl DerefMut for Own { fn deref_mut<'a>(&'a mut self) -> &'a mut T { unsafe { &mut *self.value } } } struct Point { x: isize, y: isize } impl Point { fn get(&mut self) -> (isize, isize) { (self.x, self.y) } } fn test0(mut x: Own) { let _ = x.get(); } fn test1(mut x: Own>>) { let _ = x.get(); } fn test2(mut x: Own>>) { let _ = (**x).get(); } fn main() {}