]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/ty.rs
rollup merge of #21438: taralx/kill-racycell
[rust.git] / src / librustc / middle / ty.rs
index 8d1a410859091cff82c692b0c58d0a45305e1a70..fe6ecd9977494db1be5bf46d43a2255909b29fa9 100644 (file)
@@ -69,7 +69,7 @@
 use arena::TypedArena;
 use std::borrow::{BorrowFrom, Cow};
 use std::cell::{Cell, RefCell};
-use std::cmp::{self, Ordering};
+use std::cmp;
 use std::fmt::{self, Show};
 use std::hash::{Hash, Writer, SipHasher, Hasher};
 use std::mem;
@@ -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)]
@@ -5047,25 +5045,6 @@ pub fn associated_type_parameter_index(cx: &ctxt,
     cx.sess.bug("couldn't find associated type parameter index")
 }
 
-#[derive(Copy, PartialEq, Eq)]
-pub struct AssociatedTypeInfo {
-    pub def_id: ast::DefId,
-    pub index: uint,
-    pub name: ast::Name,
-}
-
-impl PartialOrd for AssociatedTypeInfo {
-    fn partial_cmp(&self, other: &AssociatedTypeInfo) -> Option<Ordering> {
-        Some(self.index.cmp(&other.index))
-    }
-}
-
-impl Ord for AssociatedTypeInfo {
-    fn cmp(&self, other: &AssociatedTypeInfo) -> Ordering {
-        self.index.cmp(&other.index)
-    }
-}
-
 pub fn trait_item_def_ids(cx: &ctxt, id: ast::DefId)
                           -> Rc<Vec<ImplOrTraitItemId>> {
     lookup_locally_or_in_crate_store("trait_item_def_ids",
@@ -5327,15 +5306,13 @@ pub fn enum_variants<'tcx>(cx: &ctxt<'tcx>, id: ast::DefId)
                                                 discriminant = val as Disr
                                             }
                                             Ok(_) => {
-                                                cx.sess
-                                                  .span_err(e.span,
+                                                span_err!(cx.sess, e.span, E0304,
                                                             "expected signed integer constant");
                                             }
                                             Err(ref err) => {
-                                                cx.sess
-                                                  .span_err(e.span,
-                                                            &format!("expected constant: {}",
-                                                                    *err)[]);
+                                                span_err!(cx.sess, e.span, E0305,
+                                                            "expected constant: {}",
+                                                                    *err);
                                             }
                                         },
                                     None => {}
@@ -5809,9 +5786,9 @@ pub fn eval_repeat_count(tcx: &ctxt, count_expr: &ast::Expr) -> uint {
                 const_eval::const_binary(_) =>
                     "binary array"
             };
-            tcx.sess.span_err(count_expr.span, &format!(
+            span_err!(tcx.sess, count_expr.span, E0306,
                 "expected positive integer for repeat count, found {}",
-                found)[]);
+                found);
         }
         Err(_) => {
             let found = match count_expr.node {
@@ -5824,9 +5801,9 @@ pub fn eval_repeat_count(tcx: &ctxt, count_expr: &ast::Expr) -> uint {
                 _ =>
                     "non-constant expression"
             };
-            tcx.sess.span_err(count_expr.span, &format!(
+            span_err!(tcx.sess, count_expr.span, E0307,
                 "expected constant integer for repeat count, found {}",
-                found)[]);
+                found);
         }
     }
     0
@@ -7296,10 +7273,8 @@ fn references_error(&self) -> bool {
 
 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 +7305,5 @@ fn repr(&self, tcx: &ctxt<'tcx>) -> String {
             self.free_substs.repr(tcx),
             self.implicit_region_bound.repr(tcx),
             self.caller_bounds.repr(tcx))
-        }
     }
+}