Skip to content

Commit

Permalink
update to rust breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
TeXitoi authored and stepancheg committed Nov 28, 2014
1 parent ea6b2c4 commit 29d61df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ impl EnumValue {

struct IndentWriter<'a> {
// TODO: add mut
writer: &'a Writer + 'a,
writer: &'a (Writer + 'a),
indent: String,
msg: Option<&'a MessageInfo<'a>>,
field: Option<&'a Field>,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ trait FieldAccessorGeneric {
}

struct FieldAccessorGenericImpl<M> {
accessor: &'static FieldAccessor<M> + 'static
accessor: &'static (FieldAccessor<M> + 'static)
}

impl<M : Message> FieldAccessorGenericImpl<M> {
fn new(a: &'static FieldAccessor<M> + 'static) -> FieldAccessorGenericImpl<M> {
fn new(a: &'static (FieldAccessor<M> + 'static)) -> FieldAccessorGenericImpl<M> {
FieldAccessorGenericImpl {
accessor: a
}
Expand Down Expand Up @@ -258,7 +258,7 @@ pub struct FieldDescriptor {
}

impl FieldDescriptor {
fn new<M : 'static + Message>(a: &'static FieldAccessor<M> + 'static, proto: &'static FieldDescriptorProto)
fn new<M : 'static + Message>(a: &'static (FieldAccessor<M> + 'static), proto: &'static FieldDescriptorProto)
-> FieldDescriptor
{
assert_eq!(proto.get_name(), a.name());
Expand Down Expand Up @@ -425,7 +425,7 @@ impl MessageDescriptor {

pub fn new<M : 'static + Message>(
rust_name: &'static str,
fields: Vec<&'static FieldAccessor<M> + 'static>,
fields: Vec<&'static (FieldAccessor<M> + 'static)>,
file: &'static FileDescriptorProto
) -> MessageDescriptor
{
Expand Down
8 changes: 4 additions & 4 deletions src/lib/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub struct CodedInputStream<'a> {
buffer: MaybeOwnedSlice<'a, u8>,
buffer_size: u32,
buffer_pos: u32,
reader: Option<&'a mut Reader + 'a>,
reader: Option<&'a mut (Reader + 'a)>,
total_bytes_retired: u32,
current_limit: u32,
buffer_size_after_limit: u32,
Expand Down Expand Up @@ -625,7 +625,7 @@ pub trait WithCodedOutputStream {
-> ProtobufResult<T>;
}

impl<'a> WithCodedOutputStream for &'a mut Writer + 'a {
impl<'a> WithCodedOutputStream for &'a mut (Writer + 'a) {
fn with_coded_output_stream<T>(self, cb: |&mut CodedOutputStream| -> ProtobufResult<T>)
-> ProtobufResult<T>
{
Expand Down Expand Up @@ -661,7 +661,7 @@ pub trait WithCodedInputStream {
fn with_coded_input_stream<T>(self, cb: |&mut CodedInputStream| -> T) -> T;
}

impl<'a> WithCodedInputStream for &'a mut Reader + 'a {
impl<'a> WithCodedInputStream for &'a mut (Reader + 'a) {
fn with_coded_input_stream<T>(self, cb: |&mut CodedInputStream| -> T) -> T {
let mut is = CodedInputStream::new(self);
let r = cb(&mut is);
Expand All @@ -687,7 +687,7 @@ pub struct CodedOutputStream<'a> {
buffer: Vec<u8>,
// within buffer
position: u32,
writer: Option<&'a mut Writer + 'a>,
writer: Option<&'a mut (Writer + 'a)>,
}

impl<'a> CodedOutputStream<'a> {
Expand Down

0 comments on commit 29d61df

Please sign in to comment.