From 33ae99b2707a6de715f701c8e5c51670f0e72294 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Sun, 26 Oct 2014 15:15:30 -0400 Subject: [PATCH] ugh, lifetimes are broken again. this should at least compile once https://github.com/rust-lang/rust/pull/18235 lands --- compiler_tests/test.rs | 1 - src/capnp/message.rs | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler_tests/test.rs b/compiler_tests/test.rs index 904854a5f..f86438e7a 100644 --- a/compiler_tests/test.rs +++ b/compiler_tests/test.rs @@ -462,5 +462,4 @@ mod tests { assert_eq!(new_version.get_new3().get_int8_field(), -123); } } - } diff --git a/src/capnp/message.rs b/src/capnp/message.rs index f6ffe5128..9f1522028 100644 --- a/src/capnp/message.rs +++ b/src/capnp/message.rs @@ -54,7 +54,7 @@ pub trait MessageReader { fn mut_arena<'a>(&'a mut self) -> &'a mut ReaderArena; fn get_options<'a>(&'a self) -> &'a ReaderOptions; - fn get_root_internal<'a> (&'a self) -> any_pointer::Reader<'a> { + fn get_root_internal(&self) -> any_pointer::Reader<'static> { unsafe { let segment : *const SegmentReader = &self.arena().segment0; @@ -65,7 +65,7 @@ pub trait MessageReader { } } - fn get_root<'a, T : layout::FromStructReader<'a>>(&'a self) -> T { + fn get_root>(&self) -> T { self.get_root_internal().get_as_struct() } @@ -153,7 +153,7 @@ pub trait MessageBuilder { // XXX is there a way to make this private? - fn get_root_internal<'a>(&mut self) -> any_pointer::Builder<'a> { + fn get_root_internal(&mut self) -> any_pointer::Builder<'static> { let root_segment = &mut self.mut_arena().segment0 as *mut SegmentBuilder; if self.arena().segment0.current_size() == 0 { @@ -175,15 +175,15 @@ pub trait MessageBuilder { } - fn init_root<'a, T : FromStructBuilder<'a> + HasStructSize>(&'a mut self) -> T { + fn init_root + HasStructSize>(&mut self) -> T { self.get_root_internal().init_as_struct() } - fn get_root<'a, T : FromStructBuilder<'a> + HasStructSize>(&'a mut self) -> T { + fn get_root + HasStructSize>(&mut self) -> T { self.get_root_internal().get_as_struct() } - fn set_root<'a, T : layout::ToStructReader<'a>>(&'a mut self, value : &T) { + fn set_root>(&mut self, value : &T) { self.get_root_internal().set_as_struct(value); }