]> git.lizzy.rs Git - rust.git/commitdiff
nits
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 24 Jul 2015 01:08:29 +0000 (21:08 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Fri, 24 Jul 2015 08:53:43 +0000 (04:53 -0400)
src/librustc/middle/implicator.rs
src/librustc/middle/infer/mod.rs
src/librustc/middle/ty.rs
src/librustc_trans/trans/closure.rs

index a129039002c5f7eae9617c5d7d371e7d354fcf69..799d9a653ae38be181ba141ecfa92ebefc2a4a73 100644 (file)
@@ -120,7 +120,7 @@ fn accumulate_from_ty(&mut self, ty: Ty<'tcx>) {
                 //
                 // 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`.
index 46cbf9351e06296f3a016bc2d3f4fa3980dad374..a54aee24367721e8b0d93ac5bb73457d922da16d 100644 (file)
@@ -1162,10 +1162,7 @@ pub fn resolve_type_vars_if_possible<T:TypeFoldable<'tcx>>(&self, value: &T) ->
     /// 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 {
index 94b5e7e3a59a99bc6d729c5f63ce82f3de95e159..aa1c8bfaa904fb465080a68cfd41ff6f46e46706 100644 (file)
@@ -1857,9 +1857,9 @@ pub enum TypeVariants<'tcx> {
 /// 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> {
@@ -7158,8 +7158,6 @@ fn has_type_flags(&self, flags: TypeFlags) -> bool {
     }
 }
 
-
-
 impl<'tcx> fmt::Debug for ClosureTy<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "ClosureTy({},{:?},{})",
index b05bc7e5855e8009f9d8a05c7d8d6cb8d54dfbe5..ff89d97c47b1198f63754ae720647d991938aa75 100644 (file)
@@ -138,7 +138,7 @@ pub fn get_or_create_closure_declaration<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     };
 
     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;
     }