about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/metadata/tydecode.rs12
-rw-r--r--src/librustc/metadata/tyencode.rs9
-rw-r--r--src/librustc/middle/ty.rs10
-rw-r--r--src/librustc/middle/ty_fold.rs2
-rw-r--r--src/librustc/util/ppaux.rs19
-rw-r--r--src/librustc_trans/trans/debuginfo.rs19
-rw-r--r--src/librustc_typeck/astconv.rs4
-rw-r--r--src/librustc_typeck/check/closure.rs8
8 files changed, 7 insertions, 76 deletions
diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs
index d18c12b308d..861aaa36103 100644
--- a/src/librustc/metadata/tydecode.rs
+++ b/src/librustc/metadata/tydecode.rs
@@ -628,14 +628,6 @@ fn parse_abi_set(st: &mut PState) -> abi::Abi {
     })
 }
 
-fn parse_onceness(c: char) -> ast::Onceness {
-    match c {
-        'o' => ast::Once,
-        'm' => ast::Many,
-        _ => panic!("parse_onceness: bad onceness")
-    }
-}
-
 fn parse_closure_ty<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>,
                                  mut conv: F) -> ty::ClosureTy<'tcx> where
     F: FnMut(DefIdSource, ast::DefId) -> ast::DefId,
@@ -648,14 +640,10 @@ fn parse_closure_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>,
     F: FnMut(DefIdSource, ast::DefId) -> ast::DefId,
 {
     let unsafety = parse_unsafety(next(st));
-    let onceness = parse_onceness(next(st));
-    let bounds = parse_existential_bounds_(st, conv);
     let sig = parse_sig_(st, conv);
     let abi = parse_abi_set(st);
     ty::ClosureTy {
         unsafety: unsafety,
-        onceness: onceness,
-        bounds: bounds,
         sig: sig,
         abi: abi,
     }
diff --git a/src/librustc/metadata/tyencode.rs b/src/librustc/metadata/tyencode.rs
index 4727c5dddf7..9aead5bf4e7 100644
--- a/src/librustc/metadata/tyencode.rs
+++ b/src/librustc/metadata/tyencode.rs
@@ -318,13 +318,6 @@ fn enc_abi(w: &mut SeekableMemWriter, abi: Abi) {
     mywrite!(w, "]")
 }
 
-fn enc_onceness(w: &mut SeekableMemWriter, o: ast::Onceness) {
-    match o {
-        ast::Once => mywrite!(w, "o"),
-        ast::Many => mywrite!(w, "m")
-    }
-}
-
 pub fn enc_bare_fn_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
                                 ft: &ty::BareFnTy<'tcx>) {
     enc_unsafety(w, ft.unsafety);
@@ -335,8 +328,6 @@ pub fn enc_bare_fn_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
 pub fn enc_closure_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
                                 ft: &ty::ClosureTy<'tcx>) {
     enc_unsafety(w, ft.unsafety);
-    enc_onceness(w, ft.onceness);
-    enc_existential_bounds(w, cx, &ft.bounds);
     enc_fn_sig(w, cx, &ft.sig);
     enc_abi(w, ft.abi);
 }
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 8d1a4108590..6c4d49ab274 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -1032,10 +1032,8 @@ pub struct BareFnTy<'tcx> {
 #[derive(Clone, PartialEq, Eq, Hash, Show)]
 pub struct ClosureTy<'tcx> {
     pub unsafety: ast::Unsafety,
-    pub onceness: ast::Onceness,
-    pub bounds: ExistentialBounds<'tcx>,
-    pub sig: PolyFnSig<'tcx>,
     pub abi: abi::Abi,
+    pub sig: PolyFnSig<'tcx>,
 }
 
 #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
@@ -7296,10 +7294,8 @@ impl ReferencesError for Region
 
 impl<'tcx> Repr<'tcx> for ClosureTy<'tcx> {
     fn repr(&self, tcx: &ctxt<'tcx>) -> String {
-        format!("ClosureTy({},{},{},{},{})",
+        format!("ClosureTy({},{},{})",
                 self.unsafety,
-                self.onceness,
-                self.bounds.repr(tcx),
                 self.sig.repr(tcx),
                 self.abi)
     }
@@ -7330,5 +7326,5 @@ impl<'a, 'tcx> Repr<'tcx> for ParameterEnvironment<'a, 'tcx> {
             self.free_substs.repr(tcx),
             self.implicit_region_bound.repr(tcx),
             self.caller_bounds.repr(tcx))
-        }
     }
+}
\ No newline at end of file
diff --git a/src/librustc/middle/ty_fold.rs b/src/librustc/middle/ty_fold.rs
index c2bbfca07bf..b4e6cff954b 100644
--- a/src/librustc/middle/ty_fold.rs
+++ b/src/librustc/middle/ty_fold.rs
@@ -691,8 +691,6 @@ pub fn super_fold_closure_ty<'tcx, T: TypeFolder<'tcx>>(this: &mut T,
     ty::ClosureTy {
         sig: fty.sig.fold_with(this),
         unsafety: fty.unsafety,
-        onceness: fty.onceness,
-        bounds: fty.bounds.fold_with(this),
         abi: fty.abi,
     }
 }
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs
index ba97331d183..eeed91918cf 100644
--- a/src/librustc/util/ppaux.rs
+++ b/src/librustc/util/ppaux.rs
@@ -276,7 +276,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
             _ => { }
         }
 
-        push_sig_to_string(cx, &mut s, '(', ')', sig, "");
+        push_sig_to_string(cx, &mut s, '(', ')', sig);
 
         match opt_def_id {
             Some(def_id) => {
@@ -302,14 +302,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
             }
         };
 
-        let bounds_str = cty.bounds.user_string(cx);
-
-        match cty.onceness {
-            ast::Many => {}
-            ast::Once => s.push_str("once ")
-        }
-        push_sig_to_string(cx, &mut s, '|', '|', &cty.sig,
-                           &bounds_str[]);
+        push_sig_to_string(cx, &mut s, '|', '|', &cty.sig);
 
         s
     }
@@ -318,8 +311,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
                                 s: &mut String,
                                 bra: char,
                                 ket: char,
-                                sig: &ty::PolyFnSig<'tcx>,
-                                bounds: &str) {
+                                sig: &ty::PolyFnSig<'tcx>) {
         s.push(bra);
         let strs = sig.0.inputs
             .iter()
@@ -331,11 +323,6 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
         }
         s.push(ket);
 
-        if !bounds.is_empty() {
-            s.push_str(":");
-            s.push_str(bounds);
-        }
-
         match sig.0.output {
             ty::FnConverging(t) => {
                 if !ty::type_is_nil(t) {
diff --git a/src/librustc_trans/trans/debuginfo.rs b/src/librustc_trans/trans/debuginfo.rs
index a8a7b7243f1..d6fbb44fc0a 100644
--- a/src/librustc_trans/trans/debuginfo.rs
+++ b/src/librustc_trans/trans/debuginfo.rs
@@ -551,18 +551,13 @@ impl<'tcx> TypeMap<'tcx> {
                                               closure_ty: ty::ClosureTy<'tcx>,
                                               unique_type_id: &mut String) {
         let ty::ClosureTy { unsafety,
-                            onceness,
-                            ref bounds,
                             ref sig,
                             abi: _ } = closure_ty;
+
         if unsafety == ast::Unsafety::Unsafe {
             unique_type_id.push_str("unsafe ");
         }
 
-        if onceness == ast::Once {
-            unique_type_id.push_str("once ");
-        }
-
         unique_type_id.push_str("|");
 
         let sig = ty::erase_late_bound_regions(cx.tcx(), sig);
@@ -592,18 +587,6 @@ impl<'tcx> TypeMap<'tcx> {
                 unique_type_id.push_str("!");
             }
         }
-
-        unique_type_id.push(':');
-
-        for bound in bounds.builtin_bounds.iter() {
-            match bound {
-                ty::BoundSend => unique_type_id.push_str("Send"),
-                ty::BoundSized => unique_type_id.push_str("Sized"),
-                ty::BoundCopy => unique_type_id.push_str("Copy"),
-                ty::BoundSync => unique_type_id.push_str("Sync"),
-            };
-            unique_type_id.push('+');
-        }
     }
 
     // Get the UniqueTypeId for an enum variant. Enum variants are not really
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 44434c2e91b..47a28684940 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1457,8 +1457,6 @@ fn determine_explicit_self_category<'a, 'tcx>(this: &AstConv<'tcx>,
 pub fn ty_of_closure<'tcx>(
     this: &AstConv<'tcx>,
     unsafety: ast::Unsafety,
-    onceness: ast::Onceness,
-    bounds: ty::ExistentialBounds<'tcx>,
     decl: &ast::FnDecl,
     abi: abi::Abi,
     expected_sig: Option<ty::FnSig<'tcx>>)
@@ -1508,8 +1506,6 @@ pub fn ty_of_closure<'tcx>(
 
     ty::ClosureTy {
         unsafety: unsafety,
-        onceness: onceness,
-        bounds: bounds,
         abi: abi,
         sig: ty::Binder(ty::FnSig {inputs: input_tys,
                                    output: output_ty,
diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs
index 4c1083c4b63..9b25910ab91 100644
--- a/src/librustc_typeck/check/closure.rs
+++ b/src/librustc_typeck/check/closure.rs
@@ -89,14 +89,6 @@ fn check_unboxed_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
     let mut fn_ty = astconv::ty_of_closure(
         fcx,
         ast::Unsafety::Normal,
-        ast::Many,
-
-        // The `RegionTraitStore` and region_existential_bounds
-        // are lies, but we ignore them so it doesn't matter.
-        //
-        // FIXME(pcwalton): Refactor this API.
-        ty::region_existential_bound(ty::ReStatic),
-
         decl,
         abi::RustCall,
         expected_sig);