diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index b41e7f36a261d..591896786ddd0 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue; use crate::mir::interpret::Scalar; use crate::mir::Promoted; use crate::ty::layout::VariantIdx; -use crate::ty::subst::{GenericArgKind, InternalSubsts, Subst, SubstsRef}; +use crate::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, Subst, SubstsRef}; use crate::ty::{ self, AdtDef, DefIdTree, Discr, Ty, TyCtxt, TypeFlags, TypeFoldable, WithConstness, }; @@ -276,6 +276,7 @@ static_assert_size!(TyKind<'_>, 24); /// - U is a type parameter representing the types of its upvars, tupled up /// (borrowed, if appropriate; that is, if an U field represents a by-ref upvar, /// and the up-var has the type `Foo`, then that field of U will be `&Foo`). +/// FIXME(eddyb) update this with the new setup which tuples all synthetics. /// /// So, for example, given this function: /// @@ -364,9 +365,11 @@ pub struct ClosureSubsts<'tcx> { /// Struct returned by `split()`. Note that these are subslices of the /// parent slice and not canonical substs themselves. struct SplitClosureSubsts<'tcx> { + // FIXME(eddyb) maybe replace these with `GenericArg` to avoid having + // `GenericArg::expect_ty` called on all of them when only one is used. closure_kind_ty: Ty<'tcx>, closure_sig_ty: Ty<'tcx>, - tupled_upvars_ty: Ty<'tcx>, + upvars: &'tcx [GenericArg<'tcx>], } impl<'tcx> ClosureSubsts<'tcx> { @@ -374,11 +377,14 @@ impl<'tcx> ClosureSubsts<'tcx> { /// components. Single source of truth with respect to the /// ordering. fn split(self) -> SplitClosureSubsts<'tcx> { - let parent_len = self.substs.len() - 3; + let synthetics = match self.substs[self.substs.len() - 1].expect_ty().kind { + Tuple(synthetics) => synthetics, + _ => bug!("synthetics should be tupled"), + }; SplitClosureSubsts { - closure_kind_ty: self.substs.type_at(parent_len), - closure_sig_ty: self.substs.type_at(parent_len + 1), - tupled_upvars_ty: self.substs.type_at(parent_len + 2), + closure_kind_ty: synthetics.type_at(0), + closure_sig_ty: synthetics.type_at(1), + upvars: &synthetics[2..], } } @@ -388,22 +394,15 @@ impl<'tcx> ClosureSubsts<'tcx> { /// Used primarily by `ty::print::pretty` to be able to handle closure /// types that haven't had their synthetic types substituted in. pub fn is_valid(self) -> bool { - self.substs.len() >= 3 && matches!(self.split().tupled_upvars_ty.kind, Tuple(_)) + match self.substs[self.substs.len() - 1].expect_ty().kind { + Tuple(synthetics) => synthetics.len() >= 2, + _ => false, + } } #[inline] pub fn upvar_tys(self) -> impl Iterator> + 'tcx { - let upvars = match self.split().tupled_upvars_ty.kind { - Tuple(upvars) => upvars, - _ => bug!("upvars should be tupled"), - }; - upvars.iter().map(|t| { - if let GenericArgKind::Type(ty) = t.unpack() { - ty - } else { - bug!("upvar should be type") - } - }) + self.split().upvars.iter().map(|t| t.expect_ty()) } /// Returns the closure kind for this closure; may return a type @@ -454,22 +453,27 @@ pub struct GeneratorSubsts<'tcx> { } struct SplitGeneratorSubsts<'tcx> { + // FIXME(eddyb) maybe replace these with `GenericArg` to avoid having + // `GenericArg::expect_ty` called on all of them when only one is used. resume_ty: Ty<'tcx>, yield_ty: Ty<'tcx>, return_ty: Ty<'tcx>, witness: Ty<'tcx>, - tupled_upvars_ty: Ty<'tcx>, + upvars: &'tcx [GenericArg<'tcx>], } impl<'tcx> GeneratorSubsts<'tcx> { fn split(self) -> SplitGeneratorSubsts<'tcx> { - let parent_len = self.substs.len() - 5; + let synthetics = match self.substs[self.substs.len() - 1].expect_ty().kind { + Tuple(synthetics) => synthetics, + _ => bug!("synthetics should be tupled"), + }; SplitGeneratorSubsts { - resume_ty: self.substs.type_at(parent_len), - yield_ty: self.substs.type_at(parent_len + 1), - return_ty: self.substs.type_at(parent_len + 2), - witness: self.substs.type_at(parent_len + 3), - tupled_upvars_ty: self.substs.type_at(parent_len + 4), + resume_ty: synthetics.type_at(0), + yield_ty: synthetics.type_at(1), + return_ty: synthetics.type_at(2), + witness: synthetics.type_at(3), + upvars: &synthetics[4..], } } @@ -479,7 +483,10 @@ impl<'tcx> GeneratorSubsts<'tcx> { /// Used primarily by `ty::print::pretty` to be able to handle generator /// types that haven't had their synthetic types substituted in. pub fn is_valid(self) -> bool { - self.substs.len() >= 5 && matches!(self.split().tupled_upvars_ty.kind, Tuple(_)) + match self.substs[self.substs.len() - 1].expect_ty().kind { + Tuple(synthetics) => synthetics.len() >= 4, + _ => false, + } } /// This describes the types that can be contained in a generator. @@ -493,17 +500,7 @@ impl<'tcx> GeneratorSubsts<'tcx> { #[inline] pub fn upvar_tys(self) -> impl Iterator> + 'tcx { - let upvars = match self.split().tupled_upvars_ty.kind { - Tuple(upvars) => upvars, - _ => bug!("upvars should be tupled"), - }; - upvars.iter().map(|t| { - if let GenericArgKind::Type(ty) = t.unpack() { - ty - } else { - bug!("upvar should be type") - } - }) + self.split().upvars.iter().map(|t| t.expect_ty()) } /// Returns the type representing the resume type of the generator. @@ -643,13 +640,9 @@ pub enum UpvarSubsts<'tcx> { impl<'tcx> UpvarSubsts<'tcx> { #[inline] pub fn upvar_tys(self) -> impl Iterator> + 'tcx { - let tupled_upvars_ty = match self { - UpvarSubsts::Closure(substs) => substs.as_closure().split().tupled_upvars_ty, - UpvarSubsts::Generator(substs) => substs.as_generator().split().tupled_upvars_ty, - }; - let upvars = match tupled_upvars_ty.kind { - Tuple(upvars) => upvars, - _ => bug!("upvars should be tupled"), + let upvars = match self { + UpvarSubsts::Closure(substs) => substs.as_closure().split().upvars, + UpvarSubsts::Generator(substs) => substs.as_generator().split().upvars, }; upvars.iter().map(|t| { if let GenericArgKind::Type(ty) = t.unpack() { diff --git a/src/librustc_mir/borrow_check/universal_regions.rs b/src/librustc_mir/borrow_check/universal_regions.rs index 30d9e842f205a..9481bc6d131f8 100644 --- a/src/librustc_mir/borrow_check/universal_regions.rs +++ b/src/librustc_mir/borrow_check/universal_regions.rs @@ -329,9 +329,12 @@ impl<'tcx> UniversalRegions<'tcx> { match self.defining_ty { DefiningTy::Closure(def_id, substs) => { err.note(&format!( - "defining type: {} with closure substs {:#?}", + "defining type: {} with closure synthetics {:#?}", tcx.def_path_str_with_substs(def_id, substs), - &substs[tcx.generics_of(def_id).parent_count..], + substs[tcx.generics_of(def_id).parent_count] + .expect_ty() + .tuple_fields() + .collect::>(), )); // FIXME: It'd be nice to print the late-bound regions @@ -346,9 +349,12 @@ impl<'tcx> UniversalRegions<'tcx> { } DefiningTy::Generator(def_id, substs, _) => { err.note(&format!( - "defining type: {} with generator substs {:#?}", + "defining type: {} with generator synthetics {:#?}", tcx.def_path_str_with_substs(def_id, substs), - &substs[tcx.generics_of(def_id).parent_count..], + substs[tcx.generics_of(def_id).parent_count] + .expect_ty() + .tuple_fields() + .collect::>(), )); // FIXME: As above, we'd like to print out the region diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index 97aeddb388c7d..7d9fee4d66997 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -6,7 +6,7 @@ use crate::astconv::AstConv; use crate::middle::{lang_items, region}; use rustc::ty::fold::TypeFoldable; use rustc::ty::subst::InternalSubsts; -use rustc::ty::{self, GenericParamDefKind, Ty}; +use rustc::ty::{self, Ty}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; @@ -82,32 +82,35 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // inference phase (`upvar.rs`). let base_substs = InternalSubsts::identity_for_item(self.tcx, self.tcx.closure_base_def_id(expr_def_id)); - // HACK(eddyb) this hardcodes indices into substs but it should rely on + // HACK(eddyb) this hardcodes the number of synthetics but it should rely on // `ClosureSubsts` and `GeneratorSubsts` providing constructors, instead. // That would also remove the need for most of the inference variables, // as they immediately unified with the actual type below, including // the `InferCtxt::closure_sig` and `ClosureSubsts::sig_ty` methods. - let tupled_upvars_idx = base_substs.len() + if generator_types.is_some() { 4 } else { 2 }; - let substs = base_substs.extend_to(self.tcx, expr_def_id, |param, _| match param.kind { - GenericParamDefKind::Lifetime => span_bug!(expr.span, "closure has lifetime param"), - GenericParamDefKind::Type { .. } => if param.index as usize == tupled_upvars_idx { - self.tcx.mk_tup(self.tcx.upvars(expr_def_id).iter().flat_map(|upvars| { - upvars.iter().map(|(&var_hir_id, _)| { - self.infcx.next_ty_var(TypeVariableOrigin { - // FIXME(eddyb) distinguish upvar inference variables from the rest. - kind: TypeVariableOriginKind::ClosureSynthetic, - span: self.tcx.hir().span(var_hir_id), + let non_upvar_synthetics = if generator_types.is_some() { 4 } else { 2 }; + let substs = base_substs.extend_to(self.tcx, expr_def_id, |param, _| { + assert_eq!(param.index as usize, base_substs.len()); + + self.tcx + .mk_tup( + (0..non_upvar_synthetics) + .map(|_| { + self.infcx.next_ty_var(TypeVariableOrigin { + kind: TypeVariableOriginKind::ClosureSynthetic, + span: expr.span, + }) }) - }) - })) - } else { - self.infcx.next_ty_var(TypeVariableOrigin { - kind: TypeVariableOriginKind::ClosureSynthetic, - span: expr.span, - }) - } - .into(), - GenericParamDefKind::Const => span_bug!(expr.span, "closure has const param"), + .chain(self.tcx.upvars(expr_def_id).iter().flat_map(|upvars| { + upvars.iter().map(|(&var_hir_id, _)| { + self.infcx.next_ty_var(TypeVariableOrigin { + // FIXME(eddyb) distinguish upvar inference variables from the rest. + kind: TypeVariableOriginKind::ClosureSynthetic, + span: self.tcx.hir().span(var_hir_id), + }) + }) + })), + ) + .into() }); if let Some(GeneratorTypes { resume_ty, yield_ty, interior, movability }) = generator_types { diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index d915ed3633fc4..49a72bf2503a9 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1334,19 +1334,13 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics { Some(param_def) })); - // provide junk type parameter defs - the only place that - // cares about anything but the length is instantiation, - // and we don't do that for closures. + // Add a type parameter to hold the tupled closure/generator synthetics. if let Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(.., gen), .. }) = node { - let dummy_args = if gen.is_some() { - &["", "", "", "", ""][..] - } else { - &["", "", ""][..] - }; + let name = if gen.is_some() { "" } else { "" }; - params.extend(dummy_args.iter().enumerate().map(|(i, &arg)| ty::GenericParamDef { - index: type_start + i as u32, - name: Symbol::intern(arg), + params.push(ty::GenericParamDef { + index: type_start, + name: Symbol::intern(name), def_id, pure_wrt_drop: false, kind: ty::GenericParamDefKind::Type { @@ -1354,7 +1348,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics { object_lifetime_default: rl::Set1::Empty, synthetic: None, }, - })); + }); } let param_def_id_to_index = params.iter().map(|param| (param.def_id, param.index)).collect(); diff --git a/src/test/ui/generator/sized-yield.rs b/src/test/ui/generator/sized-yield.rs index c6dd738d6ac60..12d38043e47f0 100644 --- a/src/test/ui/generator/sized-yield.rs +++ b/src/test/ui/generator/sized-yield.rs @@ -11,4 +11,6 @@ fn main() { }; Pin::new(&mut gen).resume(()); //~^ ERROR the size for values of type + //~| ERROR the size for values of type + //~| ERROR the size for values of type } diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr index 79aeec2ec0280..77e787ea5e159 100644 --- a/src/test/ui/generator/sized-yield.stderr +++ b/src/test/ui/generator/sized-yield.stderr @@ -12,6 +12,26 @@ LL | | }; = note: to learn more, visit = note: the yield type of a generator must have a statically known size +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/sized-yield.rs:12:13 + | +LL | Pin::new(&mut gen).resume(()); + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit + = note: only the last element of a tuple may have a dynamically sized type + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/sized-yield.rs:12:4 + | +LL | Pin::new(&mut gen).resume(()); + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit + = note: only the last element of a tuple may have a dynamically sized type + error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/sized-yield.rs:12:23 | @@ -21,6 +41,6 @@ LL | Pin::new(&mut gen).resume(()); = help: the trait `std::marker::Sized` is not implemented for `str` = note: to learn more, visit -error: aborting due to 2 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr index f0d169f419c73..b8811d83493d2 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -4,10 +4,9 @@ note: no external requirements LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) mut &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) i32)), - (), ] error: lifetime may not live long enough diff --git a/src/test/ui/nll/closure-requirements/escape-argument.stderr b/src/test/ui/nll/closure-requirements/escape-argument.stderr index e251e69997eba..25892f559bd00 100644 --- a/src/test/ui/nll/closure-requirements/escape-argument.stderr +++ b/src/test/ui/nll/closure-requirements/escape-argument.stderr @@ -4,10 +4,9 @@ note: no external requirements LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) mut &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)), - (), ] note: no external requirements diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr index 36257700bef0c..71d2ddb065d4b 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr @@ -4,10 +4,11 @@ note: external requirements LL | let mut closure1 = || p = &y; | ^^^^^^^^^ | - = note: defining type: test::{{closure}}#0::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0::{{closure}}#0 with closure synthetics [ i16, extern "rust-call" fn(()), - (&'_#1r i32, &'_#2r mut &'_#3r i32), + &'_#1r i32, + &'_#2r mut &'_#3r i32, ] = note: number of external vids: 4 = note: where '_#1r: '_#3r @@ -22,10 +23,11 @@ LL | | closure1(); LL | | }; | |_________^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, extern "rust-call" fn(()), - (&'_#1r i32, &'_#2r mut &'_#3r i32), + &'_#1r i32, + &'_#2r mut &'_#3r i32, ] = note: number of external vids: 4 = note: where '_#1r: '_#3r diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr index d1c64fac3c1e3..6906ed463dd97 100644 --- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr +++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr @@ -4,10 +4,11 @@ note: external requirements LL | let mut closure = || p = &y; | ^^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, extern "rust-call" fn(()), - (&'_#1r i32, &'_#2r mut &'_#3r i32), + &'_#1r i32, + &'_#2r mut &'_#3r i32, ] = note: number of external vids: 4 = note: where '_#1r: '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 549ebb78d7887..f5bcd79da0a6b 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -8,10 +8,9 @@ LL | | demand_y(x, y, p) LL | | }, | |_________^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), - (), ] = note: late-bound region is '_#4r = note: late-bound region is '_#5r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 346b4af6caac8..b2884e5a1c8f8 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -9,10 +9,9 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), - (), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 3b1769ed3a2ee..cd1b95aec64cd 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -8,10 +8,9 @@ LL | | LL | | }) | |_____^ | - = note: defining type: case1::{{closure}}#0 with closure substs [ + = note: defining type: case1::{{closure}}#0 with closure synthetics [ i32, for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>)), - (), ] error[E0521]: borrowed data escapes outside of closure @@ -47,10 +46,9 @@ LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static LL | | }) | |_____^ | - = note: defining type: case2::{{closure}}#0 with closure substs [ + = note: defining type: case2::{{closure}}#0 with closure synthetics [ i32, for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>)), - (), ] = note: number of external vids: 2 = note: where '_#1r: '_#0r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index b167dafff0136..2daadeba01583 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -10,10 +10,9 @@ LL | | demand_y(x, y, x.get()) LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t2)) u32>)), - (), ] = note: late-bound region is '_#2r = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 91aacc3dff60f..dfbcaf5cf818a 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -10,10 +10,9 @@ LL | | demand_y(x, y, x.get()) LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), - (), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr index ae447708621ed..8f1344770409d 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -9,10 +9,9 @@ LL | | LL | | }); | |_____^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), - (), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index 256446a6e8d8d..eb84dc7b86ac3 100644 --- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -8,10 +8,9 @@ LL | | demand_y(x, y, p) LL | | }, | |_________^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), - (), ] = note: late-bound region is '_#3r = note: number of external vids: 4 diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index 5c156d0d1e378..170bda313f887 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -9,10 +9,9 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>)), - (), ] = note: late-bound region is '_#2r = note: late-bound region is '_#3r diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index 46e3f2e75f49e..4d5a9dc9b0edb 100644 --- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -9,10 +9,9 @@ LL | | LL | | }); | |_____^ | - = note: defining type: supply::{{closure}}#0 with closure substs [ + = note: defining type: supply::{{closure}}#0 with closure synthetics [ i16, for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('s)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed('t3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed('t1)) u32>)), - (), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr index ef941472894b2..bf6cad4f32725 100644 --- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -11,10 +11,9 @@ LL | | require(value); LL | | }); | |_____^ | - = note: defining type: supply::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: supply::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((T,)), - (), ] = note: number of external vids: 2 = note: where T: '_#1r diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr index 2a382030f935c..ff794f5c791b6 100644 --- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -4,10 +4,9 @@ note: no external requirements LL | expect_sig(|a, b| b); // ought to return `a` | ^^^^^^^^ | - = note: defining type: test::{{closure}}#0 with closure substs [ + = note: defining type: test::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed('r)) i32, - (), ] error: lifetime may not live long enough diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 38e59ae3e26ba..e146d4d7212bc 100644 --- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -4,10 +4,9 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, - (), ] = note: number of external vids: 3 = note: where ::Item: '_#2r @@ -40,10 +39,9 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, - (), ] = note: number of external vids: 3 = note: where ::Item: '_#2r @@ -67,10 +65,9 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, - (), ] = note: number of external vids: 4 = note: where ::Item: '_#3r @@ -103,10 +100,9 @@ note: external requirements LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, - (), ] = note: number of external vids: 4 = note: where ::Item: '_#3r diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr index e8aba9d8d4de6..5001b6913bb42 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -4,10 +4,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: late-bound region is '_#3r = note: number of external vids: 4 @@ -55,10 +54,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where T: '_#3r @@ -105,10 +103,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where >::AssocType: '_#3r @@ -133,10 +130,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where T: '_#3r diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index 58ea527d95980..1e788eda6b880 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -4,10 +4,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: late-bound region is '_#3r = note: number of external vids: 4 @@ -46,10 +45,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where '_#2r: '_#3r @@ -87,10 +85,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where >::AssocType: '_#3r @@ -115,10 +112,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where '_#2r: '_#3r @@ -143,10 +139,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: number of external vids: 3 = note: where '_#1r: '_#2r diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr index 3d9a01fec101d..e7a64d55610ce 100644 --- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr @@ -4,10 +4,9 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: late-bound region is '_#3r @@ -30,10 +29,9 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] note: no external requirements @@ -56,10 +54,9 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] note: no external requirements @@ -82,10 +79,9 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] note: no external requirements @@ -108,10 +104,9 @@ note: no external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] note: no external requirements diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index 7c82b14739402..0fb76769a9218 100644 --- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -4,10 +4,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: late-bound region is '_#4r = note: number of external vids: 5 @@ -41,10 +40,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), ] = note: number of external vids: 5 = note: where >::AssocType: '_#4r @@ -77,10 +75,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), ] = note: number of external vids: 5 = note: where >::AssocType: '_#4r @@ -105,10 +102,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), ] = note: number of external vids: 5 = note: where >::AssocType: '_#4r @@ -133,10 +129,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure substs [ + = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), ] = note: number of external vids: 5 = note: where >::AssocType: '_#4r @@ -161,10 +156,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: two_regions::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: two_regions::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: late-bound region is '_#3r = note: number of external vids: 4 @@ -203,10 +197,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where >::AssocType: '_#3r @@ -231,10 +224,9 @@ note: external requirements LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: one_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: number of external vids: 3 = note: where >::AssocType: '_#2r diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index 167ca740c657c..600a052c79850 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -4,10 +4,9 @@ note: external requirements LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ | - = note: defining type: generic::::{{closure}}#0 with closure substs [ + = note: defining type: generic::::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)), - (), ] = note: number of external vids: 2 = note: where T: '_#1r @@ -29,10 +28,9 @@ note: external requirements LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^^^^^^^^^^^^^^ | - = note: defining type: generic_fail::::{{closure}}#0 with closure substs [ + = note: defining type: generic_fail::::{{closure}}#0 with closure synthetics [ i16, for<'r, 's> extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)), - (), ] = note: late-bound region is '_#2r = note: number of external vids: 3 diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 528da502b9d40..ccac56b0e5adf 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -4,10 +4,9 @@ note: external requirements LL | with_signature(x, |y| y) | ^^^^^ | - = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: no_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>, - (), ] = note: number of external vids: 3 = note: where T: '_#2r diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index e341ee48291a9..3c0af7efcf00b 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -11,10 +11,9 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: no_region::::{{closure}}#0 with closure substs [ + = note: defining type: no_region::::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)), - (), ] = note: late-bound region is '_#2r = note: number of external vids: 3 @@ -62,10 +61,9 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: correct_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: number of external vids: 3 = note: where T: '_#2r @@ -95,10 +93,9 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: wrong_region::<'_#1r, T>::{{closure}}#0 with closure substs [ + = note: defining type: wrong_region::<'_#1r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), ] = note: late-bound region is '_#3r = note: number of external vids: 4 @@ -141,10 +138,9 @@ LL | | require(&x, &y) LL | | }) | |_____^ | - = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure substs [ + = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{{closure}}#0 with closure synthetics [ i32, extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), ] = note: number of external vids: 4 = note: where T: '_#3r