diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index aa539516d5e50..c4d130e19dd50 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -772,9 +772,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> // MyNewtype and then the scalar in there). match op.layout.abi { Abi::Uninhabited => { - throw_validation_failure!(self.path, - { "a value of uninhabited type {:?}", op.layout.ty } - ); + ty::print::with_no_trimmed_paths!(throw_validation_failure!(self.path, + { "a value of uninhabited type {}", op.layout.ty } + )); } Abi::Scalar(scalar_layout) => { if !scalar_layout.is_uninit_valid() { diff --git a/compiler/rustc_middle/src/mir/graphviz.rs b/compiler/rustc_middle/src/mir/graphviz.rs index 5de56dad07a41..cdfbc0fc0a3af 100644 --- a/compiler/rustc_middle/src/mir/graphviz.rs +++ b/compiler/rustc_middle/src/mir/graphviz.rs @@ -3,7 +3,6 @@ use rustc_graphviz as dot; use rustc_hir::def_id::DefId; use rustc_middle::mir::*; use rustc_middle::ty::{self, TyCtxt}; -use std::fmt::Debug; use std::io::{self, Write}; use super::generic_graph::mir_fn_to_generic_graph; @@ -122,13 +121,13 @@ fn write_graph_label<'tcx, W: std::fmt::Write>( w, r#"debug {} => {};
"#, var_debug_info.name, - escape(&var_debug_info.value), + dot::escape_html(&format!("{:?}", &var_debug_info.value)), )?; } Ok(()) } -fn escape(t: &T) -> String { - dot::escape_html(&format!("{:?}", t)) +fn escape(t: &T) -> String { + dot::escape_html(&format!("{}", t)) } diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 552af589bec59..75868544b855a 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1061,7 +1061,7 @@ impl<'tcx> Debug for VarDebugInfoContents<'tcx> { VarDebugInfoContents::Const(c) => write!(fmt, "{}", c), VarDebugInfoContents::Place(p) => write!(fmt, "{:?}", p), VarDebugInfoContents::Composite { ty, fragments } => { - write!(fmt, "{:?}{{ ", ty)?; + ty::print::with_no_trimmed_paths!(write!(fmt, "{}{{ ", ty))?; for f in fragments.iter() { write!(fmt, "{:?}, ", f)?; } @@ -1722,7 +1722,8 @@ impl Debug for Place<'_> { write!(fmt, ")")?; } ProjectionElem::Field(field, ty) => { - write!(fmt, ".{:?}: {:?})", field.index(), ty)?; + let ty = ty::print::with_no_trimmed_paths!(format!("{ty}")); + write!(fmt, ".{:?}: {})", field.index(), ty)?; } ProjectionElem::Index(ref index) => { write!(fmt, "[{:?}]", index)?; @@ -2009,7 +2010,8 @@ impl<'tcx> Debug for Rvalue<'tcx> { } Len(ref a) => write!(fmt, "Len({:?})", a), Cast(ref kind, ref place, ref ty) => { - write!(fmt, "{:?} as {:?} ({:?})", place, ty, kind) + let ty = ty::print::with_no_trimmed_paths!(format!("{ty}")); + write!(fmt, "{:?} as {} ({:?})", place, ty, kind) } BinaryOp(ref op, box (ref a, ref b)) => write!(fmt, "{:?}({:?}, {:?})", op, a, b), CheckedBinaryOp(ref op, box (ref a, ref b)) => { @@ -2017,7 +2019,10 @@ impl<'tcx> Debug for Rvalue<'tcx> { } UnaryOp(ref op, ref a) => write!(fmt, "{:?}({:?})", op, a), Discriminant(ref place) => write!(fmt, "discriminant({:?})", place), - NullaryOp(ref op, ref t) => write!(fmt, "{:?}({:?})", op, t), + NullaryOp(ref op, ref t) => { + let t = ty::print::with_no_trimmed_paths!(format!("{t}")); + write!(fmt, "{:?}({})", op, t) + } ThreadLocalRef(did) => ty::tls::with(|tcx| { let muta = tcx.static_mutability(did).unwrap().prefix_str(); write!(fmt, "&/*tls*/ {}{}", muta, tcx.def_path_str(did)) @@ -2144,7 +2149,8 @@ impl<'tcx> Debug for Rvalue<'tcx> { } ShallowInitBox(ref place, ref ty) => { - write!(fmt, "ShallowInitBox({:?}, {:?})", place, ty) + let ty = ty::print::with_no_trimmed_paths!(format!("{ty}")); + write!(fmt, "ShallowInitBox({:?}, {})", place, ty) } } } diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 40289af257ff4..9d363f0afbf87 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -582,8 +582,14 @@ fn write_scope_tree( let mut_str = if local_decl.mutability == Mutability::Mut { "mut " } else { "" }; - let mut indented_decl = - format!("{0:1$}let {2}{3:?}: {4:?}", INDENT, indent, mut_str, local, local_decl.ty); + let mut indented_decl = format!( + "{0:1$}let {2}{3:?}: {4}", + INDENT, + indent, + mut_str, + local, + ty::print::with_no_trimmed_paths!(format!("{}", local_decl.ty)) + ); if let Some(user_ty) = &local_decl.user_ty { for user_ty in user_ty.projections() { write!(indented_decl, " as {:?}", user_ty).unwrap(); @@ -1049,11 +1055,11 @@ fn write_user_type_annotations( for (index, annotation) in body.user_type_annotations.iter_enumerated() { writeln!( w, - "| {:?}: user_ty: {:?}, span: {}, inferred_ty: {:?}", + "| {:?}: user_ty: {:?}, span: {}, inferred_ty: {}", index.index(), annotation.user_ty, tcx.sess.source_map().span_to_embeddable_string(annotation.span), - annotation.inferred_ty, + ty::print::with_no_trimmed_paths!(format!("{}", annotation.inferred_ty)), )?; } if !body.user_type_annotations.is_empty() { diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 034aab0c38ea3..f3b0d6e095cdf 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -108,7 +108,7 @@ impl<'tcx> fmt::Debug for ty::TraitRef<'tcx> { impl<'tcx> fmt::Debug for Ty<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - with_no_trimmed_paths!(fmt::Display::fmt(self, f)) + with_no_trimmed_paths!(fmt::Debug::fmt(self.kind(), f)) } } diff --git a/compiler/rustc_middle/src/ty/typeck_results.rs b/compiler/rustc_middle/src/ty/typeck_results.rs index 79a6c730d7159..b9a6afaacf7e6 100644 --- a/compiler/rustc_middle/src/ty/typeck_results.rs +++ b/compiler/rustc_middle/src/ty/typeck_results.rs @@ -703,7 +703,7 @@ impl<'tcx> CanonicalUserType<'tcx> { /// A user-given type annotation attached to a constant. These arise /// from constants that are named via paths, like `Foo::::new` and /// so forth. -#[derive(Copy, Clone, Debug, PartialEq, TyEncodable, TyDecodable)] +#[derive(Copy, Clone, PartialEq, TyEncodable, TyDecodable)] #[derive(Eq, Hash, HashStable, TypeFoldable, TypeVisitable, Lift)] pub enum UserType<'tcx> { Ty(Ty<'tcx>), @@ -712,3 +712,14 @@ pub enum UserType<'tcx> { /// given substitutions applied. TypeOf(DefId, UserSubsts<'tcx>), } + +impl<'tcx> std::fmt::Debug for UserType<'tcx> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Ty(arg0) => { + ty::print::with_no_trimmed_paths!(f.write_fmt(format_args!("Ty({})", arg0))) + } + Self::TypeOf(arg0, arg1) => f.debug_tuple("TypeOf").field(arg0).field(arg1).finish(), + } + } +} diff --git a/compiler/rustc_passes/src/layout_test.rs b/compiler/rustc_passes/src/layout_test.rs index 827d86780aa8c..acce73ae785bd 100644 --- a/compiler/rustc_passes/src/layout_test.rs +++ b/compiler/rustc_passes/src/layout_test.rs @@ -69,13 +69,15 @@ fn dump_layout_of(tcx: TyCtxt<'_>, item_def_id: LocalDefId, attr: &Attribute) { } sym::debug => { - let normalized_ty = format!( - "{:?}", - tcx.normalize_erasing_regions( - param_env.with_reveal_all_normalized(tcx), - ty, - ) - ); + let normalized_ty = + rustc_middle::ty::print::with_no_trimmed_paths!(format!( + "{}", + tcx.normalize_erasing_regions( + param_env.with_reveal_all_normalized(tcx), + ty, + ) + )); + let ty_layout = format!("{:#?}", *ty_layout); tcx.sess.emit_err(LayoutOf { span: tcx.def_span(item_def_id.to_def_id()), diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index a0730fbb650dc..7b394b895f345 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -458,12 +458,18 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { /// Information about how to pass an argument to, /// or return a value from, a function, under some ABI. -#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)] +#[derive(PartialEq, Eq, Hash, HashStable_Generic)] pub struct ArgAbi<'a, Ty> { pub layout: TyAndLayout<'a, Ty>, pub mode: PassMode, } +impl<'a, Ty: fmt::Debug + fmt::Display> fmt::Debug for ArgAbi<'a, Ty> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ArgAbi").field("layout", &self.layout).field("mode", &self.mode).finish() + } +} + impl<'a, Ty> ArgAbi<'a, Ty> { pub fn new( cx: &impl HasDataLayout, @@ -605,7 +611,7 @@ pub enum Conv { /// /// I will do my best to describe this structure, but these /// comments are reverse-engineered and may be inaccurate. -NDM -#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)] +#[derive(PartialEq, Eq, Hash, HashStable_Generic)] pub struct FnAbi<'a, Ty> { /// The LLVM types of each argument. pub args: Box<[ArgAbi<'a, Ty>]>, @@ -626,6 +632,19 @@ pub struct FnAbi<'a, Ty> { pub can_unwind: bool, } +impl<'a, Ty: fmt::Debug + fmt::Display> fmt::Debug for FnAbi<'a, Ty> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("FnAbi") + .field("args", &self.args) + .field("ret", &self.ret) + .field("c_variadic", &self.c_variadic) + .field("fixed_count", &self.fixed_count) + .field("conv", &self.conv) + .field("can_unwind", &self.can_unwind) + .finish() + } +} + /// Error produced by attempting to adjust a `FnAbi`, for a "foreign" ABI. #[derive(Copy, Clone, Debug, HashStable_Generic)] pub enum AdjustForForeignAbiError { diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs index 39761baf1bc29..fe7dbca4edc18 100644 --- a/compiler/rustc_target/src/abi/mod.rs +++ b/compiler/rustc_target/src/abi/mod.rs @@ -68,12 +68,21 @@ impl<'a> Layout<'a> { /// to that obtained from `layout_of(ty)`, as we need to produce /// layouts for which Rust types do not exist, such as enum variants /// or synthetic fields of enums (i.e., discriminants) and fat pointers. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable_Generic)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] pub struct TyAndLayout<'a, Ty> { pub ty: Ty, pub layout: Layout<'a>, } +impl<'a, Ty: fmt::Debug + fmt::Display> fmt::Debug for TyAndLayout<'a, Ty> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("TyAndLayout") + .field("ty", &format_args!("{}", &self.ty)) + .field("layout", &self.layout) + .finish() + } +} + impl<'a, Ty> Deref for TyAndLayout<'a, Ty> { type Target = &'a LayoutS; fn deref(&self) -> &&'a LayoutS { diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index b35b9d62759c7..46e02517afc50 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -1652,7 +1652,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { ); } else { err.note(&format!( - "`{}` is implemented for `{:?}`, but not for `{:?}`", + "`{}` is implemented for `{}`, but not for `{}`", trait_pred.print_modifiers_and_trait_path(), suggested_ty, trait_pred.skip_binder().self_ty(), diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 378cd5a99ed86..db09e7bb04dcb 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -826,7 +826,7 @@ fn record_layout_for_printing_outlined<'tcx>( // (delay format until we actually need it) let record = |kind, packed, opt_discr_size, variants| { - let type_desc = format!("{:?}", layout.ty); + let type_desc = format!("{}", layout.ty); cx.tcx.sess.code_stats.record_type_size( kind, type_desc, diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir index 1449247aedad3..cc87b27b9cd39 100644 --- a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir +++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir @@ -2,7 +2,13 @@ /* generator_layout = GeneratorLayout { field_tys: { _0: GeneratorSavedTy { - ty: impl std::future::Future, + ty: Alias( + Opaque, + AliasTy { + substs: [], + def_id: DefId(0:7 ~ async_await[672b]::a::{opaque#0}), + }, + ), source_info: SourceInfo { span: $DIR/async_await.rs:15:8: 15:14 (#9), scope: scope[0], @@ -10,7 +16,13 @@ ignore_for_traits: false, }, _1: GeneratorSavedTy { - ty: impl std::future::Future, + ty: Alias( + Opaque, + AliasTy { + substs: [], + def_id: DefId(0:7 ~ async_await[672b]::a::{opaque#0}), + }, + ), source_info: SourceInfo { span: $DIR/async_await.rs:16:8: 16:14 (#12), scope: scope[0], diff --git a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir index afe518642146f..e1342606fc6b9 100644 --- a/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir +++ b/tests/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir @@ -2,7 +2,10 @@ /* generator_layout = GeneratorLayout { field_tys: { _0: GeneratorSavedTy { - ty: std::string::String, + ty: Adt( + std::string::String, + [], + ), source_info: SourceInfo { span: $DIR/generator_drop_cleanup.rs:11:13: 11:15 (#0), scope: scope[0], diff --git a/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir index 2f096c3e0a189..d57168ec65d46 100644 --- a/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir +++ b/tests/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir @@ -2,7 +2,10 @@ /* generator_layout = GeneratorLayout { field_tys: { _0: GeneratorSavedTy { - ty: HasDrop, + ty: Adt( + HasDrop, + [], + ), source_info: SourceInfo { span: $DIR/generator_tiny.rs:20:13: 20:15 (#0), scope: scope[0], diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff index a28da146e3786..b3cfec7fb3f3e 100644 --- a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff +++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff @@ -50,7 +50,7 @@ - bb2: { + // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + // + user_ty: UserType(0) -+ // + literal: Const { ty: alloc::raw_vec::RawVec, val: Unevaluated(alloc::raw_vec::RawVec::::NEW, [u32], None) } ++ // + literal: Const { ty: alloc::raw_vec::RawVec, val: Unevaluated(alloc::raw_vec::RawVec::::NEW, [Uint(U32)], None) } + Deinit(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + (_9.0: alloc::raw_vec::RawVec) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + (_9.1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL diff --git a/tests/mir-opt/issue_99325.main.built.after.mir b/tests/mir-opt/issue_99325.main.built.after.32bit.mir similarity index 96% rename from tests/mir-opt/issue_99325.main.built.after.mir rename to tests/mir-opt/issue_99325.main.built.after.32bit.mir index 3e035c18db862..b770dc1c4c4cf 100644 --- a/tests/mir-opt/issue_99325.main.built.after.mir +++ b/tests/mir-opt/issue_99325.main.built.after.32bit.mir @@ -1,8 +1,8 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} -| 1: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[8f58]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[8f58]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: Ref(ReStatic, Array(Uint(U8), Const { ty: Uint(Usize), kind: Value(Leaf(0x00000004)) }), Not), kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:11:16: 11:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 1: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: Ref(ReStatic, Array(Uint(U8), Const { ty: Uint(Usize), kind: Value(Leaf(0x00000004)) }), Not), kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[8f58]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[8f58]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:12:16: 12:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue_99325.rs:+0:15: +0:15 @@ -71,7 +71,7 @@ fn main() -> () { StorageLive(_4); // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48 _4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48 // mir::Constant - // + span: $DIR/issue_99325.rs:10:16: 10:46 + // + span: $DIR/issue_99325.rs:11:16: 11:46 // + user_ty: UserType(0) // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value() } } @@ -179,7 +179,7 @@ fn main() -> () { StorageLive(_26); // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70 _26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70 // mir::Constant - // + span: $DIR/issue_99325.rs:11:16: 11:68 + // + span: $DIR/issue_99325.rs:12:16: 12:68 // + user_ty: UserType(1) // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value() } } @@ -190,7 +190,7 @@ fn main() -> () { StorageLive(_28); // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79 _28 = const b"AAAA"; // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79 // mir::Constant - // + span: $DIR/issue_99325.rs:11:72: 11:79 + // + span: $DIR/issue_99325.rs:12:72: 12:79 // + literal: Const { ty: &[u8; 4], val: Value(Scalar(alloc4)) } _27 = &_28; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _24 = (move _25, move _27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/tests/mir-opt/issue_99325.main.built.after.64bit.mir b/tests/mir-opt/issue_99325.main.built.after.64bit.mir new file mode 100644 index 0000000000000..a96517075cb61 --- /dev/null +++ b/tests/mir-opt/issue_99325.main.built.after.64bit.mir @@ -0,0 +1,295 @@ +// MIR for `main` after built + +| User Type Annotations +| 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: Ref(ReStatic, Array(Uint(U8), Const { ty: Uint(Usize), kind: Value(Leaf(0x0000000000000004)) }), Not), kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:11:16: 11:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 1: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: Ref(ReStatic, Array(Uint(U8), Const { ty: Uint(Usize), kind: Value(Leaf(0x0000000000000004)) }), Not), kind: Unevaluated(UnevaluatedConst { def: WithOptConstParam { did: DefId(0:8 ~ issue_99325[8f58]::main::{constant#1}), const_param_did: Some(DefId(0:4 ~ issue_99325[8f58]::function_with_bytes::BYTES)) }, substs: [] }) }], user_self_ty: None }) }, span: $DIR/issue_99325.rs:12:16: 12:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| +fn main() -> () { + let mut _0: (); // return place in scope 0 at $DIR/issue_99325.rs:+0:15: +0:15 + let _1: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _2: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _3: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _4: &[u8]; // in scope 0 at $DIR/issue_99325.rs:+1:16: +1:48 + let mut _5: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _6: &[u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+1:50: +1:75 + let _7: [u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+1:51: +1:75 + let _8: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _9: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _13: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _14: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _16: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _17: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _18: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _19: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _20: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _21: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _22: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _23: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _24: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _25: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _26: &[u8]; // in scope 0 at $DIR/issue_99325.rs:+2:16: +2:70 + let mut _27: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _28: &[u8; 4]; // in scope 0 at $DIR/issue_99325.rs:+2:72: +2:79 + let _29: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _30: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _31: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _32: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _33: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _34: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _35: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _37: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _38: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _39: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _40: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _41: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _42: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _43: std::option::Option>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 1 { + debug left_val => _8; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug right_val => _9; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _15: core::panicking::AssertKind; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 2 { + debug kind => _15; // in scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + } + scope 3 { + debug left_val => _29; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + debug right_val => _30; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let _36: core::panicking::AssertKind; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 4 { + debug kind => _36; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + } + + bb0: { + StorageLive(_1); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_4); // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48 + _4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+1:16: +1:48 + // mir::Constant + // + span: $DIR/issue_99325.rs:11:16: 11:46 + // + user_ty: UserType(0) + // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value() } + } + + bb1: { + _3 = &_4; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_6); // scope 0 at $DIR/issue_99325.rs:+1:50: +1:75 + StorageLive(_7); // scope 0 at $DIR/issue_99325.rs:+1:51: +1:75 + _7 = [const 65_u8, const 65_u8, const 65_u8, const 65_u8]; // scope 0 at $DIR/issue_99325.rs:+1:51: +1:75 + _6 = &_7; // scope 0 at $DIR/issue_99325.rs:+1:50: +1:75 + _5 = &_6; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _2 = (move _3, move _5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_5); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + FakeRead(ForMatchedPlace(None), _2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_8); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _8 = (_2.0: &&[u8]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_9); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _9 = (_2.1: &&[u8; 4]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_10); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _12 = &(*_8); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_13); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _13 = &(*_9); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } + } + + bb2: { + StorageDead(_13); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_12); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _10 = Not(move _11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_11); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _10) -> [0: bb4, otherwise: bb3]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb3: { + StorageLive(_15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _15 = core::panicking::AssertKind::Eq; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + FakeRead(ForLet(None), _15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_16); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_17); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _17 = move _15; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_18); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _19 = &(*_8); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _18 = &(*_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_20); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _21 = &(*_9); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _20 = &(*_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _22 = Option::>::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + } + + bb4: { + goto -> bb7; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb5: { + StorageDead(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_20); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_18); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_17); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_19); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_16); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_15); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + unreachable; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb6: { + goto -> bb8; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb7: { + _1 = const (); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + goto -> bb8; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb8: { + StorageDead(_10); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + goto -> bb9; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb9: { + StorageDead(_7); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_6); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_1); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_23); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_26); // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70 + _26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19]; // scope 0 at $DIR/issue_99325.rs:+2:16: +2:70 + // mir::Constant + // + span: $DIR/issue_99325.rs:12:16: 12:68 + // + user_ty: UserType(1) + // + literal: Const { ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}, val: Value() } + } + + bb10: { + _25 = &_26; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_28); // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79 + _28 = const b"AAAA"; // scope 0 at $DIR/issue_99325.rs:+2:72: +2:79 + // mir::Constant + // + span: $DIR/issue_99325.rs:12:72: 12:79 + // + literal: Const { ty: &[u8; 4], val: Value(Scalar(alloc4)) } + _27 = &_28; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _24 = (move _25, move _27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_27); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_25); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + FakeRead(ForMatchedPlace(None), _24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_29); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _29 = (_24.0: &&[u8]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_30); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _30 = (_24.1: &&[u8; 4]); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_31); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _33 = &(*_29); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_34); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _34 = &(*_30); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value() } + } + + bb11: { + StorageDead(_34); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_33); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _31 = Not(move _32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _31) -> [0: bb13, otherwise: bb12]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb12: { + StorageLive(_36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _36 = core::panicking::AssertKind::Eq; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + FakeRead(ForLet(None), _36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_38); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _38 = move _36; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_39); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _40 = &(*_29); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _39 = &(*_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_41); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _42 = &(*_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _41 = &(*_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _43 = Option::>::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + // mir::Constant + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value() } + } + + bb13: { + goto -> bb16; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb14: { + StorageDead(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_41); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_39); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_38); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_40); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_37); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_36); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + unreachable; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb15: { + goto -> bb17; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb16: { + _23 = const (); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + goto -> bb17; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb17: { + StorageDead(_31); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_30); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_29); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + goto -> bb18; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + } + + bb18: { + StorageDead(_28); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_26); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_24); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_23); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue_99325.rs:+0:15: +3:2 + return; // scope 0 at $DIR/issue_99325.rs:+3:2: +3:2 + } + + bb19 (cleanup): { + resume; // scope 0 at $DIR/issue_99325.rs:+0:1: +3:2 + } +} + +alloc4 (size: 4, align: 1) { + 41 41 41 41 │ AAAA +} diff --git a/tests/mir-opt/issue_99325.rs b/tests/mir-opt/issue_99325.rs index fe819cddb2c34..1460d59bc741a 100644 --- a/tests/mir-opt/issue_99325.rs +++ b/tests/mir-opt/issue_99325.rs @@ -5,6 +5,7 @@ pub fn function_with_bytes() -> &'static [u8] { BYTES } +// EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR issue_99325.main.built.after.mir pub fn main() { assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); diff --git a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff index d962ef8cb12dc..c9963bf1a99a3 100644 --- a/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff +++ b/tests/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff @@ -47,7 +47,7 @@ _19 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44 // mir::Constant // + span: $DIR/lower_intrinsics.rs:50:42: 50:44 - // + literal: Const { ty: &i32, val: Unevaluated(discriminant, [T], Some(promoted[2])) } + // + literal: Const { ty: &i32, val: Unevaluated(discriminant, [Param(T/#0)], Some(promoted[2])) } _7 = &(*_19); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44 _6 = &(*_7); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44 - _5 = discriminant_value::(move _6) -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45 @@ -68,7 +68,7 @@ _18 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45 // mir::Constant // + span: $DIR/lower_intrinsics.rs:51:42: 51:45 - // + literal: Const { ty: &(), val: Unevaluated(discriminant, [T], Some(promoted[1])) } + // + literal: Const { ty: &(), val: Unevaluated(discriminant, [Param(T/#0)], Some(promoted[1])) } _11 = &(*_18); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45 _10 = &(*_11); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45 - _9 = discriminant_value::<()>(move _10) -> bb3; // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46 @@ -89,7 +89,7 @@ _17 = const _; // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47 // mir::Constant // + span: $DIR/lower_intrinsics.rs:52:42: 52:47 - // + literal: Const { ty: &E, val: Unevaluated(discriminant, [T], Some(promoted[0])) } + // + literal: Const { ty: &E, val: Unevaluated(discriminant, [Param(T/#0)], Some(promoted[0])) } _15 = &(*_17); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47 _14 = &(*_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47 - _13 = discriminant_value::(move _14) -> bb4; // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48 diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index 798e45df8ca76..6369bf2c0e634 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -22,7 +22,7 @@ | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11 - let mut _1: [usize; Const(Value(Leaf(0x00000003)): usize)]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 + let mut _1: [usize; Const(Value(Leaf(0x00000003)): Uint(Usize))]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17 let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 4767bfc76ed9d..f7260f4664c63 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -22,7 +22,7 @@ | fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/region_subtyping_basic.rs:+0:11: +0:11 - let mut _1: [usize; Const(Value(Leaf(0x0000000000000003)): usize)]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 + let mut _1: [usize; Const(Value(Leaf(0x0000000000000003)): Uint(Usize))]; // in scope 0 at $DIR/region_subtyping_basic.rs:+1:9: +1:14 let _3: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:16: +2:17 let mut _4: usize; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 let mut _5: bool; // in scope 0 at $DIR/region_subtyping_basic.rs:+2:14: +2:18 diff --git a/tests/ui/async-await/async-is-unwindsafe.stderr b/tests/ui/async-await/async-is-unwindsafe.stderr index d6404b30e74f1..9c487da8e1262 100644 --- a/tests/ui/async-await/async-is-unwindsafe.stderr +++ b/tests/ui/async-await/async-is-unwindsafe.stderr @@ -15,7 +15,7 @@ LL | | }); | within this `[async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6]` | = help: within `[async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6]`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>` - = note: `UnwindSafe` is implemented for `&std::task::Context<'_>`, but not for `&mut std::task::Context<'_>` + = note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>` note: future does not implement `UnwindSafe` as this value is used across an await --> $DIR/async-is-unwindsafe.rs:25:17 | diff --git a/tests/ui/chalkify/bugs/async.stderr b/tests/ui/chalkify/bugs/async.stderr index 8043f1e5a0582..ae32e891b19af 100644 --- a/tests/ui/chalkify/bugs/async.stderr +++ b/tests/ui/chalkify/bugs/async.stderr @@ -37,7 +37,7 @@ LL | async fn foo(x: u32) -> u32 { = help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]` = note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited -error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:23:29: 25:2]], def_id: ...) }, Term::Ty(u32)), []), depth=0)` +error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [Generator(...), [Adt(std::future::ResumeTy, []), Tuple([]), Uint(U32), Infer(_#7t), Infer(_#8t)], Static)], def_id: ...) }, Term::Ty(Uint(U32))), []), depth=0)` --> $DIR/async.rs:23:25 | LL | async fn foo(x: u32) -> u32 { diff --git a/tests/ui/closures/binder/nested-closures-regions.stderr b/tests/ui/closures/binder/nested-closures-regions.stderr index b385e0ed6e0a5..c883f0518c1ed 100644 --- a/tests/ui/closures/binder/nested-closures-regions.stderr +++ b/tests/ui/closures/binder/nested-closures-regions.stderr @@ -5,9 +5,22 @@ LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; }; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: main::{closure#0}::{closure#0} with closure substs [ - i8, - extern "rust-call" fn((&(),)), - (), + Int( + I8, + ), + FnPtr( + Binder( + ([Tuple([Ref('_#1r, Tuple([]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrNamed(DefId(0:7 ~ nested_closures_regions[ac46]::main::{closure#0}::{closure#0}::'c), 'c), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#4r = note: late-bound region is '_#2r @@ -22,9 +35,22 @@ LL | for<'a> || -> () { for<'c> |_: &'a ()| -> () {}; }; | ^^^^^^^^^^^^^^^^ | = note: defining type: main::{closure#0} with closure substs [ - i8, - extern "rust-call" fn(()), - (), + Int( + I8, + ), + FnPtr( + Binder( + ([Tuple([])]; c_variadic: false)->Tuple([]), + [ + Region( + BrNamed(DefId(0:5 ~ nested_closures_regions[ac46]::main::{closure#0}::'a), 'a), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#2r diff --git a/tests/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr b/tests/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr index ff89dd340349b..0f80b38aa5932 100644 --- a/tests/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr +++ b/tests/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr @@ -9,7 +9,7 @@ LL | let c1 : () = c; | expected due to this | = note: expected unit type `()` - found closure `[mod1::f::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]` + found closure `[mod1::f::{closure#0} closure_substs=(unavailable) substs=[Param(T/#0), Infer(_#16t), FnPtr(Binder(([Tuple([])]; c_variadic: false)->Tuple([]), [])), Infer(_#15t)]]` help: use parentheses to call this closure | LL | let c1 : () = c(); diff --git a/tests/ui/closures/print/closure-print-generic-verbose-2.stderr b/tests/ui/closures/print/closure-print-generic-verbose-2.stderr index 5bbf84f963d7e..634c5697fa71d 100644 --- a/tests/ui/closures/print/closure-print-generic-verbose-2.stderr +++ b/tests/ui/closures/print/closure-print-generic-verbose-2.stderr @@ -9,7 +9,7 @@ LL | let c1 : () = c; | expected due to this | = note: expected unit type `()` - found closure `[f::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]` + found closure `[f::{closure#0} closure_substs=(unavailable) substs=[Param(T/#0), Infer(_#16t), FnPtr(Binder(([Tuple([])]; c_variadic: false)->Tuple([]), [])), Infer(_#15t)]]` help: use parentheses to call this closure | LL | let c1 : () = c(); diff --git a/tests/ui/closures/print/closure-print-verbose.stderr b/tests/ui/closures/print/closure-print-verbose.stderr index 083717b333408..4a1ead9f787ec 100644 --- a/tests/ui/closures/print/closure-print-verbose.stderr +++ b/tests/ui/closures/print/closure-print-verbose.stderr @@ -7,7 +7,7 @@ LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; | expected due to this | = note: expected fn pointer `fn(u8) -> u8` - found closure `[main::{closure#0} closure_substs=(unavailable) substs=[i8, extern "rust-call" fn((u8,)) -> u8, _#6t]]` + found closure `[main::{closure#0} closure_substs=(unavailable) substs=[Int(I8), FnPtr(Binder(([Tuple([Uint(U8)])]; c_variadic: false)->Uint(U8), [])), Infer(_#6t)]]` note: closures can only be coerced to `fn` types if they do not capture any variables --> $DIR/closure-print-verbose.rs:10:39 | diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr index 7d0a201699b5c..3f70914a8deef 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr @@ -37,7 +37,7 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Adt(Arc, [Adt(RefCell, [Int(I32)])])])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2(t: T) -> impl Generator { diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr index c045b1441c146..3c6213733ff5d 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr @@ -33,7 +33,7 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Adt(Arc, [Adt(RefCell, [Int(I32)])])])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2(t: T) -> impl Generator { diff --git a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr index 7d0a201699b5c..3f70914a8deef 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr @@ -37,7 +37,7 @@ note: required because it's used within this generator | LL | || { | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Arc>])` +note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [Adt(Arc, [Adt(RefCell, [Int(I32)])])])` --> $DIR/generator-print-verbose-1.rs:44:30 | LL | pub fn make_gen2(t: T) -> impl Generator { diff --git a/tests/ui/impl-trait/normalize-tait-in-const.rs b/tests/ui/impl-trait/normalize-tait-in-const.rs index 020bcbb8396c9..c348a792df9d2 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.rs +++ b/tests/ui/impl-trait/normalize-tait-in-const.rs @@ -2,6 +2,7 @@ // failure-status: 101 // normalize-stderr-test "note: .*\n\n" -> "" // normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// normalize-stderr-test "DefId([^)]*)" -> "..." // rustc-env:RUST_BACKTRACE=0 #![feature(type_alias_impl_trait)] diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index b9fc8726ffc0b..f39a43c9059a7 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -1,4 +1,4 @@ -error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize fn(&'a Alias<'b>) {foo} as std::ops::FnOnce<(&&S,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead +error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize Alias(Projection, AliasTy { substs: [FnDef(...), []), Tuple([Ref(ReErased, Ref(ReErased, Adt(S, []), Not), Not)])], def_id: ...) }), maybe try to call `try_normalize_erasing_regions` instead query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `BAR` diff --git a/tests/ui/layout/zero-sized-array-enum-niche.rs b/tests/ui/layout/zero-sized-array-enum-niche.rs index 23bbbfbfc5881..4988fa850694a 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.rs +++ b/tests/ui/layout/zero-sized-array-enum-niche.rs @@ -1,4 +1,5 @@ // normalize-stderr-test "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" +// normalize-stderr-test "Leaf\(0x\d+\)" -> "Leaf(...)" #![feature(rustc_attrs)] #![crate_type = "lib"] @@ -18,7 +19,8 @@ type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of // Here's another case with multiple ZST alignments, where we should // get the maximal alignment and matching size. #[rustc_layout(debug)] -enum MultipleAlignments { //~ ERROR: layout_of +enum MultipleAlignments { + //~^ ERROR: layout_of Align2([u16; 0]), Align4([u32; 0]), Niche(bool), @@ -38,7 +40,9 @@ type NicheLosesToTagged = Result<[u32; 0], Packed>; //~ ER // Should get tag_encoding: Direct, size == align == 4. #[repr(u16)] -enum U16IsZero { _Zero = 0 } +enum U16IsZero { + _Zero = 0, +} #[rustc_layout(debug)] type NicheWinsOverTagged = Result<[u32; 0], Packed>; //~ ERROR: layout_of diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index a3e82070e0f52..ce688655415b6 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -92,7 +92,7 @@ error: layout_of(std::result::Result<[u32; 0], bool>) = Layout { ], }, } - --> $DIR/zero-sized-array-enum-niche.rs:13:1 + --> $DIR/zero-sized-array-enum-niche.rs:14:1 | LL | type AlignedResult = Result<[u32; 0], bool>; | ^^^^^^^^^^^^^^^^^^ @@ -213,7 +213,7 @@ error: layout_of(MultipleAlignments) = Layout { ], }, } - --> $DIR/zero-sized-array-enum-niche.rs:21:1 + --> $DIR/zero-sized-array-enum-niche.rs:22:1 | LL | enum MultipleAlignments { | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -312,7 +312,7 @@ error: layout_of(std::result::Result<[u32; 0], Packed>) = ], }, } - --> $DIR/zero-sized-array-enum-niche.rs:37:1 + --> $DIR/zero-sized-array-enum-niche.rs:39:1 | LL | type NicheLosesToTagged = Result<[u32; 0], Packed>; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -415,7 +415,7 @@ error: layout_of(std::result::Result<[u32; 0], Packed>) = Layout { ], }, } - --> $DIR/zero-sized-array-enum-niche.rs:44:1 + --> $DIR/zero-sized-array-enum-niche.rs:48:1 | LL | type NicheWinsOverTagged = Result<[u32; 0], Packed>; | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr index 363ddfaffe06e..d92144a9c327e 100644 --- a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -5,9 +5,28 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) i32)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Int(I32), Not), Mut), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Int(I32), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + ], + ), + ), + Tuple( + [], + ), ] error: lifetime may not live long enough diff --git a/tests/ui/nll/closure-requirements/escape-argument.stderr b/tests/ui/nll/closure-requirements/escape-argument.stderr index 5a8462d4dc56e..ef01374ebdf9c 100644 --- a/tests/ui/nll/closure-requirements/escape-argument.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument.stderr @@ -5,9 +5,25 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Int(I32), Not), Mut), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Int(I32), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] note: no external requirements diff --git a/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr b/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr index 4fbd5eb19a56c..7f47c42410d00 100644 --- a/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr +++ b/tests/ui/nll/closure-requirements/escape-upvar-nested.stderr @@ -5,9 +5,37 @@ LL | let mut closure1 = || p = &y; | ^^ | = note: defining type: test::{closure#0}::{closure#0} with closure substs [ - i16, - extern "rust-call" fn(()), - (&'_#1r mut &'_#2r i32, &'_#3r i32), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [ + Ref( + '_#1r, + Ref( + '_#2r, + Int( + I32, + ), + Not, + ), + Mut, + ), + Ref( + '_#3r, + Int( + I32, + ), + Not, + ), + ], + ), ] = note: number of external vids: 4 = note: where '_#3r: '_#2r @@ -19,9 +47,37 @@ LL | let mut closure = || { | ^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - extern "rust-call" fn(()), - (&'_#1r mut &'_#2r i32, &'_#3r i32), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [ + Ref( + '_#1r, + Ref( + '_#2r, + Int( + I32, + ), + Not, + ), + Mut, + ), + Ref( + '_#3r, + Int( + I32, + ), + Not, + ), + ], + ), ] = note: number of external vids: 4 = note: where '_#3r: '_#2r diff --git a/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr b/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr index bc1ceac5bf01e..0398b3cfed403 100644 --- a/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr +++ b/tests/ui/nll/closure-requirements/escape-upvar-ref.stderr @@ -5,9 +5,37 @@ LL | let mut closure = || p = &y; | ^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - extern "rust-call" fn(()), - (&'_#1r mut &'_#2r i32, &'_#3r i32), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [ + Ref( + '_#1r, + Ref( + '_#2r, + Int( + I32, + ), + Not, + ), + Mut, + ), + Ref( + '_#3r, + Int( + I32, + ), + Not, + ), + ], + ), ] = note: number of external vids: 4 = note: where '_#3r: '_#2r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index 7da6ce58bf7fc..72309d478c8d9 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -5,9 +5,25 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref('_#2r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Ref('_#3r, Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)])])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#4r = note: late-bound region is '_#5r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 993687605c4af..f6bf7df7bcf52 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -5,9 +5,37 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Ref('_#2r, Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Uint(U32), Not)]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + Region( + BrAnon(3, None), + ), + Region( + BrAnon(4, None), + ), + Region( + BrAnon(5, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 721cd45ded98e..94402cfb5cab8 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -5,9 +5,22 @@ LL | foo(cell, |cell_a, cell_x| { | ^^^^^^^^^^^^^^^^ | = note: defining type: case1::{closure#0} with closure substs [ - i32, - for extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Uint(U32), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not)])])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + ], + ), + ), + Tuple( + [], + ), ] error[E0521]: borrowed data escapes outside of closure @@ -35,9 +48,22 @@ LL | foo(cell, |cell_a, cell_x| { | ^^^^^^^^^^^^^^^^ | = note: defining type: case2::{closure#0} with closure substs [ - i32, - for extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Uint(U32), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not)])])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 2 = note: where '_#1r: '_#0r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index 43dfc3bb9f835..c2384638ca2d3 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -5,9 +5,34 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | ^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }), Uint(U32), Not)]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + Region( + BrAnon(3, None), + ), + Region( + BrAnon(4, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#2r = note: late-bound region is '_#3r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 96c734226eff9..589fcdadd35c2 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -5,9 +5,37 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Adt(std::cell::Cell, [Ref('_#2r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Uint(U32), Not)]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + Region( + BrAnon(3, None), + ), + Region( + BrAnon(4, None), + ), + Region( + BrAnon(5, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr index 03dbd686e4976..8c5ae41177b08 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -5,9 +5,25 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Ref('_#2r, Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)])])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index d716d3de2a115..a2fd0e5306d83 100644 --- a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -5,9 +5,25 @@ LL | |_outlives1, _outlives2, x, y| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Ref('_#2r, Uint(U32), Not), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Uint(U32), Not)]), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)])])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: number of external vids: 4 diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index b924873fca6f0..0d32404ab650c 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -5,9 +5,34 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | ^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Ref('_#1r, Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Uint(U32), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + Region( + BrAnon(3, None), + ), + Region( + BrAnon(4, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#2r = note: late-bound region is '_#3r diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index 9b25efd0b66b1..c3c340eef251d 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -5,9 +5,37 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: defining type: supply::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }) u32>)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Ref('_#1r, Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon(2, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Ref('_#2r, Uint(U32), Not), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon(4, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Uint(U32), Not)]), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon(5, None) }), Adt(std::cell::Cell, [Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon(3, None) }), Uint(U32), Not)]), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + Region( + BrAnon(2, None), + ), + Region( + BrAnon(3, None), + ), + Region( + BrAnon(4, None), + ), + Region( + BrAnon(5, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: late-bound region is '_#4r diff --git a/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr index 038a5e11f88ce..3b3a3955fb610 100644 --- a/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr +++ b/tests/ui/nll/closure-requirements/propagate-from-trait-match.stderr @@ -5,12 +5,21 @@ LL | establish_relationships(value, |value| { | ^^^^^^^ | = note: defining type: supply::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((T,)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 2 - = note: where T: '_#1r + = note: where Param(T/#1): '_#1r note: no external requirements --> $DIR/propagate-from-trait-match.rs:28:1 diff --git a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr index 6db72b8863258..178b3d525c451 100644 --- a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -5,9 +5,25 @@ LL | expect_sig(|a, b| b); // ought to return `a` | ^^^^^^ | = note: defining type: test::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }) i32, - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Int(I32), Not), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Int(I32), Not)])]; c_variadic: false)->Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Int(I32), Not), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] error: lifetime may not live long enough diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr index 7b9ed171d2dbf..64c5d5ced23e7 100644 --- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr +++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr @@ -1,4 +1,4 @@ -error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds +error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), Param(T/#1), ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds --> $DIR/impl-trait-captures.rs:11:5 | LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { @@ -6,7 +6,7 @@ LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { LL | x | ^ | -help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound +help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), Param(T/#1), ReEarlyBound(2, 'a)])` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound | LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_), '_)) { | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-closure.rs b/tests/ui/nll/ty-outlives/projection-no-regions-closure.rs index 2d9c008c75924..c1a5ed1df4483 100644 --- a/tests/ui/nll/ty-outlives/projection-no-regions-closure.rs +++ b/tests/ui/nll/ty-outlives/projection-no-regions-closure.rs @@ -1,4 +1,5 @@ // compile-flags:-Zverbose +// normalize-stderr-test "DefId([^)]*)" -> "..." // Tests closures that propagate an outlives relationship to their // creator where the subject is a projection with no regions (` Anything for T { } +impl Anything for T {} fn with_signature<'a, T, F>(x: Box, op: F) -> Box - where F: FnOnce(Box) -> Box +where + F: FnOnce(Box) -> Box, { op(x) } diff --git a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 4933b93486831..66f8432d18928 100644 --- a/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -1,19 +1,28 @@ note: external requirements - --> $DIR/projection-no-regions-closure.rs:25:23 + --> $DIR/projection-no-regions-closure.rs:27:23 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^ | = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::boxed::Box, [Param(T/#1), Adt(std::alloc::Global, [])])])]; c_variadic: false)->Adt(std::boxed::Box, [Dynamic([Binder(Trait(Anything), [])], '_#2r, Dyn), Adt(std::alloc::Global, [])]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 - = note: where ::Item: '_#2r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: ...) }): '_#2r note: no external requirements - --> $DIR/projection-no-regions-closure.rs:21:1 + --> $DIR/projection-no-regions-closure.rs:23:1 | LL | / fn no_region<'a, T>(x: Box) -> Box LL | | where @@ -23,7 +32,7 @@ LL | | T: Iterator, = note: defining type: no_region::<'_#1r, T> error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/projection-no-regions-closure.rs:25:31 + --> $DIR/projection-no-regions-closure.rs:27:31 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^ @@ -32,21 +41,30 @@ LL | with_signature(x, |mut y| Box::new(y.next())) = note: ...so that the type `::Item` will meet its required lifetime bounds note: external requirements - --> $DIR/projection-no-regions-closure.rs:34:23 + --> $DIR/projection-no-regions-closure.rs:36:23 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^ | = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)>, - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::boxed::Box, [Param(T/#1), Adt(std::alloc::Global, [])])])]; c_variadic: false)->Adt(std::boxed::Box, [Dynamic([Binder(Trait(Anything), [])], '_#2r, Dyn), Adt(std::alloc::Global, [])]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 - = note: where ::Item: '_#2r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#1)], def_id: ...) }): '_#2r note: no external requirements - --> $DIR/projection-no-regions-closure.rs:30:1 + --> $DIR/projection-no-regions-closure.rs:32:1 | LL | / fn correct_region<'a, T>(x: Box) -> Box LL | | where @@ -56,21 +74,30 @@ LL | | T: 'a + Iterator, = note: defining type: correct_region::<'_#1r, T> note: external requirements - --> $DIR/projection-no-regions-closure.rs:42:23 + --> $DIR/projection-no-regions-closure.rs:44:23 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^ | = note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::boxed::Box, [Param(T/#2), Adt(std::alloc::Global, [])])])]; c_variadic: false)->Adt(std::boxed::Box, [Dynamic([Binder(Trait(Anything), [])], '_#3r, Dyn), Adt(std::alloc::Global, [])]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where ::Item: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: ...) }): '_#3r note: no external requirements - --> $DIR/projection-no-regions-closure.rs:38:1 + --> $DIR/projection-no-regions-closure.rs:40:1 | LL | / fn wrong_region<'a, 'b, T>(x: Box) -> Box LL | | where @@ -80,7 +107,7 @@ LL | | T: 'b + Iterator, = note: defining type: wrong_region::<'_#1r, '_#2r, T> error[E0309]: the associated type `::Item` may not live long enough - --> $DIR/projection-no-regions-closure.rs:42:31 + --> $DIR/projection-no-regions-closure.rs:44:31 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^^^^^^^^^^^^ @@ -89,21 +116,30 @@ LL | with_signature(x, |mut y| Box::new(y.next())) = note: ...so that the type `::Item` will meet its required lifetime bounds note: external requirements - --> $DIR/projection-no-regions-closure.rs:52:23 + --> $DIR/projection-no-regions-closure.rs:54:23 | LL | with_signature(x, |mut y| Box::new(y.next())) | ^^^^^^^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)>, - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::boxed::Box, [Param(T/#2), Adt(std::alloc::Global, [])])])]; c_variadic: false)->Adt(std::boxed::Box, [Dynamic([Binder(Trait(Anything), [])], '_#3r, Dyn), Adt(std::alloc::Global, [])]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where ::Item: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2)], def_id: ...) }): '_#3r note: no external requirements - --> $DIR/projection-no-regions-closure.rs:47:1 + --> $DIR/projection-no-regions-closure.rs:49:1 | LL | / fn outlives_region<'a, 'b, T>(x: Box) -> Box LL | | where diff --git a/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr index dbda04c42c5c7..6b8c5d06959b3 100644 --- a/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-one-region-closure.stderr @@ -5,13 +5,22 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: number of external vids: 4 - = note: where T: '_#2r + = note: where Param(T/#1): '_#2r = note: where '_#1r: '_#2r note: no external requirements @@ -55,12 +64,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where T: '_#3r + = note: where Param(T/#2): '_#3r = note: where '_#2r: '_#3r note: no external requirements @@ -105,12 +123,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where >::AssocType: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2), ReEarlyBound(1, 'b)], def_id: DefId(0:6 ~ projection_one_region_closure[015d]::Anything::AssocType) }): '_#3r note: no external requirements --> $DIR/projection-one-region-closure.rs:62:1 @@ -130,12 +157,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where T: '_#3r + = note: where Param(T/#2): '_#3r = note: where '_#2r: '_#3r note: no external requirements diff --git a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr index 250c796e2c71e..a909877569c35 100644 --- a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr @@ -5,9 +5,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: number of external vids: 4 @@ -43,9 +52,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 = note: where '_#2r: '_#3r @@ -81,12 +99,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where >::AssocType: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2), ReEarlyBound(1, 'b)], def_id: DefId(0:6 ~ projection_one_region_trait_bound_closure[550b]::Anything::AssocType) }): '_#3r note: no external requirements --> $DIR/projection-one-region-trait-bound-closure.rs:52:1 @@ -106,9 +133,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 = note: where '_#2r: '_#3r @@ -131,9 +167,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 = note: where '_#1r: '_#2r diff --git a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr index b27186b053735..69a49c6f34d28 100644 --- a/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr @@ -5,9 +5,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r @@ -28,9 +37,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] note: no external requirements @@ -51,9 +69,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] note: no external requirements @@ -74,9 +101,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] note: no external requirements @@ -97,9 +133,18 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] note: no external requirements diff --git a/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr index 90f04914286c1..c29871d9f383d 100644 --- a/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr +++ b/tests/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr @@ -5,13 +5,22 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#4r = note: number of external vids: 5 - = note: where >::AssocType: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2), ReEarlyBound(0, 'b), ReEarlyBound(1, 'c)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#3r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:34:1 @@ -39,12 +48,21 @@ 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 [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#4r, Tuple([]), Not)]), Param(T/#3)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 5 - = note: where >::AssocType: '_#4r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#3), ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#4r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:43:1 @@ -73,12 +91,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#4r, Tuple([]), Not)]), Param(T/#3)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 5 - = note: where >::AssocType: '_#4r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#3), ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#4r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:53:1 @@ -98,12 +125,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#4r, Tuple([]), Not)]), Param(T/#3)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 5 - = note: where >::AssocType: '_#4r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#3), ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#4r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:65:1 @@ -123,12 +159,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#4r, Tuple([]), Not)]), Param(T/#3)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 5 - = note: where >::AssocType: '_#4r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#3), ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#4r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:74:1 @@ -148,13 +193,22 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: number of external vids: 4 - = note: where >::AssocType: '_#2r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#1), ReEarlyBound(0, 'b), ReEarlyBound(0, 'b)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#2r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:83:1 @@ -189,12 +243,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where >::AssocType: '_#3r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#2), ReEarlyBound(1, 'b), ReEarlyBound(1, 'b)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#3r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:92:1 @@ -214,12 +277,21 @@ LL | with_signature(cell, t, |cell, t| require(cell, t)); | ^^^^^^^^^ | = note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 - = note: where >::AssocType: '_#2r + = note: where Alias(Projection, AliasTy { substs: [Param(T/#1), ReEarlyBound(0, 'a), ReEarlyBound(0, 'a)], def_id: DefId(0:7 ~ projection_two_region_trait_bound_closure[f373]::Anything::AssocType) }): '_#2r note: no external requirements --> $DIR/projection-two-region-trait-bound-closure.rs:101:1 diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index a442cf12d820e..20abdc3f83b54 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -5,12 +5,28 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^ | = note: defining type: generic::::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) T)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::option::Option, [Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Tuple([]), Not), Not)])]), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Param(T/#0), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 2 - = note: where T: '_#1r + = note: where Param(T/#0): '_#1r note: no external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1 @@ -27,13 +43,29 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | ^^^^^^ | = note: defining type: generic_fail::::{closure#0} with closure substs [ - i16, - for extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) T)), - (), + Int( + I16, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::option::Option, [Adt(std::cell::Cell, [Ref('_#1r, Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(0, None) }), Tuple([]), Not), Not)])]), Ref(ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }), Param(T/#0), Not)])]; c_variadic: false)->Tuple([]), + [ + Region( + BrAnon(0, None), + ), + Region( + BrAnon(1, None), + ), + ], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#2r = note: number of external vids: 3 - = note: where T: '_#1r + = note: where Param(T/#0): '_#1r note: no external requirements --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1 diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 35979c8bf5171..31f2efeb5dd31 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -5,12 +5,21 @@ LL | with_signature(x, |y| y) | ^^^ | = note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>, - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::boxed::Box, [Param(T/#1), Adt(std::alloc::Global, [])])])]; c_variadic: false)->Adt(std::boxed::Box, [Dynamic([Binder(Trait(std::fmt::Debug), [])], '_#2r, Dyn), Adt(std::alloc::Global, [])]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 - = note: where T: '_#2r + = note: where Param(T/#1): '_#2r note: no external requirements --> $DIR/ty-param-closure-outlives-from-return-type.rs:15:1 diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr index 4c97db58c6c3d..ba214bdc78a8f 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -5,13 +5,22 @@ LL | with_signature(a, b, |x, y| { | ^^^^^^ | = note: defining type: no_region::::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#1r, Tuple([]), Not)]), Param(T/#0)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#2r = note: number of external vids: 3 - = note: where T: '_#1r + = note: where Param(T/#0): '_#1r note: no external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1 @@ -39,12 +48,21 @@ LL | with_signature(a, b, |x, y| { | ^^^^^^ | = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 3 - = note: where T: '_#2r + = note: where Param(T/#1): '_#2r note: no external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:1 @@ -63,13 +81,22 @@ LL | with_signature(a, b, |x, y| { | ^^^^^^ | = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#2r, Tuple([]), Not)]), Param(T/#1)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: late-bound region is '_#3r = note: number of external vids: 4 - = note: where T: '_#2r + = note: where Param(T/#1): '_#2r note: no external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:59:1 @@ -99,12 +126,21 @@ LL | with_signature(a, b, |x, y| { | ^^^^^^ | = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ - i32, - extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), - (), + Int( + I32, + ), + FnPtr( + Binder( + ([Tuple([Adt(std::cell::Cell, [Ref('_#3r, Tuple([]), Not)]), Param(T/#2)])]; c_variadic: false)->Tuple([]), + [], + ), + ), + Tuple( + [], + ), ] = note: number of external vids: 4 - = note: where T: '_#3r + = note: where Param(T/#2): '_#3r note: no external requirements --> $DIR/ty-param-closure-outlives-from-where-clause.rs:71:1 diff --git a/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs b/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs index ccda9129dabae..cabe85f24ea10 100644 --- a/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs +++ b/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs @@ -6,7 +6,9 @@ #![allow(warnings)] #![feature(rustc_attrs)] -struct SomeStruct { t: T } +struct SomeStruct { + t: T, +} #[rustc_dump_user_substs] fn main() { @@ -16,5 +18,5 @@ fn main() { SomeStruct:: { t: 22 }; // No lifetime bounds given. - SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&ReStatic u32] + SomeStruct::<&'static u32> { t: &22 }; //~ ERROR UserSubsts { substs: [Ref(ReStatic, Uint(U32), Not)], user_self_ty: None } } diff --git a/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr b/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr index 5860621909ce4..f7b77fe667a84 100644 --- a/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr +++ b/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr @@ -1,5 +1,5 @@ -error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-adt-brace-struct.rs:19:5 +error: user substs: UserSubsts { substs: [Ref(ReStatic, Uint(U32), Not)], user_self_ty: None } + --> $DIR/dump-adt-brace-struct.rs:21:5 | LL | SomeStruct::<&'static u32> { t: &22 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/nll/user-annotations/dump-fn-method.rs b/tests/ui/nll/user-annotations/dump-fn-method.rs index 148d63d848f80..d78a06cffa4eb 100644 --- a/tests/ui/nll/user-annotations/dump-fn-method.rs +++ b/tests/ui/nll/user-annotations/dump-fn-method.rs @@ -7,13 +7,12 @@ // Note: we reference the names T and U in the comments below. trait Bazoom { - fn method(&self, arg: T, arg2: U) { } + fn method(&self, arg: T, arg2: U) {} } -impl Bazoom for S { -} +impl Bazoom for S {} -fn foo<'a, T>(_: T) { } +fn foo<'a, T>(_: T) {} #[rustc_dump_user_substs] fn main() { @@ -26,13 +25,13 @@ fn main() { let x = foo::; x(22); - let x = foo::<&'static u32>; //~ ERROR [&ReStatic u32] + let x = foo::<&'static u32>; //~ ERROR UserSubsts { substs: [Ref(ReStatic, Uint(U32), Not)], user_self_ty: None } x(&22); // Here: we only want the `T` to be given, the rest should be variables. // // (`T` refers to the declaration of `Bazoom`) - let x = <_ as Bazoom>::method::<_>; //~ ERROR [^0, u32, ^1] + let x = <_ as Bazoom>::method::<_>; //~ ERROR UserSubsts { substs: [Bound(DebruijnIndex(0), BoundTy { var: 0, kind: Anon }), Uint(U32), Bound(DebruijnIndex(0), BoundTy { var: 1, kind: Anon })], user_self_ty: None } x(&22, 44, 66); // Here: all are given and definitely contain no lifetimes, so we @@ -41,7 +40,7 @@ fn main() { x(&22, 44, 66); // Here: all are given and we have a lifetime. - let x = >::method::; //~ ERROR [u8, &ReStatic u16, u32] + let x = >::method::; //~ ERROR UserSubsts { substs: [Uint(U8), Ref(ReStatic, Uint(U16), Not), Uint(U32)], user_self_ty: None } x(&22, &44, 66); // Here: we want in particular that *only* the method `U` @@ -49,7 +48,7 @@ fn main() { // // (`U` refers to the declaration of `Bazoom`) let y = 22_u32; - y.method::(44, 66); //~ ERROR [^0, ^1, u32] + y.method::(44, 66); //~ ERROR UserSubsts { substs: [Bound(DebruijnIndex(0), BoundTy { var: 0, kind: Anon }), Bound(DebruijnIndex(0), BoundTy { var: 1, kind: Anon }), Uint(U32)], user_self_ty: None } // Here: nothing is given, so we don't have any annotation. let y = 22_u32; diff --git a/tests/ui/nll/user-annotations/dump-fn-method.stderr b/tests/ui/nll/user-annotations/dump-fn-method.stderr index d139efa888ff7..5de50f4787722 100644 --- a/tests/ui/nll/user-annotations/dump-fn-method.stderr +++ b/tests/ui/nll/user-annotations/dump-fn-method.stderr @@ -1,23 +1,23 @@ -error: user substs: UserSubsts { substs: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:29:13 +error: user substs: UserSubsts { substs: [Ref(ReStatic, Uint(U32), Not)], user_self_ty: None } + --> $DIR/dump-fn-method.rs:28:13 | LL | let x = foo::<&'static u32>; | ^^^^^^^^^^^^^^^^^^^ -error: user substs: UserSubsts { substs: [^0, u32, ^1], user_self_ty: None } - --> $DIR/dump-fn-method.rs:35:13 +error: user substs: UserSubsts { substs: [Bound(DebruijnIndex(0), BoundTy { var: 0, kind: Anon }), Uint(U32), Bound(DebruijnIndex(0), BoundTy { var: 1, kind: Anon })], user_self_ty: None } + --> $DIR/dump-fn-method.rs:34:13 | LL | let x = <_ as Bazoom>::method::<_>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: user substs: UserSubsts { substs: [u8, &ReStatic u16, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:44:13 +error: user substs: UserSubsts { substs: [Uint(U8), Ref(ReStatic, Uint(U16), Not), Uint(U32)], user_self_ty: None } + --> $DIR/dump-fn-method.rs:43:13 | LL | let x = >::method::; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: user substs: UserSubsts { substs: [^0, ^1, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:52:5 +error: user substs: UserSubsts { substs: [Bound(DebruijnIndex(0), BoundTy { var: 0, kind: Anon }), Bound(DebruijnIndex(0), BoundTy { var: 1, kind: Anon }), Uint(U32)], user_self_ty: None } + --> $DIR/dump-fn-method.rs:51:5 | LL | y.method::(44, 66); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/print_type_sizes/async.stdout b/tests/ui/print_type_sizes/async.stdout index 6e47bb4930dc5..ab4e23aa30d0f 100644 --- a/tests/ui/print_type_sizes/async.stdout +++ b/tests/ui/print_type_sizes/async.stdout @@ -10,25 +10,25 @@ print-type-size variant `Returned`: 8192 bytes print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size variant `Panicked`: 8192 bytes print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes -print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes +print-type-size type: `ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes -print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes +print-type-size type: `MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 8192 bytes print-type-size field `.uninit`: 0 bytes print-type-size field `.value`: 8192 bytes -print-type-size type: `[async fn body@$DIR/async.rs:6:17: 6:19]`: 1 bytes, alignment: 1 bytes -print-type-size discriminant: 1 bytes -print-type-size variant `Unresumed`: 0 bytes -print-type-size variant `Returned`: 0 bytes -print-type-size variant `Panicked`: 0 bytes -print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes +print-type-size type: `ManuallyDrop<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes print-type-size field `.value`: 1 bytes -print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes +print-type-size type: `MaybeUninit<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes print-type-size variant `MaybeUninit`: 1 bytes print-type-size field `.uninit`: 0 bytes print-type-size field `.value`: 1 bytes -print-type-size type: `std::task::Poll<()>`: 1 bytes, alignment: 1 bytes +print-type-size type: `Poll<()>`: 1 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Ready`: 0 bytes print-type-size field `.0`: 0 bytes print-type-size variant `Pending`: 0 bytes +print-type-size type: `[async fn body@$DIR/async.rs:6:17: 6:19]`: 1 bytes, alignment: 1 bytes +print-type-size discriminant: 1 bytes +print-type-size variant `Unresumed`: 0 bytes +print-type-size variant `Returned`: 0 bytes +print-type-size variant `Panicked`: 0 bytes diff --git a/tests/ui/print_type_sizes/niche-filling.stdout b/tests/ui/print_type_sizes/niche-filling.stdout index d1753c26ca83b..d7d205daffafa 100644 --- a/tests/ui/print_type_sizes/niche-filling.stdout +++ b/tests/ui/print_type_sizes/niche-filling.stdout @@ -14,17 +14,17 @@ print-type-size field `.pre`: 1 bytes print-type-size field `.post`: 2 bytes print-type-size field `.val`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes +print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes print-type-size discriminant: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes +print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes print-type-size discriminant: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes +print-type-size type: `MyOption>`: 8 bytes, alignment: 4 bytes print-type-size discriminant: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes @@ -49,27 +49,27 @@ print-type-size type: `MyOption`: 4 bytes, alignment: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `MyOption`: 4 bytes, alignment: 4 bytes +print-type-size type: `MyOption`: 4 bytes, alignment: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `MyOption`: 4 bytes, alignment: 4 bytes +print-type-size type: `MyOption`: 4 bytes, alignment: 4 bytes print-type-size variant `Some`: 4 bytes print-type-size field `.0`: 4 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `Union1`: 4 bytes, alignment: 4 bytes +print-type-size type: `NonZeroU32`: 4 bytes, alignment: 4 bytes +print-type-size field `.0`: 4 bytes +print-type-size type: `Union1`: 4 bytes, alignment: 4 bytes print-type-size variant `Union1`: 4 bytes print-type-size field `.a`: 4 bytes -print-type-size type: `Union2`: 4 bytes, alignment: 4 bytes +print-type-size type: `Union2`: 4 bytes, alignment: 4 bytes print-type-size variant `Union2`: 4 bytes print-type-size field `.a`: 4 bytes print-type-size field `.b`: 4 bytes, offset: 0 bytes, alignment: 4 bytes -print-type-size type: `Union2`: 4 bytes, alignment: 4 bytes +print-type-size type: `Union2`: 4 bytes, alignment: 4 bytes print-type-size variant `Union2`: 4 bytes print-type-size field `.a`: 4 bytes print-type-size field `.b`: 4 bytes, offset: 0 bytes, alignment: 4 bytes -print-type-size type: `std::num::NonZeroU32`: 4 bytes, alignment: 4 bytes -print-type-size field `.0`: 4 bytes print-type-size type: `Enum4<(), (), (), MyOption>`: 2 bytes, alignment: 1 bytes print-type-size variant `Four`: 2 bytes print-type-size field `.0`: 2 bytes diff --git a/tests/ui/print_type_sizes/uninhabited.stdout b/tests/ui/print_type_sizes/uninhabited.stdout index 5eb5384bce340..1116d672eacc7 100644 --- a/tests/ui/print_type_sizes/uninhabited.stdout +++ b/tests/ui/print_type_sizes/uninhabited.stdout @@ -1,6 +1,6 @@ -print-type-size type: `std::result::Result`: 4 bytes, alignment: 4 bytes +print-type-size type: `Result`: 4 bytes, alignment: 4 bytes print-type-size variant `Ok`: 4 bytes print-type-size field `.0`: 4 bytes -print-type-size type: `std::option::Option`: 0 bytes, alignment: 1 bytes +print-type-size type: `Option`: 0 bytes, alignment: 1 bytes print-type-size variant `None`: 0 bytes -print-type-size type: `std::result::Result`: 0 bytes, alignment: 1 bytes +print-type-size type: `Result`: 0 bytes, alignment: 1 bytes diff --git a/tests/ui/thir-print/thir-flat.stdout b/tests/ui/thir-print/thir-flat.stdout index c399fa66b6a03..3f855383c5439 100644 --- a/tests/ui/thir-print/thir-flat.stdout +++ b/tests/ui/thir-print/thir-flat.stdout @@ -14,7 +14,9 @@ Thir { ], exprs: [ Expr { - ty: (), + ty: Tuple( + [], + ), temp_lifetime: Some( Node(2), ), @@ -24,7 +26,9 @@ Thir { }, }, Expr { - ty: (), + ty: Tuple( + [], + ), temp_lifetime: Some( Node(2), ), @@ -38,7 +42,9 @@ Thir { }, }, Expr { - ty: (), + ty: Tuple( + [], + ), temp_lifetime: Some( Node(2), ), diff --git a/tests/ui/thir-print/thir-tree-match.stdout b/tests/ui/thir-print/thir-tree-match.stdout index d6174ec262a44..a092b925c6555 100644 --- a/tests/ui/thir-print/thir-tree-match.stdout +++ b/tests/ui/thir-print/thir-tree-match.stdout @@ -1,13 +1,13 @@ DefId(0:16 ~ thir_tree_match[3c9a]::has_match): params: [ Param { - ty: Foo + ty: Adt(Foo, []) ty_span: Some($DIR/thir-tree-match.rs:15:19: 15:22 (#0)) self_kind: None hir_id: Some(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).1)) param: Some( Pat: { - ty: Foo + ty: Adt(Foo, []) span: $DIR/thir-tree-match.rs:15:14: 15:17 (#0) kind: PatKind { Binding { @@ -15,7 +15,7 @@ params: [ name: "foo" mode: ByValue var: LocalVarId(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).2)) - ty: Foo + ty: Adt(Foo, []) is_primary: true subpattern: None } @@ -26,7 +26,7 @@ params: [ ] body: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0) kind: @@ -35,7 +35,7 @@ body: lint_level: Inherited value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0) kind: @@ -44,7 +44,7 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).26)) value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:15:32: 21:2 (#0) kind: @@ -57,7 +57,7 @@ body: stmts: [] expr: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:16:5: 20:6 (#0) kind: @@ -66,14 +66,14 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).3)) value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:16:5: 20:6 (#0) kind: Match { scrutinee: Expr { - ty: Foo + ty: Adt(Foo, []) temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0) kind: @@ -82,7 +82,7 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).4)) value: Expr { - ty: Foo + ty: Adt(Foo, []) temp_lifetime: Some(Node(26)) span: $DIR/thir-tree-match.rs:16:11: 16:14 (#0) kind: @@ -96,7 +96,7 @@ body: Arm { pattern: Pat: { - ty: Foo + ty: Adt(Foo, []) span: $DIR/thir-tree-match.rs:17:9: 17:32 (#0) kind: PatKind { Variant { @@ -110,7 +110,7 @@ body: variant_index: 0 subpatterns: [ Pat: { - ty: Bar + ty: Adt(Bar, []) span: $DIR/thir-tree-match.rs:17:21: 17:31 (#0) kind: PatKind { Variant { @@ -133,7 +133,7 @@ body: guard: None body: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(13)) span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0) kind: @@ -142,7 +142,7 @@ body: lint_level: Inherited value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(13)) span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0) kind: @@ -151,7 +151,7 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).13)) value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(13)) span: $DIR/thir-tree-match.rs:17:36: 17:40 (#0) kind: @@ -169,7 +169,7 @@ body: Arm { pattern: Pat: { - ty: Foo + ty: Adt(Foo, []) span: $DIR/thir-tree-match.rs:18:9: 18:23 (#0) kind: PatKind { Variant { @@ -183,7 +183,7 @@ body: variant_index: 0 subpatterns: [ Pat: { - ty: Bar + ty: Adt(Bar, []) span: $DIR/thir-tree-match.rs:18:21: 18:22 (#0) kind: PatKind { Wild @@ -196,7 +196,7 @@ body: guard: None body: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(19)) span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0) kind: @@ -205,7 +205,7 @@ body: lint_level: Inherited value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(19)) span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0) kind: @@ -214,7 +214,7 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).19)) value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(19)) span: $DIR/thir-tree-match.rs:18:27: 18:32 (#0) kind: @@ -232,7 +232,7 @@ body: Arm { pattern: Pat: { - ty: Foo + ty: Adt(Foo, []) span: $DIR/thir-tree-match.rs:19:9: 19:20 (#0) kind: PatKind { Variant { @@ -251,7 +251,7 @@ body: guard: None body: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(24)) span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0) kind: @@ -260,7 +260,7 @@ body: lint_level: Inherited value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(24)) span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0) kind: @@ -269,7 +269,7 @@ body: lint_level: Explicit(HirId(DefId(0:16 ~ thir_tree_match[3c9a]::has_match).24)) value: Expr { - ty: bool + ty: Bool temp_lifetime: Some(Node(24)) span: $DIR/thir-tree-match.rs:19:24: 19:28 (#0) kind: @@ -302,7 +302,7 @@ params: [ ] body: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree-match.rs:23:11: 23:13 (#0) kind: @@ -311,7 +311,7 @@ body: lint_level: Inherited value: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree-match.rs:23:11: 23:13 (#0) kind: @@ -320,7 +320,7 @@ body: lint_level: Explicit(HirId(DefId(0:17 ~ thir_tree_match[3c9a]::main).2)) value: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree-match.rs:23:11: 23:13 (#0) kind: diff --git a/tests/ui/thir-print/thir-tree.stdout b/tests/ui/thir-print/thir-tree.stdout index 0a35d9fb78ca2..817edc303a663 100644 --- a/tests/ui/thir-print/thir-tree.stdout +++ b/tests/ui/thir-print/thir-tree.stdout @@ -3,7 +3,7 @@ params: [ ] body: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree.rs:4:15: 4:17 (#0) kind: @@ -12,7 +12,7 @@ body: lint_level: Inherited value: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree.rs:4:15: 4:17 (#0) kind: @@ -21,7 +21,7 @@ body: lint_level: Explicit(HirId(DefId(0:3 ~ thir_tree[8f1d]::main).2)) value: Expr { - ty: () + ty: Tuple([]) temp_lifetime: Some(Node(2)) span: $DIR/thir-tree.rs:4:15: 4:17 (#0) kind: