Repository: capnproto/capnproto-rust (language: rust)

Issue:
`.borrow()` on `Builder`s collides badly with `std::borrow::Borrow`
Hey folks! I've been writing a library which uses capnp and also does some nifty stuff with the `std::borrow::Borrow` trait, which has this method `Borrow::borrow`. I imported `Borrow::borrow` at the top of my file and it caused majorly confusing issues with capnp; to make a long story short, for everything I wrote with capnp which was building an object (and using `Builder::borrow`) Rust attempted to resolve the methods as `Borrow::borrow` instead. This resulted in _extremely_ confusing errors such as "attempt to move out of borrowed content" on calling `builder.borrow().get_field()`. I realize it's not possible to reimplement `borrow` in terms of the `Borrow` trait, but it's currently _extremely bad_ trying to `use std::borrow::Borrow;` at the top of a file and also do something with `Builder` which requires `Builder::borrow`. I've localized all my `use` statements for `Borrow::borrow` and it's quite nasty.

I realize a name change would unfortunately be a pretty bad breaking change, but I just want to put the possibility out there. Colliding with a useful, bread-and-butter (for me, at least) stdlib trait in this nasty way seems Not Good. I don't really have any other solutions to suggest though.


Discussion / hints:
Looks like we're colliding with `impl<'a, T: ?Sized> Borrow<T> for &'a T`. My understanding is that `rustc` usually prefers an inherent method over a trait method, but unfortunately in this case the trait method wins because it doesn't need a deref conversion. The rules are documented here: https://github.com/rust-lang-nursery/reference/blob/86b7c821e16c9e3e78897d6193314ca88a87e2f1/src/expressions/method-call-expr.md

Probably `reborrow()` would be a better name for our inherent method.

Note that there has been some discussion about adding reborrow support to the language: https://github.com/rust-lang/rfcs/issues/1403

