Skip to content

Commit d075faa

Browse files
committed
nits
1 parent f8931a7 commit d075faa

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

src/librustc/middle/implicator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a, 'tcx> Implicator<'a, 'tcx> {
120120
//
121121
// Note that `p` (and `'a`) are not used in the
122122
// closure at all, but to meet the requirement that
123-
// the closure type `C: 'static` (so it can be coerce
123+
// the closure type `C: 'static` (so it can be coerced
124124
// to the object type), we get the requirement that
125125
// `'a: 'static` since `'a` appears in the closure
126126
// type `C`.

src/librustc/middle/infer/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1162,10 +1162,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11621162
/// these unconstrained type variables.
11631163
fn resolve_type_vars_or_error(&self, t: &Ty<'tcx>) -> mc::McResult<Ty<'tcx>> {
11641164
let ty = self.resolve_type_vars_if_possible(t);
1165-
if ty.references_error() {
1166-
debug!("resolve_type_vars_or_error: error from {:?}", ty);
1167-
Err(())
1168-
} else if ty.is_ty_var() {
1165+
if ty.references_error() || ty.is_ty_var() {
11691166
debug!("resolve_type_vars_or_error: error from {:?}", ty);
11701167
Err(())
11711168
} else {

src/librustc/middle/ty.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1857,9 +1857,9 @@ pub enum TypeVariants<'tcx> {
18571857
/// closures from capturing themselves (except via a trait
18581858
/// object). This simplifies closure inference considerably, since it
18591859
/// means that when we infer the kind of a closure or its upvars, we
1860-
/// don't have to handles cycles where the decisions we make wind up
1861-
/// for closure C wind up influencing the decisions we ought to make
1862-
/// for closure C (which would then require fixed point iteration to
1860+
/// don't have to handle cycles where the decisions we make for
1861+
/// closure C wind up influencing the decisions we ought to make for
1862+
/// closure C (which would then require fixed point iteration to
18631863
/// handle). Plus it fixes an ICE. :P
18641864
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
18651865
pub struct ClosureSubsts<'tcx> {
@@ -7158,8 +7158,6 @@ impl<'tcx> HasTypeFlags for ClosureSubsts<'tcx> {
71587158
}
71597159
}
71607160

7161-
7162-
71637161
impl<'tcx> fmt::Debug for ClosureTy<'tcx> {
71647162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
71657163
write!(f, "ClosureTy({},{:?},{})",

src/librustc_trans/trans/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub fn get_or_create_closure_declaration<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
138138
};
139139

140140
if let Some(&llfn) = ccx.closure_vals().borrow().get(&mono_id) {
141-
debug!("get_or_create_declaration_if_closure(): found closure {:?}: {:?}",
141+
debug!("get_or_create_closure_declaration(): found closure {:?}: {:?}",
142142
mono_id, ccx.tn().val_to_string(llfn));
143143
return llfn;
144144
}

0 commit comments

Comments
 (0)