//
// Note that `p` (and `'a`) are not used in the
// closure at all, but to meet the requirement that
- // the closure type `C: 'static` (so it can be coerce
+ // the closure type `C: 'static` (so it can be coerced
// to the object type), we get the requirement that
// `'a: 'static` since `'a` appears in the closure
// type `C`.
/// these unconstrained type variables.
fn resolve_type_vars_or_error(&self, t: &Ty<'tcx>) -> mc::McResult<Ty<'tcx>> {
let ty = self.resolve_type_vars_if_possible(t);
- if ty.references_error() {
- debug!("resolve_type_vars_or_error: error from {:?}", ty);
- Err(())
- } else if ty.is_ty_var() {
+ if ty.references_error() || ty.is_ty_var() {
debug!("resolve_type_vars_or_error: error from {:?}", ty);
Err(())
} else {
/// closures from capturing themselves (except via a trait
/// object). This simplifies closure inference considerably, since it
/// means that when we infer the kind of a closure or its upvars, we
-/// don't have to handles cycles where the decisions we make wind up
-/// for closure C wind up influencing the decisions we ought to make
-/// for closure C (which would then require fixed point iteration to
+/// don't have to handle cycles where the decisions we make for
+/// closure C wind up influencing the decisions we ought to make for
+/// closure C (which would then require fixed point iteration to
/// handle). Plus it fixes an ICE. :P
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct ClosureSubsts<'tcx> {
}
}
-
-
impl<'tcx> fmt::Debug for ClosureTy<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "ClosureTy({},{:?},{})",
};
if let Some(&llfn) = ccx.closure_vals().borrow().get(&mono_id) {
- debug!("get_or_create_declaration_if_closure(): found closure {:?}: {:?}",
+ debug!("get_or_create_closure_declaration(): found closure {:?}: {:?}",
mono_id, ccx.tn().val_to_string(llfn));
return llfn;
}