about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-01-24 22:15:08 +0200
committerEduard Burtescu <edy.burt@gmail.com>2015-01-26 04:15:09 +0200
commit9690be5ece5960d0bd8ecb68750b577b0835b6ba (patch)
treedf529121026e676c75385f1f12019592709b24c0 /src
parente0afa82c67813f6ddb0526e130c1524cf52c61e7 (diff)
downloadrust-9690be5ece5960d0bd8ecb68750b577b0835b6ba.tar.gz
rust-9690be5ece5960d0bd8ecb68750b577b0835b6ba.zip
Adjust most comments and messages to not use "unboxed".
Diffstat (limited to 'src')
-rw-r--r--src/librustc/metadata/encoder.rs4
-rw-r--r--src/librustc/metadata/tydecode.rs2
-rw-r--r--src/librustc/middle/traits/mod.rs7
-rw-r--r--src/librustc/middle/traits/select.rs8
-rw-r--r--src/librustc/middle/ty.rs23
-rw-r--r--src/librustc_trans/trans/callee.rs2
-rw-r--r--src/librustc_trans/trans/closure.rs13
-rw-r--r--src/librustc_trans/trans/expr.rs4
-rw-r--r--src/librustc_typeck/check/closure.rs2
-rw-r--r--src/librustc_typeck/check/method/probe.rs2
-rw-r--r--src/librustc_typeck/check/regionmanip.rs4
-rw-r--r--src/librustc_typeck/check/writeback.rs3
-rw-r--r--src/librustc_typeck/diagnostics.rs2
-rw-r--r--src/librustc_typeck/variance.rs2
-rw-r--r--src/libsyntax/parse/parser.rs2
15 files changed, 36 insertions, 44 deletions
diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs
index 59465067f4a..2de45381249 100644
--- a/src/librustc/metadata/encoder.rs
+++ b/src/librustc/metadata/encoder.rs
@@ -2148,7 +2148,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
     encode_macro_defs(&mut rbml_w, krate);
     stats.macro_defs_bytes = rbml_w.writer.tell().unwrap() - i;
 
-    // Encode the types of all unboxed closures in this crate.
+    // Encode the types of all closures in this crate.
     i = rbml_w.writer.tell().unwrap();
     encode_closures(&ecx, &mut rbml_w);
     stats.closure_bytes = rbml_w.writer.tell().unwrap() - i;
@@ -2193,7 +2193,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
         println!("          native bytes: {}", stats.native_lib_bytes);
         println!("plugin registrar bytes: {}", stats.plugin_registrar_fn_bytes);
         println!("       macro def bytes: {}", stats.macro_defs_bytes);
-        println!(" unboxed closure bytes: {}", stats.unboxed_closure_bytes);
+        println!("         closure bytes: {}", stats.closure_bytes);
         println!("            impl bytes: {}", stats.impl_bytes);
         println!("            misc bytes: {}", stats.misc_bytes);
         println!("            item bytes: {}", stats.item_bytes);
diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs
index ecf40b0f1fc..cb6b7e56b57 100644
--- a/src/librustc/metadata/tydecode.rs
+++ b/src/librustc/metadata/tydecode.rs
@@ -57,7 +57,7 @@ pub enum DefIdSource {
     // Identifies a region parameter (`fn foo<'X>() { ... }`).
     RegionParameter,
 
-    // Identifies an unboxed closure
+    // Identifies a closure
     ClosureSource
 }
 
diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs
index 6e65301c517..8d3888fcfdb 100644
--- a/src/librustc/middle/traits/mod.rs
+++ b/src/librustc/middle/traits/mod.rs
@@ -232,10 +232,9 @@ pub enum Vtable<'tcx, N> {
     /// Successful resolution for a builtin trait.
     VtableBuiltin(VtableBuiltinData<N>),
 
