Adjust most comments and messages to not use "unboxed".
This commit is contained in:
parent
e0afa82c67
commit
9690be5ece
15 changed files with 36 additions and 44 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ pub enum DefIdSource {
|
|||
// Identifies a region parameter (`fn foo<'X>() { ... }`).
|
||||
RegionParameter,
|
||||
|
||||
// Identifies an unboxed closure
|
||||
// Identifies a closure
|
||||
ClosureSource
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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(¶m_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())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue