about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-07-23 21:08:29 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-07-24 04:53:43 -0400
commitd075faa2ed2a9290a4ac114ff6e0b87c03e86b98 (patch)
tree805f97d3a875511d67889794bcf06b4b04384aea /src
parentf8931a793346985229d7392620abea50d3e96ac5 (diff)
downloadrust-d075faa2ed2a9290a4ac114ff6e0b87c03e86b98.tar.gz
rust-d075faa2ed2a9290a4ac114ff6e0b87c03e86b98.zip
nits
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/implicator.rs2
-rw-r--r--src/librustc/middle/infer/mod.rs5
-rw-r--r--src/librustc/middle/ty.rs8
-rw-r--r--src/librustc_trans/trans/closure.rs2
4 files changed, 6 insertions, 11 deletions
diff --git a/src/librustc/middle/implicator.rs b/src/librustc/middle/implicator.rs
index a129039002c..799d9a653ae 100644
--- a/src/librustc/middle/implicator.rs
+++ b/src/librustc/middle/implicator.rs
@@ -120,7 +120,7 @@ impl<'a, 'tcx> Implicator<'a, '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`.
diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs
index 46cbf9351e0..a54aee24367 100644
--- a/src/librustc/middle/infer/mod.rs
+++ b/src/librustc/middle/infer/mod.rs
@@ -1162,10 +1162,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
     /// 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 {
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 94b5e7e3a59..aa1c8bfaa90 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -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 @@ impl<'tcx> HasTypeFlags for ClosureSubsts<'tcx> {
     }
 }
 
-
-
 impl<'tcx> fmt::Debug for ClosureTy<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "ClosureTy({},{:?},{})",
diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs
index b05bc7e5855..ff89d97c47b 100644
--- a/src/librustc_trans/trans/closure.rs
+++ b/src/librustc_trans/trans/closure.rs
@@ -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;
     }