2 fn tpb(&mut self, _s: Self) {}
17 fn two_phase3(b: bool) {
18 let mut x = &mut vec![];
31 #[allow(unreachable_code)]
33 let x: &mut Vec<i32> = &mut vec![];
35 // Unfortunately this does not trigger the problem of creating a
36 // raw ponter from a pointer that had a two-phase borrow derived from
37 // it because of the implicit &mut reborrow.
38 let raw = x as *mut _;
46 fn two_phase_overlapping1() {
52 fn two_phase_overlapping2() {
53 use std::ops::AddAssign;
59 fn with_interior_mutability() {
63 fn do_the_thing(&mut self, _s: i32) {}
66 impl<T> Thing for Cell<T> {}
68 let mut x = Cell::new(1);
84 with_interior_mutability();
85 two_phase_overlapping1();
86 two_phase_overlapping2();