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;
#[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)]
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",
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 => {}
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 {
_ =>
"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
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)
}
self.free_substs.repr(tcx),
self.implicit_region_bound.repr(tcx),
self.caller_bounds.repr(tcx))
- }
}
+}