-    /// Vtable automatically generated for an unboxed closure. The def
-    /// ID is the ID of the closure expression. This is a `VtableImpl`
-    /// in spirit, but the impl is generated by the compiler and does
-    /// not appear in the source.
+    /// Vtable automatically generated for a closure. The def ID is the ID
+    /// of the closure expression. This is a `VtableImpl` in spirit, but the
+    /// impl is generated by the compiler and does not appear in the source.
     VtableClosure(ast::DefId, subst::Substs<'tcx>),
 
     /// Same as above, but for a fn pointer type with the given signature.
diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs
index abd669bc36c..b2e8bbe059f 100644
--- a/src/librustc/middle/traits/select.rs
+++ b/src/librustc/middle/traits/select.rs
@@ -943,9 +943,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     }
 
     /// Check for the artificial impl that the compiler will create for an obligation like `X :
-    /// FnMut<..>` where `X` is an unboxed closure type.
+    /// FnMut<..>` where `X` is a closure type.
     ///
-    /// Note: the type parameters on an unboxed closure candidate are modeled as *output* type
+    /// Note: the type parameters on a closure candidate are modeled as *output* type
     /// parameters and hence do not affect whether this trait is a match or not. They will be
     /// unified during the confirmation step.
     fn assemble_closure_candidates(&mut self,
@@ -1932,7 +1932,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
                                      trait_ref)
     }
 
-    /// In the case of unboxed closure types and fn pointers,
+    /// In the case of closure types and fn pointers,
     /// we currently treat the input type parameters on the trait as
     /// outputs. This means that when we have a match we have only
     /// considered the self type, so we have to go back and make sure
@@ -1942,7 +1942,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     /// errors as if there is no applicable impl, but rather report
     /// errors are about mismatched argument types.
     ///
-    /// Here is an example. Imagine we have an unboxed closure expression
+    /// Here is an example. Imagine we have an closure expression
     /// and we desugared it so that the type of the expression is
     /// `Closure`, and `Closure` expects an int as argument. Then it
     /// is "as if" the compiler generated this impl:
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index f6bc9d09872..0ee26ce1cd3 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -432,7 +432,7 @@ pub enum MethodOrigin<'tcx> {
     // fully statically resolved method
     MethodStatic(ast::DefId),
 
-    // fully statically resolved unboxed closure invocation
+    // fully statically resolved closure invocation
     MethodStaticClosure(ast::DefId),
 
     // method invoked on a type parameter with a bounded trait
@@ -565,7 +565,7 @@ pub enum vtable_origin<'tcx> {
     vtable_param(param_index, uint),
 
     /*
-      Vtable automatically generated for an unboxed closure. The def ID is the
+      Vtable automatically generated for a closure. The def ID is the
       ID of the closure expression.
      */
     vtable_closure(ast::DefId),
@@ -785,8 +785,8 @@ pub struct ctxt<'tcx> {
 
     pub dependency_formats: RefCell<dependency_format::Dependencies>,
 
-    /// Records the type of each unboxed closure. The def ID is the ID of the
-    /// expression defining the unboxed closure.
+    /// Records the type of each closure. The def ID is the ID of the
+    /// expression defining the closure.
     pub closures: RefCell<DefIdMap<Closure<'tcx>>>,
 
     pub node_lint_levels: RefCell<FnvHashMap<(ast::NodeId, lint::LintId),
@@ -2262,12 +2262,12 @@ pub struct ItemSubsts<'tcx> {
     pub substs: Substs<'tcx>,
 }
 
-/// Records information about each unboxed closure.
+/// Records information about each closure.
 #[derive(Clone)]
 pub struct Closure<'tcx> {
-    /// The type of the unboxed closure.
+    /// The type of the closure.
     pub closure_type: ClosureTy<'tcx>,
-    /// The kind of unboxed closure this is.
+    /// The kind of closure this is.
     pub kind: ClosureKind,
 }
 
@@ -3416,8 +3416,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
             }
 
             ty_closure(did, r, substs) => {
-                // FIXME(#14449): `borrowed_contents` below assumes `&mut`
-                // unboxed closure.
+                // FIXME(#14449): `borrowed_contents` below assumes `&mut` closure.
                 let param_env = ty::empty_parameter_environment(cx);
                 let upvars = closure_upvars(&param_env, did, substs).unwrap();
                 TypeContents::union(upvars.as_slice(),
@@ -3685,7 +3684,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool {
             ty_infer(_) |
             ty_closure(..) => {
                 // this check is run on type definitions, so we don't expect to see
-                // inference by-products or unboxed closure types
+                // inference by-products or closure types
                 cx.sess.bug(format!("requires check invoked on inapplicable type: {:?}",
                                     ty).as_slice())
             }
@@ -3778,8 +3777,8 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>)
                 find_nonrepresentable(cx, sp, seen, iter)
             }
             ty_closure(..) => {
-                // this check is run on type definitions, so we don't expect to see
-                // unboxed closure types
+                // this check is run on type definitions, so we don't expect
+                // to see closure types
                 cx.sess.bug(format!("requires check invoked on inapplicable type: {:?}",
                                     ty).as_slice())
             }
diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs
index 06fb743c495..73d174c2c34 100644
--- a/src/librustc_trans/trans/callee.rs
+++ b/src/librustc_trans/trans/callee.rs
@@ -457,7 +457,7 @@ pub fn trans_fn_ref_with_substs<'a, 'tcx>(
         }
     };
 
-    // If this is an unboxed closure, redirect to it.
+    // If this is a closure, redirect to it.
     match closure::get_or_create_declaration_if_closure(ccx, def_id, &substs) {
         None => {}
         Some(llfn) => return llfn,
diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs
index 9001b842cc8..c1914ce94aa 100644
--- a/src/librustc_trans/trans/closure.rs
+++ b/src/librustc_trans/trans/closure.rs
@@ -133,14 +133,14 @@ impl<'a, 'tcx> ClosureEnv<'a, 'tcx> {
     }
 }
 
-/// Returns the LLVM function declaration for an unboxed closure, creating it
-/// if necessary. If the ID does not correspond to a closure ID, returns None.
-        // Not an unboxed closure.
+/// Returns the LLVM function declaration for a closure, creating it if
+/// necessary. If the ID does not correspond to a closure ID, returns None.
 pub fn get_or_create_declaration_if_closure<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                                       closure_id: ast::DefId,
                                                       substs: &Substs<'tcx>)
                                                       -> Option<Datum<'tcx, Rvalue>> {
     if !ccx.tcx().closures.borrow().contains_key(&closure_id) {
+        // Not a closure.
         return None
     }
 
@@ -161,8 +161,7 @@ pub fn get_or_create_declaration_if_closure<'a, 'tcx>(ccx: &CrateContext<'a, 'tc
 
     match ccx.closure_vals().borrow().get(&mono_id) {
         Some(&llfn) => {
-            debug!("get_or_create_declaration_if_closure(): found \
-                    closure");
+            debug!("get_or_create_declaration_if_closure(): found closure");
             return Some(Datum::new(llfn, function_type, Rvalue::new(ByValue)))
         }
         None => {}
@@ -230,8 +229,8 @@ pub fn trans_closure_expr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
                                   Closure(freevar_mode)));
 
     // Don't hoist this to the top of the function. It's perfectly legitimate
-    // to have a zero-size unboxed closure (in which case dest will be
-    // `Ignore`) and we must still generate the closure body.
+    // to have a zero-size closure (in which case dest will be `Ignore`) and
+    // we must still generate the closure body.
     let dest_addr = match dest {
         expr::SaveIn(p) => p,
         expr::Ignore => {
diff --git a/src/librustc_trans/trans/expr.rs b/src/librustc_trans/trans/expr.rs
index 595212ad053..1504c2a7c2d 100644
--- a/src/librustc_trans/trans/expr.rs
+++ b/src/librustc_trans/trans/expr.rs
@@ -1098,10 +1098,6 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             tvec::trans_fixed_vstore(bcx, expr, dest)
         }
         ast::ExprClosure(_, _, ref decl, ref body) => {
-            // Check the side-table to see whether this is an unboxed
-            // closure or an older, legacy style closure. Store this
-            // into a variable to ensure the the RefCell-lock is
-            // released before we recurse.
             closure::trans_closure_expr(bcx, &**decl, &**body, expr.id, dest)
         }
         ast::ExprCall(ref f, ref args) => {
diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs
index 76ed88eb82d..2d7a7634472 100644
--- a/src/librustc_typeck/check/closure.rs
+++ b/src/librustc_typeck/check/closure.rs
@@ -42,7 +42,7 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
             // If users didn't specify what sort of closure they want,
             // examine the expected type. For now, if we see explicit
             // evidence than an unboxed closure is desired, we'll use
-            // that, otherwise we'll fall back to boxed closures.
+            // that, otherwise we'll error, requesting an annotation.
             match expected_sig_and_kind {
                 None => { // don't have information about the kind, request explicit annotation
                     // NB We still need to typeck the body, so assume `FnMut` kind just for that
diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs
index 959120aae66..61332ada506 100644
--- a/src/librustc_typeck/check/method/probe.rs
+++ b/src/librustc_typeck/check/method/probe.rs
@@ -603,7 +603,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
                 None => {
                     self.tcx().sess.span_bug(
                         self.span,
-                        &format!("No entry for unboxed closure: {}",
+                        &format!("No entry for closure: {}",
                                 closure_def_id.repr(self.tcx()))[]);
                 }
             };
diff --git a/src/librustc_typeck/check/regionmanip.rs b/src/librustc_typeck/check/regionmanip.rs
index 4056800c0d1..58e8a9c6912 100644
--- a/src/librustc_typeck/check/regionmanip.rs
+++ b/src/librustc_typeck/check/regionmanip.rs
@@ -69,7 +69,7 @@ impl<'a, 'tcx> Wf<'a, 'tcx> {
             }
 
             ty::ty_closure(_, region, _) => {
-                // An "unboxed closure type" is basically
+                // An "closure type" is basically
                 // modeled here as equivalent to a struct like
                 //
                 //     struct TheClosure<'b> {
@@ -79,7 +79,7 @@ impl<'a, 'tcx> Wf<'a, 'tcx> {
                 // where the `'b` is the lifetime bound of the
                 // contents (i.e., all contents must outlive 'b).
                 //
-                // Even though unboxed closures are glorified structs
+                // Even though closures are glorified structs
                 // of upvars, we do not need to consider them as they
                 // can't generate any new constraints.  The
                 // substitutions on the closure are equal to the free
diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs
index 1c16ab82867..2fd33983fd3 100644
--- a/src/librustc_typeck/check/writeback.rs
+++ b/src/librustc_typeck/check/writeback.rs
@@ -409,8 +409,7 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
                 ResolvingClosure(_) => {
                     let span = self.reason.span(self.tcx);
                     span_err!(self.tcx.sess, span, E0196,
-                                           "cannot determine a type for this \
-                                            unboxed closure")
+                              "cannot determine a type for this closure")
                 }
             }
         }
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 3627fa41160..680ff2fcda6 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -113,7 +113,7 @@ register_diagnostics! {
            // involving type parameters
     E0194,
     E0195, // lifetime parameters or bounds on method do not match the trait declaration
-    E0196, // cannot determine a type for this unboxed closure
+    E0196, // cannot determine a type for this closure
     E0197, // inherent impls cannot be declared as unsafe
     E0198, // negative implementations are not unsafe
     E0199, // implementing trait is not unsafe
diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs
index 1bf5c3fbd07..ed8a50110e5 100644
--- a/src/librustc_typeck/variance.rs
+++ b/src/librustc_typeck/variance.rs
@@ -741,7 +741,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
             }
 
             ty::ty_closure(..) => {
-                self.tcx().sess.bug("Unexpected unboxed closure type in variance computation");
+                self.tcx().sess.bug("Unexpected closure type in variance computation");
             }
 
             ty::ty_rptr(region, ref mt) => {
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 37f95bffe27..eab24574bb1 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1133,7 +1133,7 @@ impl<'a> Parser<'a> {
         TyInfer
     }
 
-    /// Parses an optional unboxed closure kind (`&:`, `&mut:`, or `:`).
+    /// Parses an optional closure kind (`&:`, `&mut:`, or `:`).
     pub fn parse_optional_closure_kind(&mut self) -> Option<ClosureKind> {
         if self.check(&token::BinOp(token::And)) &&
                 self.look_ahead(1, |t| t.is_keyword(keywords::Mut)) &&