Fix patch:
diff --git a/benchmark/carsales.rs b/benchmark/carsales.rs
index 745e087f8..4f8cce5bc 100644
--- a/benchmark/carsales.rs
+++ b/benchmark/carsales.rs
@@ -33,28 +33,28 @@ macro_rules! car_value_impl(
                 fn car_value (mut self) -> ::capnp::Result<u64> {
                     #![allow(unused_mut)]
                     let mut result : u64 = 0;
-                    result += self.borrow().get_seats() as u64 * 200;
-                    result += self.borrow().get_doors() as u64 * 350;
+                    result += self.reborrow().get_seats() as u64 * 200;
+                    result += self.reborrow().get_doors() as u64 * 350;
 
                     // Using an iterator here slows things down considerably.
                     // TODO: investigate why.
                     {
-                        let mut wheels = try!(self.borrow().get_wheels());
+                        let mut wheels = try!(self.reborrow().get_wheels());
                         for ii in 0..wheels.len() {
-                            let mut wheel = wheels.borrow().get(ii);
-                            result += wheel.borrow().get_diameter() as u64 * wheel.borrow().get_diameter() as u64;
-                            result += if wheel.borrow().get_snow_tires() { 100 } else { 0 };
+                            let mut wheel = wheels.reborrow().get(ii);
+                            result += wheel.reborrow().get_diameter() as u64 * wheel.reborrow().get_diameter() as u64;
+                            result += if wheel.reborrow().get_snow_tires() { 100 } else { 0 };
                         }
                     }
 
-                    result += self.borrow().get_length() as u64 *
-                        self.borrow().get_width() as u64 * self.borrow().get_height() as u64 / 50;
+                    result += self.reborrow().get_length() as u64 *
+                        self.reborrow().get_width() as u64 * self.reborrow().get_height() as u64 / 50;
 
                     {
-                        let mut engine = try!(self.borrow().get_engine());
-                        result += engine.borrow().get_horsepower() as u64 * 40;
-                        if engine.borrow().get_uses_electric() {
-                            if engine.borrow().get_uses_gas() {
+                        let mut engine = try!(self.reborrow().get_engine());
+                        result += engine.reborrow().get_horsepower() as u64 * 40;
+                        if engine.reborrow().get_uses_electric() {
+                            if engine.reborrow().get_uses_gas() {
                                 //# hybrid
                                 result += 5000;
                             } else {
@@ -63,12 +63,12 @@ macro_rules! car_value_impl(
                         }
                     }
 
-                    result += if self.borrow().get_has_power_windows() { 100 } else { 0 };
-                    result += if self.borrow().get_has_power_steering() { 200 } else { 0 };
-                    result += if self.borrow().get_has_cruise_control() { 400 } else { 0 };
-                    result += if self.borrow().get_has_nav_system() { 2000 } else { 0 };
+                    result += if self.reborrow().get_has_power_windows() { 100 } else { 0 };
+                    result += if self.reborrow().get_has_power_steering() { 200 } else { 0 };
+                    result += if self.reborrow().get_has_cruise_control() { 400 } else { 0 };
+                    result += if self.reborrow().get_has_nav_system() { 2000 } else { 0 };
 
-                    result += self.borrow().get_cup_holders() as u64 * 25;
+                    result += self.reborrow().get_cup_holders() as u64 * 25;
 
                     Ok(result)
                 }
@@ -93,9 +93,9 @@ pub fn random_car(rng: &mut FastRand, mut car: car::Builder) {
     car.set_doors(2 + rng.next_less_than(3) as u8);
 
     {
-        let mut wheels = car.borrow().init_wheels(4);
+        let mut wheels = car.reborrow().init_wheels(4);
         for ii in 0..wheels.len() {
-            let mut wheel = wheels.borrow().get(ii);
+            let mut wheel = wheels.reborrow().get(ii);
             wheel.set_diameter(25 + rng.next_less_than(15) as u16);
             wheel.set_air_pressure((30.0 + rng.next_double(20.0)) as f32);
             wheel.set_snow_tires(rng.next_less_than(16) == 0);
@@ -111,7 +111,7 @@ pub fn random_car(rng: &mut FastRand, mut car: car::Builder) {
     car.set_weight(length as u32 * width as u32 * height as u32 / 200);
 
     {
-        let mut engine = car.borrow().init_engine();
+        let mut engine = car.reborrow().init_engine();
         engine.set_horsepower(100 * rng.next_less_than(400) as u16);
         engine.set_cylinders(4 + 2 * rng.next_less_than(3) as u8);
         engine.set_cc(800 + rng.next_less_than(10000));
@@ -140,8 +140,8 @@ impl ::TestCase for CarSales {
         let mut result = 0;
         let mut cars = request.init_cars(rng.next_less_than(200));
         for ii in 0.. cars.len() {
-            let mut car = cars.borrow().get(ii);
-            random_car(rng, car.borrow());
+            let mut car = cars.reborrow().get(ii);
+            random_car(rng, car.reborrow());
             result += car.car_value().unwrap();
         }
 
diff --git a/benchmark/catrank.rs b/benchmark/catrank.rs
index e2d0cc18b..93e7bab48 100644
--- a/benchmark/catrank.rs
+++ b/benchmark/catrank.rs
@@ -44,13 +44,13 @@ impl ::TestCase for CatRank {
         let mut list = request.init_results(count);
 
         for i in 0..count {
-            let mut result = list.borrow().get(i);
+            let mut result = list.reborrow().get(i);
             result.set_score(1000.0 - i as f64);
             let url_size = rng.next_less_than(100);
 
             let url_prefix_length = URL_PREFIX.as_bytes().len();
             {
-                let mut url = result.borrow().init_url(url_size + url_prefix_length as u32);
+                let mut url = result.reborrow().init_url(url_size + url_prefix_length as u32);
 
                 url.push_str(URL_PREFIX);
                 for _ in 0..url_size {
@@ -109,7 +109,7 @@ impl ::TestCase for CatRank {
 
         let mut list = response.init_results(scored_results.len() as u32);
         for i in 0..list.len() {
-            let mut item = list.borrow().get(i);
+            let mut item = list.reborrow().get(i);
             let result = scored_results[i as usize];
             item.set_score(result.score);
             item.set_url(try!(result.result.get_url()));
diff --git a/benchmark/eval.rs b/benchmark/eval.rs
index 6ae05a3aa..e7a266378 100644
--- a/benchmark/eval.rs
+++ b/benchmark/eval.rs
@@ -29,19 +29,19 @@ fn make_expression(rng: &mut FastRand, mut exp: expression::Builder, depth : u32
     let left : i32 =
     if rng.next_less_than(8) < depth {
         let tmp = (rng.next_less_than(128) + 1) as i32;
-        exp.borrow().get_left().set_value(tmp);
+        exp.reborrow().get_left().set_value(tmp);
         tmp
     } else {
-        make_expression(rng, exp.borrow().get_left().init_expression(), depth + 1)
+        make_expression(rng, exp.reborrow().get_left().init_expression(), depth + 1)
     };
 
     let right : i32 =
     if rng.next_less_than(8) < depth {
         let tmp = (rng.next_less_than(128) + 1) as i32;
-        exp.borrow().get_right().set_value(tmp);
+        exp.reborrow().get_right().set_value(tmp);
         tmp
     } else {
-        make_expression(rng, exp.borrow().get_right().init_expression(), depth + 1)
+        make_expression(rng, exp.reborrow().get_right().init_expression(), depth + 1)
     };
 
     match exp.get_op().unwrap() {
diff --git a/capnp-rpc/examples/calculator/client.rs b/capnp-rpc/examples/calculator/client.rs
index d46b936f3..d8d4ed7bf 100644
--- a/capnp-rpc/examples/calculator/client.rs
+++ b/capnp-rpc/examples/calculator/client.rs
@@ -129,12 +129,12 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             let mut subtract_call = request.get().init_expression().init_call();
             subtract_call.set_function(subtract);
             let mut subtract_params = subtract_call.init_params(2);
-            subtract_params.borrow().get(1).set_literal(67.0);
+            subtract_params.reborrow().get(1).set_literal(67.0);
 
             let mut add_call = subtract_params.get(0).init_call();
             add_call.set_function(add);
             let mut add_params = add_call.init_params(2);
-            add_params.borrow().get(0).set_literal(123.0);
+            add_params.reborrow().get(0).set_literal(123.0);
             add_params.get(1).set_literal(45.0);
         }
 
@@ -181,8 +181,8 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             let mut multiply_call = request.get().init_expression().init_call();
             multiply_call.set_function(multiply);
             let mut multiply_params = multiply_call.init_params(2);
-            multiply_params.borrow().get(0).set_literal(4.0);
-            multiply_params.borrow().get(1).set_literal(6.0);
+            multiply_params.reborrow().get(0).set_literal(4.0);
+            multiply_params.reborrow().get(1).set_literal(6.0);
         }
 
         let multiply_result = request.send().pipeline.get_value();
@@ -193,8 +193,8 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             let mut add3_call = add3_request.get().init_expression().init_call();
             add3_call.set_function(add.clone());
             let mut add3_params = add3_call.init_params(2);
-            add3_params.borrow().get(0).set_previous_result(multiply_result.clone());
-            add3_params.borrow().get(1).set_literal(3.0);
+            add3_params.reborrow().get(0).set_previous_result(multiply_result.clone());
+            add3_params.reborrow().get(1).set_literal(3.0);
         }
 
         let add3_promise = add3_request.send().pipeline.get_value().read_request().send();
@@ -204,7 +204,7 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             let mut add5_call = add5_request.get().init_expression().init_call();
             add5_call.set_function(add);
             let mut add5_params = add5_call.init_params(2);
-            add5_params.borrow().get(0).set_previous_result(multiply_result);
+            add5_params.reborrow().get(0).set_previous_result(multiply_result);
             add5_params.get(1).set_literal(5.0);
         }
 
@@ -251,12 +251,12 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
                     let mut add_call = def_function_params.init_body().init_call();
                     add_call.set_function(add.clone());
                     let mut add_params = add_call.init_params(2);
-                    add_params.borrow().get(1).set_parameter(1);
+                    add_params.reborrow().get(1).set_parameter(1);
 
                     let mut multiply_call = add_params.get(0).init_call();
                     multiply_call.set_function(multiply.clone());
                     let mut multiply_params = multiply_call.init_params(2);
-                    multiply_params.borrow().get(0).set_parameter(0);
+                    multiply_params.reborrow().get(0).set_parameter(0);
                     multiply_params.get(1).set_literal(100.0);
                 }
             }
@@ -272,17 +272,17 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
                     let mut multiply_call = def_function_params.init_body().init_call();
                     multiply_call.set_function(multiply);
                     let mut multiply_params = multiply_call.init_params(2);
-                    multiply_params.borrow().get(1).set_literal(2.0);
+                    multiply_params.reborrow().get(1).set_literal(2.0);
 
                     let mut f_call = multiply_params.get(0).init_call();
                     f_call.set_function(f.clone());
                     let mut f_params = f_call.init_params(2);
-                    f_params.borrow().get(0).set_parameter(0);
+                    f_params.reborrow().get(0).set_parameter(0);
 
                     let mut add_call = f_params.get(1).init_call();
                     add_call.set_function(add);
                     let mut add_params = add_call.init_params(2);
-                    add_params.borrow().get(0).set_parameter(0);
+                    add_params.reborrow().get(0).set_parameter(0);
                     add_params.get(1).set_literal(1.0);
                 }
             }
@@ -294,7 +294,7 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             let mut f_call = f_eval_request.get().init_expression().init_call();
             f_call.set_function(f);
             let mut f_params = f_call.init_params(2);
-            f_params.borrow().get(0).set_literal(12.0);
+            f_params.reborrow().get(0).set_literal(12.0);
             f_params.get(1).set_literal(34.0);
         }
         let f_eval_promise = f_eval_request.send().pipeline.get_value().read_request().send();
@@ -342,12 +342,12 @@ fn try_main(args: Vec<String>) -> Result<(), ::capnp::Error> {
             pow_call.set_function(
                 calculator::function::ToClient::new(PowerFunction).from_server::<::capnp_rpc::Server>());
             let mut pow_params = pow_call.init_params(2);
-            pow_params.borrow().get(0).set_literal(2.0);
+            pow_params.reborrow().get(0).set_literal(2.0);
 
             let mut add_call = pow_params.get(1).init_call();
             add_call.set_function(add);
             let mut add_params = add_call.init_params(2);
-            add_params.borrow().get(0).set_literal(4.0);
+            add_params.reborrow().get(0).set_literal(4.0);
             add_params.get(1).set_literal(5.0);
         }
 
diff --git a/capnp-rpc/src/rpc.rs b/capnp-rpc/src/rpc.rs
index 4c942ba87..ed2c2ca34 100644
--- a/capnp-rpc/src/rpc.rs
+++ b/capnp-rpc/src/rpc.rs
@@ -724,7 +724,7 @@ impl <VatId> ConnectionState<VatId> {
                         let mut cap_table = Vec::new();
                         let mut payload = ret.init_results();
                         {
-                            let mut content = payload.borrow().get_content();
+                            let mut content = payload.reborrow().get_content();
                             content.imbue_mut(&mut cap_table);
                             content.set_as_capability(cap);
                         }
@@ -943,7 +943,7 @@ impl <VatId> ConnectionState<VatId> {
                                     {
                                         let root: message::Builder = try!(message.get_body()).init_as();
                                         let mut disembargo = root.init_disembargo();
-                                        disembargo.borrow().init_context().set_receiver_loopback(embargo_id);
+                                        disembargo.reborrow().init_context().set_receiver_loopback(embargo_id);
 
                                         let redirect = match Client::from_ptr(target.get_ptr(),
                                                                               &connection_state_ref1) {
@@ -1382,7 +1382,7 @@ impl <VatId> ConnectionState<VatId> {
             match cap_table[idx] {
                 Some(ref cap) => {
                     match ConnectionState::write_descriptor(state, cap,
-                                                            cap_table_builder.borrow().get(idx as u32)).unwrap() {
+                                                            cap_table_builder.reborrow().get(idx as u32)).unwrap() {
                         Some(export_id) => {
                             exports.push(export_id);
                         }
@@ -1390,7 +1390,7 @@ impl <VatId> ConnectionState<VatId> {
                     }
                 }
                 None => {
-                    cap_table_builder.borrow().get(idx as u32).set_none(());
+                    cap_table_builder.reborrow().get(idx as u32).set_none(());
                 }
             }
         }
@@ -1721,7 +1721,7 @@ impl <VatId> Request<VatId> where VatId: 'static {
         {
             let mut call_builder: call::Builder = get_call(&mut message).unwrap();
             // Finish and send.
-            call_builder.borrow().set_question_id(question_id);
+            call_builder.reborrow().set_question_id(question_id);
             if is_tail_call {
                 call_builder.get_send_results_to().set_yourself(());
             }
@@ -1769,8 +1769,8 @@ impl <VatId> RequestHook for Request<VatId> {
                 // Whoops, this capability has been redirected while we were building the request!
                 // We'll have to make a new request and do a copy.  Ick.
                 let mut call_builder: call::Builder = get_call(&mut message).unwrap();
-                let mut replacement = redirect.new_call(call_builder.borrow().get_interface_id(),
-                                                        call_builder.borrow().get_method_id(), None);
+                let mut replacement = redirect.new_call(call_builder.reborrow().get_interface_id(),
+                                                        call_builder.reborrow().get_method_id(), None);
 
                 replacement.set(call_builder.get_params().unwrap().get_content().as_reader()).unwrap();
                 replacement.send()
@@ -2288,7 +2288,7 @@ impl ResultsDone {
                                             ret.set_answer_id(answer_id);
                                             ret.set_release_param_caps(false);
                                             let mut exc = ret.init_exception();
-                                            from_error(&e, exc.borrow());
+                                            from_error(&e, exc.reborrow());
                                         }
                                         let _ = message.send();
                                     }
@@ -2582,7 +2582,7 @@ impl <VatId> PromiseClient<VatId> {
             {
                 let root: message::Builder = message.get_body().unwrap().init_as();
                 let mut disembargo = root.init_disembargo();
-                disembargo.borrow().init_context().set_sender_loopback(embargo_id);
+                disembargo.reborrow().init_context().set_sender_loopback(embargo_id);
                 let target = disembargo.init_target();
 
                 let redirect = connection_state.write_target(&*self.cap, target);
@@ -2723,7 +2723,7 @@ impl <VatId> Client<VatId> {
                 for idx in 0 .. pipeline_client.borrow().ops.len() {
                     match pipeline_client.borrow().ops[idx] {
                         ::capnp::private::capability::PipelineOp::GetPointerField(ordinal) => {
-                            transform.borrow().get(idx as u32).set_get_pointer_field(ordinal);
+                            transform.reborrow().get(idx as u32).set_get_pointer_field(ordinal);
                         }
                         _ => {}
                     }
@@ -2755,7 +2755,7 @@ impl <VatId> Client<VatId> {
                 for idx in 0 .. pipeline_client.borrow().ops.len() {
                     match pipeline_client.borrow().ops[idx] {
                         ::capnp::private::capability::PipelineOp::GetPointerField(ordinal) => {
-                            transform.borrow().get(idx as u32).set_get_pointer_field(ordinal);
+                            transform.reborrow().get(idx as u32).set_get_pointer_field(ordinal);
                         }
                         _ => {}
                     }
diff --git a/capnp/src/any_pointer.rs b/capnp/src/any_pointer.rs
index 1cc921bd1..8162c8858 100644
--- a/capnp/src/any_pointer.rs
+++ b/capnp/src/any_pointer.rs
@@ -125,10 +125,15 @@ impl <'a> Builder<'a> {
         Builder { builder: builder }
     }
 
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b> {
         Builder { builder: self.builder.borrow() }
     }
 
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b> {
+        Builder { builder: self.builder.borrow() }
+    }
+
     pub fn is_null(&self) -> bool {
         self.builder.is_null()
     }
diff --git a/capnp/src/capability_list.rs b/capnp/src/capability_list.rs
index f20e176f1..1093c2bfb 100644
--- a/capnp/src/capability_list.rs
+++ b/capnp/src/capability_list.rs
@@ -64,9 +64,14 @@ impl <'a, T> Reader<'a, T> where T: FromClientHook {
 
 
 impl <'a, T> Reader<'a, T> where T: FromClientHook {
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b self) -> Reader<'b, T>  {
         Reader { reader: self.reader, marker: PhantomData }
     }
+
+    pub fn reborrow<'b>(&'b self) -> Reader<'b, T>  {
+        Reader { reader: self.reader, marker: PhantomData }
+    }
 }
 
 impl <'a, T> FromPointerReader<'a> for Reader<'a, T> where T: FromClientHook {
@@ -115,9 +120,14 @@ impl <'a, T> Builder<'a, T> where T: FromClientHook {
 }
 
 impl <'a, T> Builder<'a, T> where T: FromClientHook {
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b, T> {
         Builder { builder: self.builder, marker: PhantomData }
     }
+
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b, T> {
+        Builder { builder: self.builder, marker: PhantomData }
+    }
 }
 
 impl <'a, T> FromPointerBuilder<'a> for Builder<'a, T> where T: FromClientHook {
diff --git a/capnp/src/data_list.rs b/capnp/src/data_list.rs
index c100b1faf..4ea5a3071 100644
--- a/capnp/src/data_list.rs
+++ b/capnp/src/data_list.rs
@@ -90,9 +90,14 @@ impl <'a> Builder<'a> {
         self.builder.borrow().get_pointer_element(index).set_data(value);
     }
 
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b> {
         Builder {builder: self.builder.borrow()}
     }
+
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b> {
+        Builder {builder: self.builder.borrow()}
+    }
 }
 
 
diff --git a/capnp/src/enum_list.rs b/capnp/src/enum_list.rs
index 804e49e8d..908f9557a 100644
--- a/capnp/src/enum_list.rs
+++ b/capnp/src/enum_list.rs
@@ -117,6 +117,10 @@ impl <'a, T : ToU16 + FromU16>  Builder<'a, T> {
         let result: u16 = PrimitiveElement::get_from_builder(&self.builder, index);
         FromU16::from_u16(result)
     }
+
+    pub fn reborrow<'b>(&'b self) -> Builder<'b, T> {
+        Builder { .. *self }
+    }
 }
 
 impl <'a, T> ::traits::SetPointerBuilder<Builder<'a, T>> for Reader<'a, T> {
diff --git a/capnp/src/list_list.rs b/capnp/src/list_list.rs
index 115193142..9e1046bf6 100644
--- a/capnp/src/list_list.rs
+++ b/capnp/src/list_list.rs
@@ -104,9 +104,14 @@ impl <'a, T> Builder<'a, T> where T: for<'b> ::traits::Owned<'b> {
 }
 
 impl <'a, T> Builder<'a, T> where T: for<'b> ::traits::Owned<'b> {
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b, T> {
         Builder {builder: self.builder.borrow(), marker: ::std::marker::PhantomData}
     }
+
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b, T> {
+        Builder {builder: self.builder.borrow(), marker: ::std::marker::PhantomData}
+    }
 }
 
 impl <'a, T> FromPointerBuilder<'a> for Builder<'a, T> where T: for<'b> ::traits::Owned<'b> {
diff --git a/capnp/src/primitive_list.rs b/capnp/src/primitive_list.rs
index 26695f757..4571ab004 100644
--- a/capnp/src/primitive_list.rs
+++ b/capnp/src/primitive_list.rs
@@ -117,6 +117,10 @@ impl <'a, T : PrimitiveElement> Builder<'a, T> {
         assert!(index < self.len());
         PrimitiveElement::get_from_builder(&self.builder, index)
     }
+
+    pub fn reborrow<'b>(&'b self) -> Builder<'b, T> {
+        Builder { .. *self }
+    }
 }
 
 impl <'a, T> ::traits::SetPointerBuilder<Builder<'a, T>> for Reader<'a, T>
diff --git a/capnp/src/struct_list.rs b/capnp/src/struct_list.rs
index 043fe887c..0065e0636 100644
--- a/capnp/src/struct_list.rs
+++ b/capnp/src/struct_list.rs
@@ -64,7 +64,12 @@ impl <'a, T> Reader<'a, T> where T: for<'b> ::traits::OwnedStruct<'b> {
 }
 
 impl <'a, T> Reader<'a, T> where T: for<'b> ::traits::OwnedStruct<'b> {
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b self) -> Reader<'b, T>  {
+        self.reborrow()
+    }
+
+    pub fn reborrow<'b>(&'b self) -> Reader<'b, T>  {
         Reader { reader: self.reader, marker: PhantomData }
     }
 }
@@ -114,9 +119,15 @@ impl <'a, T> Builder<'a, T> where T: for<'b> ::traits::OwnedStruct<'b> {
 }
 
 impl <'a, T> Builder<'a, T> where T: for<'b> ::traits::OwnedStruct<'b> {
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b, T> {
+        self.reborrow()
+    }
+
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b, T> {
         Builder { builder: self.builder, marker: PhantomData }
     }
+
 }
 
 impl <'a, T> FromPointerBuilder<'a> for Builder<'a, T> where T: for<'b> ::traits::OwnedStruct<'b> {
diff --git a/capnp/src/text_list.rs b/capnp/src/text_list.rs
index ffb637c60..c6dde76b5 100644
--- a/capnp/src/text_list.rs
+++ b/capnp/src/text_list.rs
@@ -90,9 +90,14 @@ impl <'a> Builder<'a> {
         Reader { reader: self.builder.as_reader() }
     }
 
+    #[deprecated(since = "0.8.17", note = "use reborrow() instead")]
     pub fn borrow<'b>(&'b mut self) -> Builder<'b> {
         Builder::<'b> { builder: self.builder.borrow() }
     }
+
+    pub fn reborrow<'b>(&'b mut self) -> Builder<'b> {
+        Builder::<'b> { builder: self.builder.borrow() }
+    }
 }
 
 
diff --git a/capnpc/src/codegen.rs b/capnpc/src/codegen.rs
index f8e924b78..e01e2c60a 100644
--- a/capnpc/src/codegen.rs
+++ b/capnpc/src/codegen.rs
@@ -1234,10 +1234,15 @@ fn generate_node(gen: &GeneratorContext,
                 Line(format!("impl <'a,{0}> Reader<'a,{0}> {1} {{", params.params, params.where_clause)),
                 Indent(
                     Box::new(Branch(vec![
+                        Line("#[deprecated(since = \"0.8.9\", note = \"use reborrow() instead\")]".to_string()),
                         Line(format!("pub fn borrow<'b>(&'b self) -> Reader<'b,{}> {{",params.params)),
                         Indent(Box::new(Line("Reader { .. *self }".to_string()))),
                         Line("}".to_string()),
                         BlankLine,
+                        Line(format!("pub fn reborrow<'b>(&'b self) -> Reader<'b,{}> {{",params.params)),
+                        Indent(Box::new(Line("Reader { .. *self }".to_string()))),
+                        Line("}".to_string()),
+                        BlankLine,
                         Line("pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {".to_string()),
                         Indent(Box::new(Line("self.reader.total_size()".to_string()))),
                         Line("}".to_string())]))),
@@ -1298,12 +1303,20 @@ fn generate_node(gen: &GeneratorContext,
                         Line(format!("pub fn as_reader(self) -> Reader<'a,{}> {{", params.params)),
                         Indent(Box::new(Line("::capnp::traits::FromStructReader::new(self.builder.as_reader())".to_string()))),
                         Line("}".to_string()),
+                        Line("#[deprecated(since = \"0.8.9\", note = \"use reborrow() instead\")]".to_string()),
                         Line(format!("pub fn borrow<'b>(&'b mut self) -> Builder<'b,{}> {{", params.params)),
                         Indent(Box::new(Line("Builder { .. *self }".to_string()))),
                         Line("}".to_string()),
+                        Line(format!("pub fn reborrow<'b>(&'b mut self) -> Builder<'b,{}> {{", params.params)),
+                        Indent(Box::new(Line("Builder { .. *self }".to_string()))),
+                        Line("}".to_string()),
+                        Line("#[deprecated(since = \"0.8.9\", note = \"use reborrow_as_reader() instead\")]".to_string()),
                         Line(format!("pub fn borrow_as_reader<'b>(&'b self) -> Reader<'b,{}> {{", params.params)),
                         Indent(Box::new(Line("::capnp::traits::FromStructReader::new(self.builder.as_reader())".to_string()))),
                         Line("}".to_string()),
+                        Line(format!("pub fn reborrow_as_reader<'b>(&'b self) -> Reader<'b,{}> {{", params.params)),
+                        Indent(Box::new(Line("::capnp::traits::FromStructReader::new(self.builder.as_reader())".to_string()))),
+                        Line("}".to_string()),
 
                         BlankLine,
                         Line("pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {".to_string()),
diff --git a/example/addressbook/addressbook.rs b/example/addressbook/addressbook.rs
index f16b9900f..cbe5dac84 100644
--- a/example/addressbook/addressbook.rs
+++ b/example/addressbook/addressbook.rs
@@ -36,14 +36,14 @@ pub mod addressbook {
             let mut people = address_book.init_people(2);
 
             {
-                let mut alice = people.borrow().get(0);
+                let mut alice = people.reborrow().get(0);
                 alice.set_id(123);
                 alice.set_name("Alice");
                 alice.set_email("alice@example.com");
                 {
-                    let mut alice_phones = alice.borrow().init_phones(1);
-                    alice_phones.borrow().get(0).set_number("555-1212");
-                    alice_phones.borrow().get(0).set_type(person::phone_number::Type::Mobile);
+                    let mut alice_phones = alice.reborrow().init_phones(1);
+                    alice_phones.reborrow().get(0).set_number("555-1212");
+                    alice_phones.reborrow().get(0).set_type(person::phone_number::Type::Mobile);
                 }
                 alice.get_employment().set_school("MIT");
             }
@@ -54,11 +54,11 @@ pub mod addressbook {
                 bob.set_name("Bob");
                 bob.set_email("bob@example.com");
                 {
-                    let mut bob_phones = bob.borrow().init_phones(2);
-                    bob_phones.borrow().get(0).set_number("555-4567");
-                    bob_phones.borrow().get(0).set_type(person::phone_number::Type::Home);
-                    bob_phones.borrow().get(1).set_number("555-7654");
-                    bob_phones.borrow().get(1).set_type(person::phone_number::Type::Work);
+                    let mut bob_phones = bob.reborrow().init_phones(2);
+                    bob_phones.reborrow().get(0).set_number("555-4567");
+                    bob_phones.reborrow().get(0).set_type(person::phone_number::Type::Home);
+                    bob_phones.reborrow().get(1).set_number("555-7654");
+                    bob_phones.reborrow().get(1).set_type(person::phone_number::Type::Work);
                 }
                 bob.get_employment().set_unemployed(());
             }
diff --git a/example/addressbook_send/addressbook_send.rs b/example/addressbook_send/addressbook_send.rs
index 352b9052c..265100ad6 100644
--- a/example/addressbook_send/addressbook_send.rs
+++ b/example/addressbook_send/addressbook_send.rs
@@ -40,14 +40,14 @@ pub mod addressbook {
             let mut people = address_book.init_people(2);
 
             {
-                let mut alice = people.borrow().get(0);
+                let mut alice = people.reborrow().get(0);
                 alice.set_id(123);
                 alice.set_name("Alice");
                 alice.set_email("alice@example.com");
                 {
-                    let mut alice_phones = alice.borrow().init_phones(1);
-                    alice_phones.borrow().get(0).set_number("555-1212");
-                    alice_phones.borrow().get(0).set_type(person::phone_number::Type::Mobile);
+                    let mut alice_phones = alice.reborrow().init_phones(1);
+                    alice_phones.reborrow().get(0).set_number("555-1212");
+                    alice_phones.reborrow().get(0).set_type(person::phone_number::Type::Mobile);
                 }
                 alice.get_employment().set_school("MIT");
             }
@@ -58,11 +58,11 @@ pub mod addressbook {
                 bob.set_name("Bob");
                 bob.set_email("bob@example.com");
                 {
-                    let mut bob_phones = bob.borrow().init_phones(2);
-                    bob_phones.borrow().get(0).set_number("555-4567");
-                    bob_phones.borrow().get(0).set_type(person::phone_number::Type::Home);
-                    bob_phones.borrow().get(1).set_number("555-7654");
-                    bob_phones.borrow().get(1).set_type(person::phone_number::Type::Work);
+                    let mut bob_phones = bob.reborrow().init_phones(2);
+                    bob_phones.reborrow().get(0).set_number("555-4567");
+                    bob_phones.reborrow().get(0).set_type(person::phone_number::Type::Home);
+                    bob_phones.reborrow().get(1).set_number("555-7654");
+                    bob_phones.reborrow().get(1).set_type(person::phone_number::Type::Work);
                 }
                 bob.get_employment().set_unemployed(());
             }


Test patch:
diff --git a/capnp-futures/test/test.rs b/capnp-futures/test/test.rs
index c29c145d9..0106824a9 100644
--- a/capnp-futures/test/test.rs
+++ b/capnp-futures/test/test.rs
@@ -36,14 +36,14 @@ mod tests {
     fn populate_address_book(address_book: address_book::Builder) {
         let mut people = address_book.init_people(2);
         {
-            let mut alice = people.borrow().get(0);
+            let mut alice = people.reborrow().get(0);
             alice.set_id(123);
             alice.set_name("Alice");
             alice.set_email("alice@example.com");
             {
-                let mut alice_phones = alice.borrow().init_phones(1);
-                alice_phones.borrow().get(0).set_number("555-1212");
-                alice_phones.borrow().get(0).set_type(person::phone_number::Type::Mobile);
+                let mut alice_phones = alice.reborrow().init_phones(1);
+                alice_phones.reborrow().get(0).set_number("555-1212");
+                alice_phones.reborrow().get(0).set_type(person::phone_number::Type::Mobile);
             }
             alice.get_employment().set_school("MIT");
         }
@@ -54,11 +54,11 @@ mod tests {
             bob.set_name("Bob");
             bob.set_email("bob@example.com");
             {
-                let mut bob_phones = bob.borrow().init_phones(2);
-                bob_phones.borrow().get(0).set_number("555-4567");
-                bob_phones.borrow().get(0).set_type(person::phone_number::Type::Home);
-                bob_phones.borrow().get(1).set_number("555-7654");
-                bob_phones.borrow().get(1).set_type(person::phone_number::Type::Work);
+                let mut bob_phones = bob.reborrow().init_phones(2);
+                bob_phones.reborrow().get(0).set_number("555-4567");
+                bob_phones.reborrow().get(0).set_type(person::phone_number::Type::Home);
+                bob_phones.reborrow().get(1).set_number("555-7654");
+                bob_phones.reborrow().get(1).set_type(person::phone_number::Type::Work);
             }
             bob.get_employment().set_unemployed(());
         }
diff --git a/capnp-rpc/test/test_util.rs b/capnp-rpc/test/test_util.rs
index c629d30b8..d25555711 100644
--- a/capnp-rpc/test/test_util.rs
+++ b/capnp-rpc/test/test_util.rs
@@ -38,7 +38,7 @@ pub fn init_test_message(mut builder: test_all_types::Builder) {
     builder.set_text_field("foo");
     builder.set_data_field(b"bar");
     {
-        let mut sub_builder = builder.borrow().init_struct_field();
+        let mut sub_builder = builder.reborrow().init_struct_field();
         sub_builder.set_void_field(());
         sub_builder.set_bool_field(true);
         sub_builder.set_int8_field(-12);
@@ -54,15 +54,15 @@ pub fn init_test_message(mut builder: test_all_types::Builder) {
         sub_builder.set_text_field("baz");
         sub_builder.set_data_field(b"qux");
         {
-            let mut sub_sub_builder = sub_builder.borrow().init_struct_field();
+            let mut sub_sub_builder = sub_builder.reborrow().init_struct_field();
             sub_sub_builder.set_text_field("nested");
             sub_sub_builder.init_struct_field().set_text_field("really nested");
         }
         sub_builder.set_enum_field(TestEnum::Baz);
 
-        sub_builder.borrow().init_void_list(3);
+        sub_builder.reborrow().init_void_list(3);
         {
-            let mut bool_list = sub_builder.borrow().init_bool_list(5);
+            let mut bool_list = sub_builder.reborrow().init_bool_list(5);
             bool_list.set(0, false);
             bool_list.set(1, true);
             bool_list.set(2, false);
@@ -70,28 +70,28 @@ pub fn init_test_message(mut builder: test_all_types::Builder) {
             bool_list.set(4, true);
         }
         {
-            let mut int8_list = sub_builder.borrow().init_int8_list(4);
+            let mut int8_list = sub_builder.reborrow().init_int8_list(4);
             int8_list.set(0, 12);
             int8_list.set(1, -34);
             int8_list.set(2, -0x80);
             int8_list.set(3, 0x7f);
         }
         {
-            let mut int16_list = sub_builder.borrow().init_int16_list(4);
+            let mut int16_list = sub_builder.reborrow().init_int16_list(4);
             int16_list.set(0, 1234);
             int16_list.set(1, -5678);
             int16_list.set(2, -0x8000);
             int16_list.set(3, 0x7fff);
         }
         {
-            let mut int32_list = sub_builder.borrow().init_int32_list(4);
+            let mut int32_list = sub_builder.reborrow().init_int32_list(4);
             int32_list.set(0, 12345678);
             int32_list.set(1, -90123456);
             int32_list.set(2, -0x80000000);
             int32_list.set(3, 0x7fffffff);
         }
         {
-            let mut int64_list = sub_builder.borrow().init_int64_list(4);
+            let mut int64_list = sub_builder.reborrow().init_int64_list(4);
             int64_list.set(0, 123456789012345);
             int64_list.set(1, -678901234567890);
             int64_list.set(2, -0x8000000000000000);
@@ -100,13 +100,13 @@ pub fn init_test_message(mut builder: test_all_types::Builder) {
 
         // ...
         {
-            let mut struct_list = sub_builder.borrow().init_struct_list(3);
-            struct_list.borrow().get(0).set_text_field("x structlist 1");
-            struct_list.borrow().get(1).set_text_field("x structlist 2");
-            struct_list.borrow().get(2).set_text_field("x structlist 3");
+            let mut struct_list = sub_builder.reborrow().init_struct_list(3);
+            struct_list.reborrow().get(0).set_text_field("x structlist 1");
+            struct_list.reborrow().get(1).set_text_field("x structlist 2");
+            struct_list.reborrow().get(2).set_text_field("x structlist 3");
         }
 
-        let mut enum_list = sub_builder.borrow().init_enum_list(3);
+        let mut enum_list = sub_builder.reborrow().init_enum_list(3);
         enum_list.set(0, TestEnum::Qux);
         enum_list.set(1, TestEnum::Bar);
         enum_list.set(2, TestEnum::Grault);
@@ -127,47 +127,47 @@ check_test_message_impl(($typ:ident) => (
     impl <'a> CheckTestMessage for test_all_types::$typ<'a> {
         fn check_test_message(mut reader : test_all_types::$typ<'a>) {
             #![allow(unused_mut)]
-            reader.borrow().get_void_field();
-            assert_eq!(true, reader.borrow().get_bool_field());
-            assert_eq!(-123, reader.borrow().get_int8_field());
-            assert_eq!(-12345, reader.borrow().get_int16_field());
-            assert_eq!(-12345678, reader.borrow().get_int32_field());
-            assert_eq!(-123456789012345, reader.borrow().get_int64_field());
-            assert_eq!(234, reader.borrow().get_u_int8_field());
-            assert_eq!(45678, reader.borrow().get_u_int16_field());
-            assert_eq!(3456789012, reader.borrow().get_u_int32_field());
-            assert_eq!(12345678901234567890, reader.borrow().get_u_int64_field());
-            assert_eq!(1234.5, reader.borrow().get_float32_field());
-            assert_eq!(-123e45, reader.borrow().get_float64_field());
-            assert_eq!("foo", &*reader.borrow().get_text_field().unwrap());
-            assert_eq!(b"bar", &*reader.borrow().get_data_field().unwrap());
+            reader.reborrow().get_void_field();
+            assert_eq!(true, reader.reborrow().get_bool_field());
+            assert_eq!(-123, reader.reborrow().get_int8_field());
+            assert_eq!(-12345, reader.reborrow().get_int16_field());
+            assert_eq!(-12345678, reader.reborrow().get_int32_field());
+            assert_eq!(-123456789012345, reader.reborrow().get_int64_field());
+            assert_eq!(234, reader.reborrow().get_u_int8_field());
+            assert_eq!(45678, reader.reborrow().get_u_int16_field());
+            assert_eq!(3456789012, reader.reborrow().get_u_int32_field());
+            assert_eq!(12345678901234567890, reader.reborrow().get_u_int64_field());
+            assert_eq!(1234.5, reader.reborrow().get_float32_field());
+            assert_eq!(-123e45, reader.reborrow().get_float64_field());
+            assert_eq!("foo", &*reader.reborrow().get_text_field().unwrap());
+            assert_eq!(b"bar", &*reader.reborrow().get_data_field().unwrap());
             {
                 let mut sub_reader = reader.get_struct_field().unwrap();
-                assert_eq!((), sub_reader.borrow().get_void_field());
-                assert_eq!(true, sub_reader.borrow().get_bool_field());
-                assert_eq!(-12, sub_reader.borrow().get_int8_field());
-                assert_eq!(3456, sub_reader.borrow().get_int16_field());
-                assert_eq!(-78901234, sub_reader.borrow().get_int32_field());
-                assert_eq!(56789012345678, sub_reader.borrow().get_int64_field());
-                assert_eq!(90, sub_reader.borrow().get_u_int8_field());
-                assert_eq!(1234, sub_reader.borrow().get_u_int16_field());
-                assert_eq!(56789012, sub_reader.borrow().get_u_int32_field());
-                assert_eq!(345678901234567890, sub_reader.borrow().get_u_int64_field());
-                assert_eq!(-1.25e-10, sub_reader.borrow().get_float32_field());
-                assert_eq!(345f64, sub_reader.borrow().get_float64_field());
-                assert_eq!("baz", &*sub_reader.borrow().get_text_field().unwrap());
-                assert_eq!(b"qux", &*sub_reader.borrow().get_data_field().unwrap());
+                assert_eq!((), sub_reader.reborrow().get_void_field());
+                assert_eq!(true, sub_reader.reborrow().get_bool_field());
+                assert_eq!(-12, sub_reader.reborrow().get_int8_field());
+                assert_eq!(3456, sub_reader.reborrow().get_int16_field());
+                assert_eq!(-78901234, sub_reader.reborrow().get_int32_field());
+                assert_eq!(56789012345678, sub_reader.reborrow().get_int64_field());
+                assert_eq!(90, sub_reader.reborrow().get_u_int8_field());
+                assert_eq!(1234, sub_reader.reborrow().get_u_int16_field());
+                assert_eq!(56789012, sub_reader.reborrow().get_u_int32_field());
+                assert_eq!(345678901234567890, sub_reader.reborrow().get_u_int64_field());
+                assert_eq!(-1.25e-10, sub_reader.reborrow().get_float32_field());
+                assert_eq!(345f64, sub_reader.reborrow().get_float64_field());
+                assert_eq!("baz", &*sub_reader.reborrow().get_text_field().unwrap());
+                assert_eq!(b"qux", &*sub_reader.reborrow().get_data_field().unwrap());
                 {
-                    let mut sub_sub_reader = sub_reader.borrow().get_struct_field().unwrap();
-                    assert_eq!("nested", &*sub_sub_reader.borrow().get_text_field().unwrap());
+                    let mut sub_sub_reader = sub_reader.reborrow().get_struct_field().unwrap();
+                    assert_eq!("nested", &*sub_sub_reader.reborrow().get_text_field().unwrap());
                     assert_eq!("really nested", &*sub_sub_reader.get_struct_field().unwrap()
                                                                 .get_text_field().unwrap());
                 }
-                assert!(Ok(TestEnum::Baz) == sub_reader.borrow().get_enum_field());
-                assert_eq!(3, sub_reader.borrow().get_void_list().unwrap().len());
+                assert!(Ok(TestEnum::Baz) == sub_reader.reborrow().get_enum_field());
+                assert_eq!(3, sub_reader.reborrow().get_void_list().unwrap().len());
 
                 {
-                    let bool_list = sub_reader.borrow().get_bool_list().unwrap();
+                    let bool_list = sub_reader.reborrow().get_bool_list().unwrap();
                     assert_eq!(5, bool_list.len());
                     assert_eq!(false, bool_list.get(0));
                     assert_eq!(true, bool_list.get(1));
@@ -177,7 +177,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int8_list = sub_reader.borrow().get_int8_list().unwrap();
+                    let int8_list = sub_reader.reborrow().get_int8_list().unwrap();
                     assert_eq!(4, int8_list.len());
                     assert_eq!(12, int8_list.get(0));
                     assert_eq!(-34, int8_list.get(1));
@@ -186,7 +186,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int16_list = sub_reader.borrow().get_int16_list().unwrap();
+                    let int16_list = sub_reader.reborrow().get_int16_list().unwrap();
                     assert_eq!(4, int16_list.len());
                     assert_eq!(1234, int16_list.get(0));
                     assert_eq!(-5678, int16_list.get(1));
@@ -195,7 +195,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int32_list = sub_reader.borrow().get_int32_list().unwrap();
+                    let int32_list = sub_reader.reborrow().get_int32_list().unwrap();
                     assert_eq!(4, int32_list.len());
                     assert_eq!(12345678, int32_list.get(0));
                     assert_eq!(-90123456, int32_list.get(1));
@@ -206,11 +206,11 @@ check_test_message_impl(($typ:ident) => (
                 // ...
 
                 {
-                    let mut struct_list = sub_reader.borrow().get_struct_list().unwrap();
+                    let mut struct_list = sub_reader.reborrow().get_struct_list().unwrap();
                     assert_eq!(3, struct_list.len());
-                    assert_eq!("x structlist 1", &*struct_list.borrow().get(0).get_text_field().unwrap());
-                    assert_eq!("x structlist 2", &*struct_list.borrow().get(1).get_text_field().unwrap());
-                    assert_eq!("x structlist 3", &*struct_list.borrow().get(2).get_text_field().unwrap());
+                    assert_eq!("x structlist 1", &*struct_list.reborrow().get(0).get_text_field().unwrap());
+                    assert_eq!("x structlist 2", &*struct_list.reborrow().get(1).get_text_field().unwrap());
+                    assert_eq!("x structlist 3", &*struct_list.reborrow().get(2).get_text_field().unwrap());
                 }
 
                 {
diff --git a/capnpc/test/test.rs b/capnpc/test/test.rs
index f644bc454..1e44c4df1 100644
--- a/capnpc/test/test.rs
+++ b/capnpc/test/test.rs
@@ -56,21 +56,21 @@ mod tests {
         assert_eq!(test_prim_list.has_void_list(), false);
         {
             {
-                let mut uint8_list = test_prim_list.borrow().init_uint8_list(100);
+                let mut uint8_list = test_prim_list.reborrow().init_uint8_list(100);
                 for i in 0..uint8_list.len() {
                     uint8_list.set(i, i as u8);
                 }
             }
 
             {
-                let mut uint64_list = test_prim_list.borrow().init_uint64_list(20);
+                let mut uint64_list = test_prim_list.reborrow().init_uint64_list(20);
                 for i in 0..uint64_list.len() {
                     uint64_list.set(i, i as u64);
                 }
             }
 
             {
-                let mut bool_list = test_prim_list.borrow().init_bool_list(65);
+                let mut bool_list = test_prim_list.reborrow().init_bool_list(65);
 
                 bool_list.set(0, true);
                 bool_list.set(1, true);
@@ -87,7 +87,7 @@ mod tests {
                 assert!(bool_list.get(64));
             }
 
-            let mut void_list = test_prim_list.borrow().init_void_list(1025);
+            let mut void_list = test_prim_list.reborrow().init_void_list(1025);
             void_list.set(257, ());
         }
         assert_eq!(test_prim_list.has_bool_list(), true);
@@ -134,9 +134,9 @@ mod tests {
 
         let mut test_struct_list = message.init_root::<test_struct_list::Builder>();
 
-        test_struct_list.borrow().init_struct_list(4);
+        test_struct_list.reborrow().init_struct_list(4);
         {
-            let struct_list = test_struct_list.borrow().get_struct_list().unwrap();
+            let struct_list = test_struct_list.reborrow().get_struct_list().unwrap();
             struct_list.get(0).init_uint8_list(1).set(0, 5u8);
         }
 
@@ -162,7 +162,7 @@ mod tests {
         assert_eq!(test_blob.has_data_field(), true);
 
         {
-            let test_blob_reader = test_blob.borrow_as_reader();
+            let test_blob_reader = test_blob.reborrow_as_reader();
 
             assert_eq!(test_blob_reader.has_text_field(), true);
             assert_eq!(test_blob_reader.has_data_field(), true);
@@ -172,27 +172,27 @@ mod tests {
         }
 
         {
-            let mut text = test_blob.borrow().init_text_field(10);
+            let mut text = test_blob.reborrow().init_text_field(10);
             assert_eq!(&*text,"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00");
             text.push_str("aabbccddee");
         }
 
-        test_blob.borrow().init_data_field(7);
-        assert!(test_blob.borrow().as_reader().get_data_field().unwrap() ==
+        test_blob.reborrow().init_data_field(7);
+        assert!(test_blob.reborrow().as_reader().get_data_field().unwrap() ==
                 [0u8,0u8,0u8,0u8,0u8,0u8,0u8]);
         {
-            let data_builder = test_blob.borrow().get_data_field().unwrap();
+            let data_builder = test_blob.reborrow().get_data_field().unwrap();
             for c in data_builder.iter_mut() {
                 *c = 5;
             }
             data_builder[0] = 4u8;
         }
 
-        assert_eq!(test_blob.borrow().as_reader().get_text_field().unwrap(), "aabbccddee");
-        assert!(test_blob.borrow().as_reader().get_data_field().unwrap() == [4u8,5u8,5u8,5u8,5u8,5u8,5u8]);
+        assert_eq!(test_blob.reborrow().as_reader().get_text_field().unwrap(), "aabbccddee");
+        assert!(test_blob.reborrow().as_reader().get_data_field().unwrap() == [4u8,5u8,5u8,5u8,5u8,5u8,5u8]);
 
         {
-            test_blob.borrow().get_data_field().unwrap()[2] = 10;
+            test_blob.reborrow().get_data_field().unwrap()[2] = 10;
         }
         assert!(test_blob.as_reader().get_data_field().unwrap() == [4u8,5u8,10u8,5u8,5u8,5u8,5u8]);
     }
@@ -213,10 +213,10 @@ mod tests {
         big_struct.set_int32_field(1009);
 
         assert_eq!(big_struct.has_struct_field(), false);
-        big_struct.borrow().init_struct_field();
+        big_struct.reborrow().init_struct_field();
         assert_eq!(big_struct.has_struct_field(), true);
         {
-            let mut inner = big_struct.borrow().get_struct_field().unwrap();
+            let mut inner = big_struct.reborrow().get_struct_field().unwrap();
             inner.set_float64_field(0.1234567);
             inner.set_bool_field_b(true);
         }
@@ -245,7 +245,7 @@ mod tests {
 
         {
             {
-                let mut enum_list = test_complex_list.borrow().init_enum_list(100);
+                let mut enum_list = test_complex_list.reborrow().init_enum_list(100);
                 for i in 0..10 {
                     enum_list.set(i, AnEnum::Qux);
                 }
@@ -255,21 +255,21 @@ mod tests {
             }
 
             {
-                let mut text_list = test_complex_list.borrow().init_text_list(2);
+                let mut text_list = test_complex_list.reborrow().init_text_list(2);
                 text_list.set(0, "garply");
                 text_list.set(1, "foo");
             }
 
             {
-                let mut data_list = test_complex_list.borrow().init_data_list(2);
+                let mut data_list = test_complex_list.reborrow().init_data_list(2);
                 data_list.set(0, &[0u8, 1u8, 2u8]);
                 data_list.set(1, &[255u8, 254u8, 253u8]);
             }
 
             {
-                let mut prim_list_list = test_complex_list.borrow().init_prim_list_list(2);
+                let mut prim_list_list = test_complex_list.reborrow().init_prim_list_list(2);
                 {
-                    let mut prim_list = prim_list_list.borrow().init(0, 3);
+                    let mut prim_list = prim_list_list.reborrow().init(0, 3);
                     prim_list.set(0, 5);
                     prim_list.set(1, 6);
                     prim_list.set(2, 7);
@@ -280,11 +280,11 @@ mod tests {
             }
 
             {
-                let mut prim_list_list_list = test_complex_list.borrow().init_prim_list_list_list(2);
+                let mut prim_list_list_list = test_complex_list.reborrow().init_prim_list_list_list(2);
                 {
-                    let mut prim_list_list = prim_list_list_list.borrow().init(0, 2);
+                    let mut prim_list_list = prim_list_list_list.reborrow().init(0, 2);
                     {
-                        let mut prim_list = prim_list_list.borrow().init(0, 2);
+                        let mut prim_list = prim_list_list.reborrow().init(0, 2);
                         prim_list.set(0, 0);
                         prim_list.set(1, 1);
                     }
@@ -299,9 +299,9 @@ mod tests {
             }
 
             {
-                let mut enum_list_list = test_complex_list.borrow().init_enum_list_list(2);
+                let mut enum_list_list = test_complex_list.reborrow().init_enum_list_list(2);
                 {
-                    let mut enum_list = enum_list_list.borrow().init(0, 1);
+                    let mut enum_list = enum_list_list.reborrow().init(0, 1);
                     enum_list.set(0, AnEnum::Bar);
                 }
                 let mut enum_list = enum_list_list.init(1, 2);
@@ -310,17 +310,17 @@ mod tests {
             }
 
             {
-                let text_list_list = test_complex_list.borrow().init_text_list_list(1);
+                let text_list_list = test_complex_list.reborrow().init_text_list_list(1);
                 text_list_list.init(0,1).set(0, "abc");
             }
 
             {
-                let data_list_list = test_complex_list.borrow().init_data_list_list(1);
+                let data_list_list = test_complex_list.reborrow().init_data_list_list(1);
                 data_list_list.init(0,1).set(0, &[255, 254, 253]);
             }
 
             {
-                let struct_list_list = test_complex_list.borrow().init_struct_list_list(1);
+                let struct_list_list = test_complex_list.reborrow().init_struct_list_list(1);
                 struct_list_list.init(0,1).get(0).set_int8_field(-1);
             }
         }
@@ -381,37 +381,37 @@ mod tests {
             let test_defaults = message.get_root_as_reader::<test_defaults::Reader>()
                 .expect("get_root_as_reader()");
 
-            assert_eq!(test_defaults.borrow().get_void_field(), ());
-            assert_eq!(test_defaults.borrow().get_bool_field(), true);
-            assert_eq!(test_defaults.borrow().get_int8_field(), -123);
-            assert_eq!(test_defaults.borrow().get_int16_field(), -12345);
-            assert_eq!(test_defaults.borrow().get_int32_field(), -12345678);
-            assert_eq!(test_defaults.borrow().get_int64_field(), -123456789012345);
-            assert_eq!(test_defaults.borrow().get_uint8_field(), 234u8);
-            assert_eq!(test_defaults.borrow().get_uint16_field(), 45678u16);
-            assert_eq!(test_defaults.borrow().get_uint32_field(), 3456789012u32);
-            assert_eq!(test_defaults.borrow().get_uint64_field(), 12345678901234567890u64);
-            assert_eq!(test_defaults.borrow().get_float32_field(), 1234.5);
-            assert_eq!(test_defaults.borrow().get_float64_field(), -123e45);
-            assert!(test_defaults.borrow().get_enum_field().unwrap() == TestEnum::Corge);
+            assert_eq!(test_defaults.reborrow().get_void_field(), ());
+            assert_eq!(test_defaults.reborrow().get_bool_field(), true);
+            assert_eq!(test_defaults.reborrow().get_int8_field(), -123);
+            assert_eq!(test_defaults.reborrow().get_int16_field(), -12345);
+            assert_eq!(test_defaults.reborrow().get_int32_field(), -12345678);
+            assert_eq!(test_defaults.reborrow().get_int64_field(), -123456789012345);
+            assert_eq!(test_defaults.reborrow().get_uint8_field(), 234u8);
+            assert_eq!(test_defaults.reborrow().get_uint16_field(), 45678u16);
+            assert_eq!(test_defaults.reborrow().get_uint32_field(), 3456789012u32);
+            assert_eq!(test_defaults.reborrow().get_uint64_field(), 12345678901234567890u64);
+            assert_eq!(test_defaults.reborrow().get_float32_field(), 1234.5);
+            assert_eq!(test_defaults.reborrow().get_float64_field(), -123e45);
+            assert!(test_defaults.reborrow().get_enum_field().unwrap() == TestEnum::Corge);
         }
 
         {
             let mut test_defaults = message.init_root::<test_defaults::Builder>();
 
-            assert_eq!(test_defaults.borrow().get_void_field(), ());
-            assert_eq!(test_defaults.borrow().get_bool_field(), true);
-            assert_eq!(test_defaults.borrow().get_int8_field(), -123);
-            assert_eq!(test_defaults.borrow().get_int16_field(), -12345);
-            assert_eq!(test_defaults.borrow().get_int32_field(), -12345678);
-            assert_eq!(test_defaults.borrow().get_int64_field(), -123456789012345);
-            assert_eq!(test_defaults.borrow().get_uint8_field(), 234u8);
-            assert_eq!(test_defaults.borrow().get_uint16_field(), 45678u16);
-            assert_eq!(test_defaults.borrow().get_uint32_field(), 3456789012u32);
-            assert_eq!(test_defaults.borrow().get_uint64_field(), 12345678901234567890u64);
-            assert_eq!(test_defaults.borrow().get_float32_field(), 1234.5);
-            assert_eq!(test_defaults.borrow().get_float64_field(), -123e45);
-            assert!(test_defaults.borrow().get_enum_field().unwrap() == TestEnum::Corge);
+            assert_eq!(test_defaults.reborrow().get_void_field(), ());
+            assert_eq!(test_defaults.reborrow().get_bool_field(), true);
+            assert_eq!(test_defaults.reborrow().get_int8_field(), -123);
+            assert_eq!(test_defaults.reborrow().get_int16_field(), -12345);
+            assert_eq!(test_defaults.reborrow().get_int32_field(), -12345678);
+            assert_eq!(test_defaults.reborrow().get_int64_field(), -123456789012345);
+            assert_eq!(test_defaults.reborrow().get_uint8_field(), 234u8);
+            assert_eq!(test_defaults.reborrow().get_uint16_field(), 45678u16);
+            assert_eq!(test_defaults.reborrow().get_uint32_field(), 3456789012u32);
+            assert_eq!(test_defaults.reborrow().get_uint64_field(), 12345678901234567890u64);
+            assert_eq!(test_defaults.reborrow().get_float32_field(), 1234.5);
+            assert_eq!(test_defaults.reborrow().get_float64_field(), -123e45);
+            assert!(test_defaults.reborrow().get_enum_field().unwrap() == TestEnum::Corge);
         }
 
         {
@@ -429,17 +429,17 @@ mod tests {
             test_defaults.set_float32_field(7890.123);
             test_defaults.set_float64_field(5e55);
 
-            assert_eq!(test_defaults.borrow().get_bool_field(), false);
-            assert_eq!(test_defaults.borrow().get_int8_field(), 63);
-            assert_eq!(test_defaults.borrow().get_int16_field(), -1123);
-            assert_eq!(test_defaults.borrow().get_int32_field(),  445678);
-            assert_eq!(test_defaults.borrow().get_int64_field(), -990123456789);
-            assert_eq!(test_defaults.borrow().get_uint8_field(), 234);
-            assert_eq!(test_defaults.borrow().get_uint16_field(), 56789);
-            assert_eq!(test_defaults.borrow().get_uint32_field(),  123456789);
-            assert_eq!(test_defaults.borrow().get_uint64_field(),  123456789012345);
-            assert_eq!(test_defaults.borrow().get_float32_field(), 7890.123);
-            assert_eq!(test_defaults.borrow().get_float64_field(), 5e55);
+            assert_eq!(test_defaults.reborrow().get_bool_field(), false);
+            assert_eq!(test_defaults.reborrow().get_int8_field(), 63);
+            assert_eq!(test_defaults.reborrow().get_int16_field(), -1123);
+            assert_eq!(test_defaults.reborrow().get_int32_field(),  445678);
+            assert_eq!(test_defaults.reborrow().get_int64_field(), -990123456789);
+            assert_eq!(test_defaults.reborrow().get_uint8_field(), 234);
+            assert_eq!(test_defaults.reborrow().get_uint16_field(), 56789);
+            assert_eq!(test_defaults.reborrow().get_uint32_field(),  123456789);
+            assert_eq!(test_defaults.reborrow().get_uint64_field(),  123456789012345);
+            assert_eq!(test_defaults.reborrow().get_float32_field(), 7890.123);
+            assert_eq!(test_defaults.reborrow().get_float64_field(), 5e55);
         }
     }
 
@@ -450,18 +450,18 @@ mod tests {
         let mut message = message::Builder::new_default();
         let mut test_any_pointer = message.init_root::<test_any_pointer::Builder>();
 
-        test_any_pointer.borrow().init_any_pointer_field().set_as("xyzzy").unwrap();
+        test_any_pointer.reborrow().init_any_pointer_field().set_as("xyzzy").unwrap();
 
         {
-            let reader = test_any_pointer.borrow().as_reader();
+            let reader = test_any_pointer.reborrow().as_reader();
             assert_eq!(reader.get_any_pointer_field().get_as::<::capnp::text::Reader>().unwrap(), "xyzzy");
         }
 
-        test_any_pointer.borrow().get_any_pointer_field().init_as::<test_empty_struct::Builder>();
-        test_any_pointer.borrow().get_any_pointer_field().get_as::<test_empty_struct::Builder>().unwrap();
+        test_any_pointer.reborrow().get_any_pointer_field().init_as::<test_empty_struct::Builder>();
+        test_any_pointer.reborrow().get_any_pointer_field().get_as::<test_empty_struct::Builder>().unwrap();
 
         {
-            let reader = test_any_pointer.borrow().as_reader();
+            let reader = test_any_pointer.reborrow().as_reader();
             reader.get_any_pointer_field().get_as::<test_empty_struct::Reader>().unwrap();
         }
 
@@ -469,7 +469,7 @@ mod tests {
             let mut message = message::Builder::new_default();
             let mut test_big_struct = message.init_root::<test_big_struct::Builder>();
             test_big_struct.set_int32_field(-12345);
-            test_any_pointer.get_any_pointer_field().set_as(test_big_struct.borrow().as_reader()).unwrap();
+            test_any_pointer.get_any_pointer_field().set_as(test_big_struct.reborrow().as_reader()).unwrap();
         }
 
         fn _test_lifetimes(body : test_big_struct::Reader) {
@@ -489,39 +489,39 @@ mod tests {
 
         let neg_seven : u64 = (-7i64) as u64;
         {
-            let mut struct_field = big_struct.borrow().init_struct_field();
-            assert_eq!(struct_field.borrow().get_uint64_field(), 0);
+            let mut struct_field = big_struct.reborrow().init_struct_field();
+            assert_eq!(struct_field.reborrow().get_uint64_field(), 0);
 
             struct_field.set_uint64_field(neg_seven);
             assert_eq!(struct_field.get_uint64_field(), neg_seven);
         }
-        assert_eq!(big_struct.borrow().get_struct_field().unwrap().get_uint64_field(), neg_seven);
+        assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint64_field(), neg_seven);
         {
-            let mut struct_field = big_struct.borrow().init_struct_field();
-            assert_eq!(struct_field.borrow().get_uint64_field(), 0);
+            let mut struct_field = big_struct.reborrow().init_struct_field();
+            assert_eq!(struct_field.reborrow().get_uint64_field(), 0);
             assert_eq!(struct_field.get_uint32_field(), 0);
         }
 
         {
             // getting before init is the same as init
-            assert_eq!(big_struct.borrow().get_another_struct_field().unwrap().get_uint64_field(), 0);
-            big_struct.borrow().get_another_struct_field().unwrap().set_uint32_field(4294967265);
+            assert_eq!(big_struct.reborrow().get_another_struct_field().unwrap().get_uint64_field(), 0);
+            big_struct.reborrow().get_another_struct_field().unwrap().set_uint32_field(4294967265);
 
-            // Alas, we need to make a copy to appease the borrow checker.
+            // Alas, we need to make a copy to appease the reborrow checker.
             let mut other_message = message::Builder::new_default();
-            other_message.set_root(big_struct.borrow().get_another_struct_field().unwrap().as_reader()).unwrap();
+            other_message.set_root(big_struct.reborrow().get_another_struct_field().unwrap().as_reader()).unwrap();
             big_struct.set_struct_field(
                 other_message.get_root::<test_big_struct::inner::Builder>().unwrap().as_reader()).unwrap();
         }
 
-        assert_eq!(big_struct.borrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
+        assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
         {
-            let mut other_struct_field = big_struct.borrow().get_another_struct_field().unwrap();
-            assert_eq!(other_struct_field.borrow().get_uint32_field(), 4294967265);
+            let mut other_struct_field = big_struct.reborrow().get_another_struct_field().unwrap();
+            assert_eq!(other_struct_field.reborrow().get_uint32_field(), 4294967265);
             other_struct_field.set_uint32_field(42);
             assert_eq!(other_struct_field.get_uint32_field(), 42);
         }
-        assert_eq!(big_struct.borrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
+        assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
         assert_eq!(big_struct.get_another_struct_field().unwrap().get_uint32_field(), 42);
     }
 
@@ -532,7 +532,7 @@ mod tests {
         let mut message_for_brand = message::Builder::new_default();
         let mut branded = message_for_brand.init_root::<brand_once::Builder>();
         {
-            let branded_field = branded.borrow().init_branded_field();
+            let branded_field = branded.reborrow().init_branded_field();
             let mut foo = branded_field.init_generic_field();
             foo.set_text_field("blah");
         }
@@ -548,7 +548,7 @@ mod tests {
         let mut message_for_brand = message::Builder::new_default();
         let mut branded = message_for_brand.init_root::<brand_twice::Builder>();
         {
-            let mut baz = branded.borrow().init_baz_field();
+            let mut baz = branded.reborrow().init_baz_field();
             baz.set_foo_field("blah").unwrap();
             let mut bar = baz.init_bar_field();
             bar.set_text_field("some text");
@@ -567,23 +567,23 @@ mod tests {
         use test_capnp::{test_generics, test_all_types};
         let mut message = message::Builder::new_default();
         let mut root: test_generics::Builder<test_all_types::Owned, text::Owned> = message.init_root();
-        ::test_util::init_test_message(root.borrow().get_foo().unwrap());
-        root.borrow().get_dub().unwrap().set_foo("Hello").unwrap();
+        ::test_util::init_test_message(root.reborrow().get_foo().unwrap());
+        root.reborrow().get_dub().unwrap().set_foo("Hello").unwrap();
         {
-            let mut bar: ::capnp::primitive_list::Builder<u8> = root.borrow().get_dub().unwrap().initn_bar(1);
+            let mut bar: ::capnp::primitive_list::Builder<u8> = root.reborrow().get_dub().unwrap().initn_bar(1);
             bar.set(0, 11);
         }
         {
-            let mut rev_bar = root.borrow().get_rev().unwrap().get_bar().unwrap();
+            let mut rev_bar = root.reborrow().get_rev().unwrap().get_bar().unwrap();
             rev_bar.set_int8_field(111);
             let mut bool_list = rev_bar.init_bool_list(2);
             bool_list.set(0, false);
             bool_list.set(1, true);
         }
 
-        ::test_util::CheckTestMessage::check_test_message(root.borrow().get_foo().unwrap());
+        ::test_util::CheckTestMessage::check_test_message(root.reborrow().get_foo().unwrap());
         let root_reader = root.as_reader();
-        ::test_util::CheckTestMessage::check_test_message(root_reader.borrow().get_foo().unwrap());
+        ::test_util::CheckTestMessage::check_test_message(root_reader.reborrow().get_foo().unwrap());
         let dub_reader = root_reader.get_dub().unwrap();
         assert_eq!("Hello", dub_reader.get_foo().unwrap());
         let bar_reader = dub_reader.get_bar().unwrap();
@@ -600,14 +600,14 @@ mod tests {
             let mut root: test_generics_union::Builder<test_all_types::Owned, primitive_list::Owned<u32>>
                 = message.init_root();
             {
-                let mut bar = root.borrow().initn_bar1(10);
+                let mut bar = root.reborrow().initn_bar1(10);
                 bar.set(5, 100);
             }
             assert!(!root.has_foo1());
             assert!(root.has_bar1());
             assert!(!root.has_foo2());
 
-            match root.borrow().which().unwrap() {
+            match root.reborrow().which().unwrap() {
                 test_generics_union::Bar1(Ok(bar)) => {
                     assert_eq!(bar.len(), 10);
                     assert_eq!(bar.get(0), 0);
@@ -618,7 +618,7 @@ mod tests {
             }
 
             {
-                let mut foo = root.borrow().init_foo2();
+                let mut foo = root.reborrow().init_foo2();
                 foo.set_int32_field(37);
             }
 
@@ -626,7 +626,7 @@ mod tests {
             assert!(!root.has_bar1());
             assert!(root.has_foo2());
 
-            match root.borrow().which().unwrap() {
+            match root.reborrow().which().unwrap() {
                 test_generics_union::Foo2(Ok(foo)) => {
                     assert_eq!(foo.get_int32_field(), 37);
                 }
@@ -642,24 +642,24 @@ mod tests {
         let mut message = message::Builder::new_default();
         let mut union_struct = message.init_root::<test_union::Builder>();
 
-        union_struct.borrow().get_union0().set_u0f0s0(());
-        match union_struct.borrow().get_union0().which() {
+        union_struct.reborrow().get_union0().set_u0f0s0(());
+        match union_struct.reborrow().get_union0().which() {
             Ok(test_union::union0::U0f0s0(())) => {}
             _ => panic!()
         }
-        union_struct.borrow().init_union0().set_u0f0s1(true);
-        match union_struct.borrow().get_union0().which() {
+        union_struct.reborrow().init_union0().set_u0f0s1(true);
+        match union_struct.reborrow().get_union0().which() {
             Ok(test_union::union0::U0f0s1(true)) => {}
             _ => panic!()
         }
-        union_struct.borrow().init_union0().set_u0f0s8(127);
-        match union_struct.borrow().get_union0().which() {
+        union_struct.reborrow().init_union0().set_u0f0s8(127);
+        match union_struct.reborrow().get_union0().which() {
             Ok(test_union::union0::U0f0s8(127)) => {}
             _ => panic!()
         }
 
-        assert_eq!(union_struct.borrow().get_union0().has_u0f0sp(), false);
-        union_struct.borrow().init_union0().set_u0f0sp("abcdef");
+        assert_eq!(union_struct.reborrow().get_union0().has_u0f0sp(), false);
+        union_struct.reborrow().init_union0().set_u0f0sp("abcdef");
         assert_eq!(union_struct.get_union0().has_u0f0sp(), true);
     }
 
@@ -761,7 +761,7 @@ mod tests {
         }
         {
             let mut new_version = message.get_root::<test_new_version::Builder>().unwrap();
-            new_version.borrow().get_new2().unwrap();
+            new_version.reborrow().get_new2().unwrap();
             assert_eq!(new_version.get_new3().unwrap().get_int8_field(), -123);
         }
     }
@@ -799,7 +799,7 @@ mod tests {
             let mut builder = message::Builder::new_default();
             let mut root = builder.init_root::<test_any_pointer::Builder>();
             {
-                let mut list = root.borrow()
+                let mut list = root.reborrow()
                     .get_any_pointer_field().initn_as::<::capnp::primitive_list::Builder<u8>>(3);
                 list.set(0, 12);
                 list.set(1, 34);
@@ -809,9 +809,9 @@ mod tests {
                 let mut l = root.get_any_pointer_field()
                     .get_as::<::capnp::struct_list::Builder<test_lists::struct8::Owned>>().unwrap();
                 assert_eq!(3, l.len());
-                assert_eq!(12, l.borrow().get(0).get_f());
-                assert_eq!(34, l.borrow().get(1).get_f());
-                assert_eq!(56, l.borrow().get(2).get_f());
+                assert_eq!(12, l.reborrow().get(0).get_f());
+                assert_eq!(34, l.reborrow().get(1).get_f());
+                assert_eq!(56, l.reborrow().get(2).get_f());
             }
         }
 
@@ -819,7 +819,7 @@ mod tests {
             let mut builder = message::Builder::new_default();
             let mut root = builder.init_root::<test_any_pointer::Builder>();
             {
-                let mut list = root.borrow()
+                let mut list = root.reborrow()
                     .get_any_pointer_field().initn_as::<::capnp::text_list::Builder>(3);
                 list.set(0, "foo");
                 list.set(1, "bar");
@@ -829,9 +829,9 @@ mod tests {
                 let mut l = root.get_any_pointer_field()
                     .get_as::<::capnp::struct_list::Builder<test_lists::struct_p::Owned>>().unwrap();
                 assert_eq!(3, l.len());
-                assert_eq!("foo", &*l.borrow().get(0).get_f().unwrap());
-                assert_eq!("bar", &*l.borrow().get(1).get_f().unwrap());
-                assert_eq!("baz", &*l.borrow().get(2).get_f().unwrap());
+                assert_eq!("foo", &*l.reborrow().get(0).get_f().unwrap());
+                assert_eq!("bar", &*l.reborrow().get(1).get_f().unwrap());
+                assert_eq!("baz", &*l.reborrow().get(2).get_f().unwrap());
             }
         }
     }
@@ -874,8 +874,8 @@ mod tests {
         {
             let mut new_version: struct_list::Builder<test_new_version::Owned> = message.get_root().unwrap();
             assert_eq!(new_version.len(), 1);
-            assert_eq!(new_version.borrow().get(0).get_old1(), 0xab);
-            assert_eq!(&*new_version.borrow().get(0).get_old2().unwrap(), "hello!!");
+            assert_eq!(new_version.reborrow().get(0).get_old1(), 0xab);
+            assert_eq!(&*new_version.reborrow().get(0).get_old2().unwrap(), "hello!!");
         }
 
         {
@@ -923,7 +923,7 @@ mod tests {
             let mut all_types2 = message2.init_root::<test_all_types::Builder>();
 
             all_types2.set_struct_field(message.get_root::<test_all_types::Builder>().unwrap().as_reader()).unwrap();
-            ::test_util::CheckTestMessage::check_test_message(all_types2.borrow().get_struct_field().unwrap());
+            ::test_util::CheckTestMessage::check_test_message(all_types2.reborrow().get_struct_field().unwrap());
 
             let reader = all_types2.as_reader().get_struct_field().unwrap();
             ::test_util::CheckTestMessage::check_test_message(reader);
@@ -944,7 +944,7 @@ mod tests {
             let mut all_types2 = message2.init_root::<test_all_types::Builder>();
 
             all_types2.set_struct_field(message.get_root_as_reader().unwrap()).unwrap();
-            ::test_util::CheckTestMessage::check_test_message(all_types2.borrow().get_struct_field().unwrap());
+            ::test_util::CheckTestMessage::check_test_message(all_types2.reborrow().get_struct_field().unwrap());
 
             let reader = all_types2.as_reader().get_struct_field().unwrap();
             ::test_util::CheckTestMessage::check_test_message(reader);
@@ -1077,7 +1077,7 @@ mod tests {
         let mut message = message::Builder::new_default();
         {
             let mut root = message.init_root::<test_any_pointer::Builder>();
-            let _: ::capnp::data::Builder = root.borrow().get_any_pointer_field().initn_as(0);
+            let _: ::capnp::data::Builder = root.reborrow().get_any_pointer_field().initn_as(0);
 
             // No NUL terminator!
             let result = root.get_any_pointer_field().get_as::<::capnp::text::Builder>();
@@ -1163,11 +1163,11 @@ mod tests {
             let mut list = root.init_list64(length);
             for ii in 0..(length >> step_exponent) {
                 let jj = ii << step_exponent;
-                list.borrow().get(jj).set_f(jj as u64);
+                list.reborrow().get(jj).set_f(jj as u64);
             }
             for ii in 0..(length >> step_exponent) {
                 let jj = ii << step_exponent;
-                assert_eq!(list.borrow().get(jj).get_f(), jj as u64);
+                assert_eq!(list.reborrow().get(jj).get_f(), jj as u64);
             }
         }
 
@@ -1192,11 +1192,11 @@ mod tests {
             let mut list = root.init_int32_list_list(length);
             for ii in 0..(length >> step_exponent) {
                 let jj = ii << step_exponent;
-                list.borrow().init(jj, 1).set(0, jj as i32);
+                list.reborrow().init(jj, 1).set(0, jj as i32);
             }
             for ii in 0..(length >> step_exponent) {
                 let jj = ii << step_exponent;
-                let elem = list.borrow().get(jj).unwrap();
+                let elem = list.reborrow().get(jj).unwrap();
                 assert_eq!(elem.len(), 1);
                 assert_eq!(elem.get(0), jj as i32);
             }
diff --git a/capnpc/test/test_util.rs b/capnpc/test/test_util.rs
index 025ab6b15..7cbf01249 100644
--- a/capnpc/test/test_util.rs
+++ b/capnpc/test/test_util.rs
@@ -38,7 +38,7 @@ pub fn init_test_message(mut builder : test_all_types::Builder) {
     builder.set_text_field("foo");
     builder.set_data_field(b"bar");
     {
-        let mut sub_builder = builder.borrow().init_struct_field();
+        let mut sub_builder = builder.reborrow().init_struct_field();
         sub_builder.set_void_field(());
         sub_builder.set_bool_field(true);
         sub_builder.set_int8_field(-12);
@@ -54,15 +54,15 @@ pub fn init_test_message(mut builder : test_all_types::Builder) {
         sub_builder.set_text_field("baz");
         sub_builder.set_data_field(b"qux");
         {
-            let mut sub_sub_builder = sub_builder.borrow().init_struct_field();
+            let mut sub_sub_builder = sub_builder.reborrow().init_struct_field();
             sub_sub_builder.set_text_field("nested");
             sub_sub_builder.init_struct_field().set_text_field("really nested");
         }
         sub_builder.set_enum_field(TestEnum::Baz);
 
-        sub_builder.borrow().init_void_list(3);
+        sub_builder.reborrow().init_void_list(3);
         {
-            let mut bool_list = sub_builder.borrow().init_bool_list(5);
+            let mut bool_list = sub_builder.reborrow().init_bool_list(5);
             bool_list.set(0, false);
             bool_list.set(1, true);
             bool_list.set(2, false);
@@ -70,28 +70,28 @@ pub fn init_test_message(mut builder : test_all_types::Builder) {
             bool_list.set(4, true);
         }
         {
-            let mut int8_list = sub_builder.borrow().init_int8_list(4);
+            let mut int8_list = sub_builder.reborrow().init_int8_list(4);
             int8_list.set(0, 12);
             int8_list.set(1, -34);
             int8_list.set(2, -0x80);
             int8_list.set(3, 0x7f);
         }
         {
-            let mut int16_list = sub_builder.borrow().init_int16_list(4);
+            let mut int16_list = sub_builder.reborrow().init_int16_list(4);
             int16_list.set(0, 1234);
             int16_list.set(1, -5678);
             int16_list.set(2, -0x8000);
             int16_list.set(3, 0x7fff);
         }
         {
-            let mut int32_list = sub_builder.borrow().init_int32_list(4);
+            let mut int32_list = sub_builder.reborrow().init_int32_list(4);
             int32_list.set(0, 12345678);
             int32_list.set(1, -90123456);
             int32_list.set(2, -0x80000000);
             int32_list.set(3, 0x7fffffff);
         }
         {
-            let mut int64_list = sub_builder.borrow().init_int64_list(4);
+            let mut int64_list = sub_builder.reborrow().init_int64_list(4);
             int64_list.set(0, 123456789012345);
             int64_list.set(1, -678901234567890);
             int64_list.set(2, -0x8000000000000000);
@@ -100,13 +100,13 @@ pub fn init_test_message(mut builder : test_all_types::Builder) {
 
         // ...
         {
-            let mut struct_list = sub_builder.borrow().init_struct_list(3);
-            struct_list.borrow().get(0).set_text_field("x structlist 1");
-            struct_list.borrow().get(1).set_text_field("x structlist 2");
-            struct_list.borrow().get(2).set_text_field("x structlist 3");
+            let mut struct_list = sub_builder.reborrow().init_struct_list(3);
+            struct_list.reborrow().get(0).set_text_field("x structlist 1");
+            struct_list.reborrow().get(1).set_text_field("x structlist 2");
+            struct_list.reborrow().get(2).set_text_field("x structlist 3");
         }
 
-        let mut enum_list = sub_builder.borrow().init_enum_list(3);
+        let mut enum_list = sub_builder.reborrow().init_enum_list(3);
         enum_list.set(0, TestEnum::Qux);
         enum_list.set(1, TestEnum::Bar);
         enum_list.set(2, TestEnum::Grault);
@@ -127,47 +127,47 @@ check_test_message_impl(($typ:ident) => (
     impl <'a> CheckTestMessage for test_all_types::$typ<'a> {
         fn check_test_message(mut reader : test_all_types::$typ<'a>) {
             #![allow(unused_mut)]
-            reader.borrow().get_void_field();
-            assert_eq!(true, reader.borrow().get_bool_field());
-            assert_eq!(-123, reader.borrow().get_int8_field());
-            assert_eq!(-12345, reader.borrow().get_int16_field());
-            assert_eq!(-12345678, reader.borrow().get_int32_field());
-            assert_eq!(-123456789012345, reader.borrow().get_int64_field());
-            assert_eq!(234, reader.borrow().get_u_int8_field());
-            assert_eq!(45678, reader.borrow().get_u_int16_field());
-            assert_eq!(3456789012, reader.borrow().get_u_int32_field());
-            assert_eq!(12345678901234567890, reader.borrow().get_u_int64_field());
-            assert_eq!(1234.5, reader.borrow().get_float32_field());
-            assert_eq!(-123e45, reader.borrow().get_float64_field());
-            assert_eq!("foo", &*reader.borrow().get_text_field().unwrap());
-            assert_eq!(b"bar", &*reader.borrow().get_data_field().unwrap());
+            reader.reborrow().get_void_field();
+            assert_eq!(true, reader.reborrow().get_bool_field());
+            assert_eq!(-123, reader.reborrow().get_int8_field());
+            assert_eq!(-12345, reader.reborrow().get_int16_field());
+            assert_eq!(-12345678, reader.reborrow().get_int32_field());
+            assert_eq!(-123456789012345, reader.reborrow().get_int64_field());
+            assert_eq!(234, reader.reborrow().get_u_int8_field());
+            assert_eq!(45678, reader.reborrow().get_u_int16_field());
+            assert_eq!(3456789012, reader.reborrow().get_u_int32_field());
+            assert_eq!(12345678901234567890, reader.reborrow().get_u_int64_field());
+            assert_eq!(1234.5, reader.reborrow().get_float32_field());
+            assert_eq!(-123e45, reader.reborrow().get_float64_field());
+            assert_eq!("foo", &*reader.reborrow().get_text_field().unwrap());
+            assert_eq!(b"bar", &*reader.reborrow().get_data_field().unwrap());
             {
                 let mut sub_reader = reader.get_struct_field().unwrap();
-                assert_eq!((), sub_reader.borrow().get_void_field());
-                assert_eq!(true, sub_reader.borrow().get_bool_field());
-                assert_eq!(-12, sub_reader.borrow().get_int8_field());
-                assert_eq!(3456, sub_reader.borrow().get_int16_field());
-                assert_eq!(-78901234, sub_reader.borrow().get_int32_field());
-                assert_eq!(56789012345678, sub_reader.borrow().get_int64_field());
-                assert_eq!(90, sub_reader.borrow().get_u_int8_field());
-                assert_eq!(1234, sub_reader.borrow().get_u_int16_field());
-                assert_eq!(56789012, sub_reader.borrow().get_u_int32_field());
-                assert_eq!(345678901234567890, sub_reader.borrow().get_u_int64_field());
-                assert_eq!(-1.25e-10, sub_reader.borrow().get_float32_field());
-                assert_eq!(345f64, sub_reader.borrow().get_float64_field());
-                assert_eq!("baz", &*sub_reader.borrow().get_text_field().unwrap());
-                assert_eq!(b"qux", &*sub_reader.borrow().get_data_field().unwrap());
+                assert_eq!((), sub_reader.reborrow().get_void_field());
+                assert_eq!(true, sub_reader.reborrow().get_bool_field());
+                assert_eq!(-12, sub_reader.reborrow().get_int8_field());
+                assert_eq!(3456, sub_reader.reborrow().get_int16_field());
+                assert_eq!(-78901234, sub_reader.reborrow().get_int32_field());
+                assert_eq!(56789012345678, sub_reader.reborrow().get_int64_field());
+                assert_eq!(90, sub_reader.reborrow().get_u_int8_field());
+                assert_eq!(1234, sub_reader.reborrow().get_u_int16_field());
+                assert_eq!(56789012, sub_reader.reborrow().get_u_int32_field());
+                assert_eq!(345678901234567890, sub_reader.reborrow().get_u_int64_field());
+                assert_eq!(-1.25e-10, sub_reader.reborrow().get_float32_field());
+                assert_eq!(345f64, sub_reader.reborrow().get_float64_field());
+                assert_eq!("baz", &*sub_reader.reborrow().get_text_field().unwrap());
+                assert_eq!(b"qux", &*sub_reader.reborrow().get_data_field().unwrap());
                 {
-                    let mut sub_sub_reader = sub_reader.borrow().get_struct_field().unwrap();
-                    assert_eq!("nested", &*sub_sub_reader.borrow().get_text_field().unwrap());
+                    let mut sub_sub_reader = sub_reader.reborrow().get_struct_field().unwrap();
+                    assert_eq!("nested", &*sub_sub_reader.reborrow().get_text_field().unwrap());
                     assert_eq!("really nested", &*sub_sub_reader.get_struct_field().unwrap()
                                                                 .get_text_field().unwrap());
                 }
-                assert!(Ok(TestEnum::Baz) == sub_reader.borrow().get_enum_field());
-                assert_eq!(3, sub_reader.borrow().get_void_list().unwrap().len());
+                assert!(Ok(TestEnum::Baz) == sub_reader.reborrow().get_enum_field());
+                assert_eq!(3, sub_reader.reborrow().get_void_list().unwrap().len());
 
                 {
-                    let bool_list = sub_reader.borrow().get_bool_list().unwrap();
+                    let bool_list = sub_reader.reborrow().get_bool_list().unwrap();
                     assert_eq!(5, bool_list.len());
                     assert_eq!(false, bool_list.get(0));
                     assert_eq!(true, bool_list.get(1));
@@ -177,7 +177,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int8_list = sub_reader.borrow().get_int8_list().unwrap();
+                    let int8_list = sub_reader.reborrow().get_int8_list().unwrap();
                     assert_eq!(4, int8_list.len());
                     assert_eq!(12, int8_list.get(0));
                     assert_eq!(-34, int8_list.get(1));
@@ -186,7 +186,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int16_list = sub_reader.borrow().get_int16_list().unwrap();
+                    let int16_list = sub_reader.reborrow().get_int16_list().unwrap();
                     assert_eq!(4, int16_list.len());
                     assert_eq!(1234, int16_list.get(0));
                     assert_eq!(-5678, int16_list.get(1));
@@ -195,7 +195,7 @@ check_test_message_impl(($typ:ident) => (
                 }
 
                 {
-                    let int32_list = sub_reader.borrow().get_int32_list().unwrap();
+                    let int32_list = sub_reader.reborrow().get_int32_list().unwrap();
                     assert_eq!(4, int32_list.len());
                     assert_eq!(12345678, int32_list.get(0));
                     assert_eq!(-90123456, int32_list.get(1));
@@ -206,11 +206,11 @@ check_test_message_impl(($typ:ident) => (
                 // ...
 
                 {
-                    let mut struct_list = sub_reader.borrow().get_struct_list().unwrap();
+                    let mut struct_list = sub_reader.reborrow().get_struct_list().unwrap();
                     assert_eq!(3, struct_list.len());
-                    assert_eq!("x structlist 1", &*struct_list.borrow().get(0).get_text_field().unwrap());
-                    assert_eq!("x structlist 2", &*struct_list.borrow().get(1).get_text_field().unwrap());
-                    assert_eq!("x structlist 3", &*struct_list.borrow().get(2).get_text_field().unwrap());
+                    assert_eq!("x structlist 1", &*struct_list.reborrow().get(0).get_text_field().unwrap());
+                    assert_eq!("x structlist 2", &*struct_list.reborrow().get(1).get_text_field().unwrap());
+                    assert_eq!("x structlist 3", &*struct_list.reborrow().get(2).get_text_field().unwrap());
                 }
 
                 {