1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Regression test for #30104
17 use std::ops::{Deref, DerefMut};
19 fn box_two_field(v: &mut Box<(i32, i32)>) {
24 fn box_destructure(v: &mut Box<(i32, i32)>) {
25 let (ref mut _head, ref mut _tail) = **v;
30 impl<T> Deref for Wrap<T> {
32 fn deref(&self) -> &T {
37 impl<T> DerefMut for Wrap<T> {
38 fn deref_mut(&mut self) -> &mut T {
43 fn smart_two_field(v: &mut Wrap<(i32, i32)>) {
48 fn smart_destructure(v: &mut Wrap<(i32, i32)>) {
49 let (ref mut _head, ref mut _tail) = **v;