about summary refs log tree commit diff
path: root/src/librustc/middle/astencode.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2014-12-26 03:31:58 -0500
committerNiko Matsakis <niko@alum.mit.edu>2014-12-30 09:36:21 -0500
commit82787c2252267561777303bcc4e4d0394c34e5c9 (patch)
tree835d7dc142041e2f3b85afe01a01b8ccf5c4a092 /src/librustc/middle/astencode.rs
parent4404592f3631233c2f160c3f9a315764a4fcfba9 (diff)
downloadrust-82787c2252267561777303bcc4e4d0394c34e5c9.tar.gz
rust-82787c2252267561777303bcc4e4d0394c34e5c9.zip
Convert to use `Rc<TraitRef>` in object types (finally!).
Diffstat (limited to 'src/librustc/middle/astencode.rs')
-rw-r--r--src/librustc/middle/astencode.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index 57dac607fa6..4dee3ee4713 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -1120,7 +1120,7 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
                     this.emit_enum_variant("UnsizeVtable", 2, 4, |this| {
                         this.emit_enum_variant_arg(0, |this| {
                             try!(this.emit_struct_field("principal", 0, |this| {
-                                Ok(this.emit_trait_ref(ecx, &principal.0))
+                                Ok(this.emit_trait_ref(ecx, &*principal.0))
                             }));
                             this.emit_struct_field("bounds", 1, |this| {
                                 Ok(this.emit_existential_bounds(ecx, b))
@@ -1546,7 +1546,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
 
     fn read_trait_ref<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)
                               -> Rc<ty::TraitRef<'tcx>> {
-        Rc::new(self.read_opaque(|this, doc| {
+        self.read_opaque(|this, doc| {
             let ty = tydecode::parse_trait_ref_data(
                 doc.data,
                 dcx.cdata.cnum,
@@ -1554,12 +1554,12 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
                 dcx.tcx,
                 |s, a| this.convert_def_id(dcx, s, a));
             Ok(ty)
-        }).unwrap())
+        }).unwrap()
     }
 
     fn read_poly_trait_ref<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)
                                    -> ty::PolyTraitRef<'tcx> {
-        ty::Binder(Rc::new(self.read_opaque(|this, doc| {
+        ty::Binder(self.read_opaque(|this, doc| {
             let ty = tydecode::parse_trait_ref_data(
                 doc.data,
                 dcx.cdata.cnum,
@@ -1567,7 +1567,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
                 dcx.tcx,
                 |s, a| this.convert_def_id(dcx, s, a));
             Ok(ty)
-        }).unwrap()))
+        }).unwrap())
     }
 
     fn read_type_param_def<'b, 'c>(&mut self, dcx: &DecodeContext<'b, 'c, 'tcx>)
@@ -1786,7 +1786,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
                                 Ok(this.read_poly_trait_ref(dcx))
                             }));
                             Ok(ty::TyTrait {
-                                principal: ty::Binder((*principal.0).clone()),
+                                principal: principal,
                                 bounds: try!(this.read_struct_field("bounds", 1, |this| {
                                     Ok(this.read_existential_bounds(dcx))
                                 })),