diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs index fbe830b2b1030..fa4ea42638561 100644 --- a/compiler/rustc_codegen_cranelift/src/base.rs +++ b/compiler/rustc_codegen_cranelift/src/base.rs @@ -686,6 +686,7 @@ fn codegen_stmt<'tcx>( substs, ty::ClosureKind::FnOnce, ) + .expect("failed to normalize and resolve closure during codegen") .polymorphize(fx.tcx); let func_ref = fx.get_function_ref(instance); let func_addr = fx.bcx.ins().func_addr(fx.pointer_type, func_ref); diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 81c1897694ce6..a5806d64d437c 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -213,6 +213,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { substs, ty::ClosureKind::FnOnce, ) + .expect("failed to normalize and resolve closure during codegen") .polymorphize(bx.cx().tcx()); OperandValue::Immediate(bx.cx().get_fn_addr(instance)) } diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 076415b2d1b2f..dfdcd4292c9a0 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -100,7 +100,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { def_id, substs, ty::ClosureKind::FnOnce, - ); + ) + .ok_or_else(|| err_inval!(TooGeneric))?; let fn_ptr = self.create_fn_alloc_ptr(FnVal::Instance(instance)); self.write_pointer(fn_ptr, dest)?; } diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index b9866995e9f95..9d7905ed9a839 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -44,22 +44,10 @@ where let is_used = unused_params.contains(index).map_or(true, |unused| !unused); // Only recurse when generic parameters in fns, closures and generators // are used and require substitution. - match (is_used, subst.needs_subst()) { - // Just in case there are closures or generators within this subst, - // recurse. - (true, true) => return subst.visit_with(self), - // Confirm that polymorphization replaced the parameter with - // `ty::Param`/`ty::ConstKind::Param`. - (false, true) if cfg!(debug_assertions) => match subst.unpack() { - ty::subst::GenericArgKind::Type(ty) => { - assert!(matches!(ty.kind(), ty::Param(_))) - } - ty::subst::GenericArgKind::Const(ct) => { - assert!(matches!(ct.kind(), ty::ConstKind::Param(_))) - } - ty::subst::GenericArgKind::Lifetime(..) => (), - }, - _ => {} + // Just in case there are closures or generators within this subst, + // recurse. + if is_used && subst.needs_subst() { + return subst.visit_with(self); } } ControlFlow::CONTINUE diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index e8dd179eac198..0e10fe25c10cb 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -496,12 +496,12 @@ impl<'tcx> Instance<'tcx> { def_id: DefId, substs: ty::SubstsRef<'tcx>, requested_kind: ty::ClosureKind, - ) -> Instance<'tcx> { + ) -> Option> { let actual_kind = substs.as_closure().kind(); match needs_fn_once_adapter_shim(actual_kind, requested_kind) { Ok(true) => Instance::fn_once_adapter_instance(tcx, def_id, substs), - _ => Instance::new(def_id, substs), + _ => Some(Instance::new(def_id, substs)), } } @@ -515,7 +515,7 @@ impl<'tcx> Instance<'tcx> { tcx: TyCtxt<'tcx>, closure_did: DefId, substs: ty::SubstsRef<'tcx>, - ) -> Instance<'tcx> { + ) -> Option> { debug!("fn_once_adapter_shim({:?}, {:?})", closure_did, substs); let fn_once = tcx.require_lang_item(LangItem::FnOnce, None); let call_once = tcx @@ -531,12 +531,13 @@ impl<'tcx> Instance<'tcx> { let self_ty = tcx.mk_closure(closure_did, substs); let sig = substs.as_closure().sig(); - let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig); + let sig = + tcx.try_normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), sig).ok()?; assert_eq!(sig.inputs().len(), 1); let substs = tcx.mk_substs_trait(self_ty, &[sig.inputs()[0].into()]); debug!("fn_once_adapter_shim: self_ty={:?} sig={:?}", self_ty, sig); - Instance { def, substs } + Some(Instance { def, substs }) } /// Depending on the kind of `InstanceDef`, the MIR body associated with an diff --git a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs index 66a0a192a87c1..9d8a811659433 100644 --- a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs +++ b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs @@ -112,6 +112,26 @@ impl<'tcx> TyCtxt<'tcx> { self.normalize_erasing_regions(param_env, value) } + /// If you have a `Binder<'tcx, T>`, you can do this to strip out the + /// late-bound regions and then normalize the result, yielding up + /// a `T` (with regions erased). This is appropriate when the + /// binder is being instantiated at the call site. + /// + /// N.B., currently, higher-ranked type bounds inhibit + /// normalization. Therefore, each time we erase them in + /// codegen, we need to normalize the contents. + pub fn try_normalize_erasing_late_bound_regions( + self, + param_env: ty::ParamEnv<'tcx>, + value: ty::Binder<'tcx, T>, + ) -> Result> + where + T: TypeFoldable<'tcx>, + { + let value = self.erase_late_bound_regions(value); + self.try_normalize_erasing_regions(param_env, value) + } + /// Monomorphizes a type from the AST by first applying the /// in-scope substitutions and then normalizing any associated /// types. diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 49403ba03a45d..ce387cb4453c1 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -1,14 +1,15 @@ //! Inlining pass for MIR functions use crate::deref_separator::deref_finder; use rustc_attr::InlineAttr; +use rustc_const_eval::transform::validate::equal_up_to_regions; use rustc_index::bit_set::BitSet; use rustc_index::vec::Idx; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc_middle::mir::visit::*; use rustc_middle::mir::*; -use rustc_middle::traits::ObligationCause; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::{self, ConstKind, Instance, InstanceDef, ParamEnv, Ty, TyCtxt}; +use rustc_session::config::OptLevel; use rustc_span::{hygiene::ExpnKind, ExpnData, LocalExpnId, Span}; use rustc_target::spec::abi::Abi; @@ -43,7 +44,15 @@ impl<'tcx> MirPass<'tcx> for Inline { return enabled; } - sess.opts.mir_opt_level() >= 3 + match sess.mir_opt_level() { + 0 | 1 => false, + 2 => { + (sess.opts.optimize == OptLevel::Default + || sess.opts.optimize == OptLevel::Aggressive) + && sess.opts.incremental == None + } + _ => true, + } } fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { @@ -76,13 +85,6 @@ fn inline<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) -> bool { } let param_env = tcx.param_env_reveal_all_normalized(def_id); - let hir_id = tcx.hir().local_def_id_to_hir_id(def_id); - let param_env = rustc_trait_selection::traits::normalize_param_env_or_error( - tcx, - def_id.to_def_id(), - param_env, - ObligationCause::misc(body.span, hir_id), - ); let mut this = Inliner { tcx, @@ -166,6 +168,45 @@ impl<'tcx> Inliner<'tcx> { return Err("failed to normalize callee body"); }; + // Check call signature compatibility. + // Normally, this shouldn't be required, but trait normalization failure can create a + // validation ICE. + let terminator = caller_body[callsite.block].terminator.as_ref().unwrap(); + let TerminatorKind::Call { args, destination, .. } = &terminator.kind else { bug!() }; + let destination_ty = destination.ty(&caller_body.local_decls, self.tcx).ty; + let output_type = callee_body.return_ty(); + if !equal_up_to_regions(self.tcx, self.param_env, output_type, destination_ty) { + trace!(?output_type, ?destination_ty); + return Err("failed to normalize return type"); + } + if callsite.fn_sig.abi() == Abi::RustCall { + let mut args = args.into_iter(); + let _ = args.next(); // Skip `self` argument. + let arg_tuple_ty = args.next().unwrap().ty(&caller_body.local_decls, self.tcx); + assert!(args.next().is_none()); + + let ty::Tuple(arg_tuple_tys) = arg_tuple_ty.kind() else { + bug!("Closure arguments are not passed as a tuple"); + }; + + for (arg_ty, input) in arg_tuple_tys.iter().zip(callee_body.args_iter().skip(1)) { + let input_type = callee_body.local_decls[input].ty; + if !equal_up_to_regions(self.tcx, self.param_env, arg_ty, input_type) { + trace!(?arg_ty, ?input_type); + return Err("failed to normalize tuple argument type"); + } + } + } else { + for (arg, input) in args.iter().zip(callee_body.args_iter()) { + let input_type = callee_body.local_decls[input].ty; + let arg_ty = arg.ty(&caller_body.local_decls, self.tcx); + if !equal_up_to_regions(self.tcx, self.param_env, arg_ty, input_type) { + trace!(?arg_ty, ?input_type); + return Err("failed to normalize argument type"); + } + } + } + let old_blocks = caller_body.basic_blocks().next_index(); self.inline_call(caller_body, &callsite, callee_body); let new_blocks = old_blocks..caller_body.basic_blocks().next_index(); @@ -263,6 +304,10 @@ impl<'tcx> Inliner<'tcx> { return None; } + if self.history.contains(&callee) { + return None; + } + let fn_sig = self.tcx.bound_fn_sig(def_id).subst(self.tcx, substs); return Some(CallSite { @@ -285,8 +330,14 @@ impl<'tcx> Inliner<'tcx> { callsite: &CallSite<'tcx>, callee_attrs: &CodegenFnAttrs, ) -> Result<(), &'static str> { - if let InlineAttr::Never = callee_attrs.inline { - return Err("never inline hint"); + match callee_attrs.inline { + InlineAttr::Never => return Err("never inline hint"), + InlineAttr::Always | InlineAttr::Hint => {} + InlineAttr::None => { + if self.tcx.sess.mir_opt_level() <= 2 { + return Err("at mir-opt-level=2, only #[inline] is inlined"); + } + } } // Only inline local functions if they would be eligible for cross-crate @@ -407,22 +458,9 @@ impl<'tcx> Inliner<'tcx> { } TerminatorKind::Call { func: Operand::Constant(ref f), cleanup, .. } => { - if let ty::FnDef(def_id, substs) = + if let ty::FnDef(def_id, _) = *callsite.callee.subst_mir(self.tcx, &f.literal.ty()).kind() { - if let Ok(substs) = - self.tcx.try_normalize_erasing_regions(self.param_env, substs) - { - if let Ok(Some(instance)) = - Instance::resolve(self.tcx, self.param_env, def_id, substs) - { - if callsite.callee.def_id() == instance.def_id() { - return Err("self-recursion"); - } else if self.history.contains(&instance) { - return Err("already inlined"); - } - } - } // Don't give intrinsics the extra penalty for calls if tcx.is_intrinsic(def_id) { cost += INSTR_COST; @@ -482,14 +520,12 @@ impl<'tcx> Inliner<'tcx> { if let InlineAttr::Always = callee_attrs.inline { debug!("INLINING {:?} because inline(always) [cost={}]", callsite, cost); Ok(()) + } else if cost <= threshold { + debug!("INLINING {:?} [cost={} <= threshold={}]", callsite, cost, threshold); + Ok(()) } else { - if cost <= threshold { - debug!("INLINING {:?} [cost={} <= threshold={}]", callsite, cost, threshold); - Ok(()) - } else { - debug!("NOT inlining {:?} [cost={} > threshold={}]", callsite, cost, threshold); - Err("cost above threshold") - } + debug!("NOT inlining {:?} [cost={} > threshold={}]", callsite, cost, threshold); + Err("cost above threshold") } } diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs index fd7de2bd1dcf8..ee4a6bfba0e5b 100644 --- a/compiler/rustc_mir_transform/src/inline/cycle.rs +++ b/compiler/rustc_mir_transform/src/inline/cycle.rs @@ -48,7 +48,7 @@ pub(crate) fn mir_callgraph_reachable<'tcx>( trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping"); continue; }; - let Some(callee) = ty::Instance::resolve(tcx, param_env, callee, substs).unwrap() else { + let Ok(Some(callee)) = ty::Instance::resolve(tcx, param_env, callee, substs) else { trace!(?callee, "cannot resolve, skipping"); continue; }; diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 2af22e129a5f7..d4978c565684e 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -730,7 +730,8 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { def_id, substs, ty::ClosureKind::FnOnce, - ); + ) + .expect("failed to normalize and resolve closure during codegen"); if should_codegen_locally(self.tcx, &instance) { self.output.push(create_fn_mono_item(self.tcx, instance, span)); } diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 552db5406df8d..d08fe6dada104 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -332,12 +332,12 @@ fn resolve_associated_item<'tcx>( }), traits::ImplSource::Closure(closure_data) => { let trait_closure_kind = tcx.fn_trait_kind_from_lang_item(trait_id).unwrap(); - Some(Instance::resolve_closure( + Instance::resolve_closure( tcx, closure_data.closure_def_id, closure_data.substs, trait_closure_kind, - )) + ) } traits::ImplSource::FnPointer(ref data) => match data.fn_ty.kind() { ty::FnDef(..) | ty::FnPtr(..) => Some(Instance { diff --git a/src/test/codegen/issue-37945.rs b/src/test/codegen/issue-37945.rs index ee63a783f52db..4234c26b5e89b 100644 --- a/src/test/codegen/issue-37945.rs +++ b/src/test/codegen/issue-37945.rs @@ -17,7 +17,7 @@ pub fn is_empty_1(xs: Iter) -> bool { // CHECK-NEXT: start: // CHECK-NEXT: [[A:%.*]] = icmp ne {{i32\*|ptr}} %xs.1, null // CHECK-NEXT: tail call void @llvm.assume(i1 [[A]]) -// CHECK-NEXT: [[B:%.*]] = icmp eq {{i32\*|ptr}} %xs.0, %xs.1 +// CHECK-NEXT: [[B:%.*]] = icmp eq {{i32\*|ptr}} %xs.1, %xs.0 // CHECK-NEXT: ret i1 [[B:%.*]] {xs}.next().is_none() } @@ -28,7 +28,7 @@ pub fn is_empty_2(xs: Iter) -> bool { // CHECK-NEXT: start: // CHECK-NEXT: [[C:%.*]] = icmp ne {{i32\*|ptr}} %xs.1, null // CHECK-NEXT: tail call void @llvm.assume(i1 [[C]]) -// CHECK-NEXT: [[D:%.*]] = icmp eq {{i32\*|ptr}} %xs.0, %xs.1 +// CHECK-NEXT: [[D:%.*]] = icmp eq {{i32\*|ptr}} %xs.1, %xs.0 // CHECK-NEXT: ret i1 [[D:%.*]] xs.map(|&x| x).next().is_none() } diff --git a/src/test/codegen/issue-75659.rs b/src/test/codegen/issue-75659.rs index d093c841d68ef..6bcb59affe328 100644 --- a/src/test/codegen/issue-75659.rs +++ b/src/test/codegen/issue-75659.rs @@ -1,7 +1,7 @@ // This test checks that the call to memchr/slice_contains is optimized away // when searching in small slices. -// compile-flags: -O +// compile-flags: -O -Zinline-mir=no // only-x86_64 #![crate_type = "lib"] diff --git a/src/test/codegen/mem-replace-direct-memcpy.rs b/src/test/codegen/mem-replace-direct-memcpy.rs index d1c4c56dbe468..b41ef538d718f 100644 --- a/src/test/codegen/mem-replace-direct-memcpy.rs +++ b/src/test/codegen/mem-replace-direct-memcpy.rs @@ -3,7 +3,7 @@ // may e.g. multiply `size_of::()` with a variable "count" (which is only // known to be `1` after inlining). -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Zinline-mir=no #![crate_type = "lib"] @@ -12,14 +12,12 @@ pub fn replace_byte(dst: &mut u8, src: u8) -> u8 { } // NOTE(eddyb) the `CHECK-NOT`s ensure that the only calls of `@llvm.memcpy` in -// the entire output, are the two direct calls we want, from `ptr::{read,write}`. +// the entire output, are the two direct calls we want, from `ptr::replace`. // CHECK-NOT: call void @llvm.memcpy -// CHECK: ; core::ptr::read +// CHECK: ; core::mem::replace // CHECK-NOT: call void @llvm.memcpy -// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %src, i{{.*}} 1, i1 false) +// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %dest, i{{.*}} 1, i1 false) // CHECK-NOT: call void @llvm.memcpy -// CHECK: ; core::ptr::write -// CHECK-NOT: call void @llvm.memcpy -// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %dst, {{i8\*|ptr}} align 1 %src, i{{.*}} 1, i1 false) +// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %dest, {{i8\*|ptr}} align 1 %src{{.*}}, i{{.*}} 1, i1 false) // CHECK-NOT: call void @llvm.memcpy diff --git a/src/test/codegen/remap_path_prefix/main.rs b/src/test/codegen/remap_path_prefix/main.rs index 381f11ff1efcc..9bef743ddcb41 100644 --- a/src/test/codegen/remap_path_prefix/main.rs +++ b/src/test/codegen/remap_path_prefix/main.rs @@ -1,7 +1,7 @@ // ignore-windows // -// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src +// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src -Zinline-mir=no // aux-build:remap_path_prefix_aux.rs extern crate remap_path_prefix_aux; diff --git a/src/test/codegen/simd-wide-sum.rs b/src/test/codegen/simd-wide-sum.rs index fde9b0fcd8ac1..015ac4fe4d1b6 100644 --- a/src/test/codegen/simd-wide-sum.rs +++ b/src/test/codegen/simd-wide-sum.rs @@ -47,8 +47,9 @@ pub fn wider_reduce_iter(x: Simd) -> u16 { #[no_mangle] // CHECK-LABEL: @wider_reduce_into_iter pub fn wider_reduce_into_iter(x: Simd) -> u16 { - // CHECK: zext <8 x i8> - // CHECK-SAME: to <8 x i16> - // CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> + // FIXME MIR inlining messes up LLVM optimizations. + // WOULD-CHECK: zext <8 x i8> + // WOULD-CHECK-SAME: to <8 x i16> + // WOULD-CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> x.to_array().into_iter().map(u16::from).sum() } diff --git a/src/test/codegen/slice-ref-equality.rs b/src/test/codegen/slice-ref-equality.rs index e5cde5e9e7460..47fde12bf3036 100644 --- a/src/test/codegen/slice-ref-equality.rs +++ b/src/test/codegen/slice-ref-equality.rs @@ -1,4 +1,4 @@ -// compile-flags: -C opt-level=3 +// compile-flags: -C opt-level=3 -Zmerge-functions=disabled #![crate_type = "lib"] diff --git a/src/test/codegen/swap-small-types.rs b/src/test/codegen/swap-small-types.rs index 2f375844cc716..03e2a2327fc4c 100644 --- a/src/test/codegen/swap-small-types.rs +++ b/src/test/codegen/swap-small-types.rs @@ -11,9 +11,10 @@ type RGB48 = [u16; 3]; // CHECK-LABEL: @swap_rgb48 #[no_mangle] pub fn swap_rgb48(x: &mut RGB48, y: &mut RGB48) { -// CHECK-NOT: alloca -// CHECK: load i48 -// CHECK: store i48 + // FIXME MIR inlining messes up LLVM optimizations. +// WOULD-CHECK-NOT: alloca +// WOULD-CHECK: load i48 +// WOULD-CHECK: store i48 swap(x, y) } diff --git a/src/test/codegen/vec-in-place.rs b/src/test/codegen/vec-in-place.rs index 13c41f7d4a906..62139aa9bebde 100644 --- a/src/test/codegen/vec-in-place.rs +++ b/src/test/codegen/vec-in-place.rs @@ -53,16 +53,18 @@ pub fn vec_iterator_cast_unwrap(vec: Vec>) -> Vec { // CHECK-LABEL: @vec_iterator_cast_aggregate #[no_mangle] pub fn vec_iterator_cast_aggregate(vec: Vec<[u64; 4]>) -> Vec { - // CHECK-NOT: loop - // CHECK-NOT: call + // FIXME These checks should be the same as other functions. + // CHECK-NOT: @__rust_alloc + // CHECK-NOT: @__rust_alloc vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect() } // CHECK-LABEL: @vec_iterator_cast_deaggregate #[no_mangle] pub fn vec_iterator_cast_deaggregate(vec: Vec) -> Vec<[u64; 4]> { - // CHECK-NOT: loop - // CHECK-NOT: call + // FIXME These checks should be the same as other functions. + // CHECK-NOT: @__rust_alloc + // CHECK-NOT: @__rust_alloc // Safety: For the purpose of this test we assume that Bar layout matches [u64; 4]. // This currently is not guaranteed for repr(Rust) types, but it happens to work here and diff --git a/src/test/mir-opt/inline/caller-with-trivial-bound.rs b/src/test/mir-opt/inline/caller-with-trivial-bound.rs new file mode 100644 index 0000000000000..8545db89414a7 --- /dev/null +++ b/src/test/mir-opt/inline/caller-with-trivial-bound.rs @@ -0,0 +1,26 @@ +// ignore-wasm32 compiled with panic=abort by default +// needs-unwind + +#![crate_type = "lib"] +pub trait Factory { + type Item; +} + +pub struct IntFactory; + +impl Factory for IntFactory { + type Item = usize; +} + +// EMIT_MIR caller_with_trivial_bound.foo.Inline.diff +pub fn foo() +where + IntFactory: Factory, +{ + let mut x: >::Item = bar::(); +} + +#[inline(always)] +pub fn bar() -> >::Item { + 0usize +} diff --git a/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff b/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff new file mode 100644 index 0000000000000..5d236373a4ce0 --- /dev/null +++ b/src/test/mir-opt/inline/caller_with_trivial_bound.foo.Inline.diff @@ -0,0 +1,33 @@ +- // MIR for `foo` before Inline ++ // MIR for `foo` after Inline + + fn foo() -> () { + let mut _0: (); // return place in scope 0 at $DIR/caller-with-trivial-bound.rs:17:1: 17:1 + let mut _1: >::Item; // in scope 0 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 + scope 1 { + debug x => _1; // in scope 1 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 + } + + bb0: { + StorageLive(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:20:9: 20:14 + _1 = bar::() -> bb1; // scope 0 at $DIR/caller-with-trivial-bound.rs:20:51: 20:61 + // mir::Constant + // + span: $DIR/caller-with-trivial-bound.rs:20:51: 20:59 + // + literal: Const { ty: fn() -> >::Item {bar::}, val: Value(Scalar()) } + } + + bb1: { + _0 = const (); // scope 0 at $DIR/caller-with-trivial-bound.rs:19:1: 21:2 + drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/caller-with-trivial-bound.rs:21:1: 21:2 + } + + bb2: { + StorageDead(_1); // scope 0 at $DIR/caller-with-trivial-bound.rs:21:1: 21:2 + return; // scope 0 at $DIR/caller-with-trivial-bound.rs:21:2: 21:2 + } + + bb3 (cleanup): { + resume; // scope 0 at $DIR/caller-with-trivial-bound.rs:16:1: 21:2 + } + } + diff --git a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff index b732e7cdb9bf8..3b32cb809113e 100644 --- a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff @@ -5,17 +5,20 @@ let mut _0: (); // return place in scope 0 at $DIR/inline-cycle.rs:13:10: 13:10 let _1: (); // in scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 + scope 1 (inlined ::call) { // at $DIR/inline-cycle.rs:14:5: 14:24 ++ scope 2 (inlined as Call>::call) { // at $DIR/inline-cycle.rs:43:9: 43:23 ++ scope 3 (inlined as Call>::call) { // at $DIR/inline-cycle.rs:28:9: 28:31 ++ } ++ } + } bb0: { StorageLive(_1); // scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 - _1 = ::call() -> bb1; // scope 0 at $DIR/inline-cycle.rs:14:5: 14:24 -+ _1 = as Call>::call() -> bb1; // scope 1 at $DIR/inline-cycle.rs:43:9: 43:23 ++ _1 = ::call() -> bb1; // scope 3 at $DIR/inline-cycle.rs:36:9: 36:28 // mir::Constant - // + span: $DIR/inline-cycle.rs:14:5: 14:22 -- // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } -+ // + span: $DIR/inline-cycle.rs:43:9: 43:21 -+ // + literal: Const { ty: fn() { as Call>::call}, val: Value(Scalar()) } ++ // + span: $DIR/inline-cycle.rs:36:9: 36:26 + // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } } bb1: { diff --git a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff index eac5bf8edec4b..c7f8a64afcd8d 100644 --- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff @@ -11,6 +11,9 @@ + let _3: (); // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:8 + let mut _4: fn() {f}; // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:6 + scope 2 (inlined >::call_once - shim(fn() {f})) { // at $DIR/inline-cycle.rs:54:5: 54:8 ++ scope 3 (inlined f) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL ++ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:59:5: 59:12 ++ } + } + } @@ -21,19 +24,26 @@ + _2 = f; // scope 0 at $DIR/inline-cycle.rs:49:5: 49:12 // mir::Constant - // + span: $DIR/inline-cycle.rs:49:5: 49:9 -- // + literal: Const { ty: fn(fn() {f}) {call::}, val: Value(Scalar()) } -- // mir::Constant - // + span: $DIR/inline-cycle.rs:49:10: 49:11 - // + literal: Const { ty: fn() {f}, val: Value(Scalar()) } ++ // + span: $DIR/inline-cycle.rs:49:10: 49:11 ++ // + literal: Const { ty: fn() {f}, val: Value(Scalar()) } + StorageLive(_3); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8 + StorageLive(_4); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:6 + _4 = move _2; // scope 1 at $DIR/inline-cycle.rs:54:5: 54:6 + StorageLive(_5); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8 + _5 = const (); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8 -+ _3 = move _4() -> bb1; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL ++ StorageLive(_6); // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12 ++ _6 = call::(f) -> bb1; // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12 ++ // mir::Constant ++ // + span: $DIR/inline-cycle.rs:59:5: 59:9 + // + literal: Const { ty: fn(fn() {f}) {call::}, val: Value(Scalar()) } + // mir::Constant +- // + span: $DIR/inline-cycle.rs:49:10: 49:11 ++ // + span: $DIR/inline-cycle.rs:59:10: 59:11 + // + literal: Const { ty: fn() {f}, val: Value(Scalar()) } } bb1: { ++ StorageDead(_6); // scope 3 at $DIR/inline-cycle.rs:59:12: 59:13 + StorageDead(_5); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8 + StorageDead(_4); // scope 1 at $DIR/inline-cycle.rs:54:7: 54:8 + StorageDead(_3); // scope 1 at $DIR/inline-cycle.rs:54:8: 54:9 diff --git a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff index 267f53a8dfe7b..2a19b21510a10 100644 --- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff @@ -4,12 +4,22 @@ fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/inline-cycle-generic.rs:8:11: 8:11 let _1: (); // in scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 ++ scope 1 (inlined ::call) { // at $DIR/inline-cycle-generic.rs:9:5: 9:24 ++ scope 2 (inlined as Call>::call) { // at $DIR/inline-cycle-generic.rs:38:9: 38:31 ++ scope 3 (inlined ::call) { // at $DIR/inline-cycle-generic.rs:31:9: 31:28 ++ scope 4 (inlined as Call>::call) { // at $DIR/inline-cycle-generic.rs:23:9: 23:31 ++ } ++ } ++ } ++ } bb0: { StorageLive(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 - _1 = ::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 +- _1 = ::call() -> bb1; // scope 0 at $DIR/inline-cycle-generic.rs:9:5: 9:24 ++ _1 = ::call() -> bb1; // scope 4 at $DIR/inline-cycle-generic.rs:31:9: 31:28 // mir::Constant - // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22 +- // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22 ++ // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26 // + literal: Const { ty: fn() {::call}, val: Value(Scalar()) } } @@ -17,6 +27,10 @@ StorageDead(_1); // scope 0 at $DIR/inline-cycle-generic.rs:9:24: 9:25 _0 = const (); // scope 0 at $DIR/inline-cycle-generic.rs:8:11: 10:2 return; // scope 0 at $DIR/inline-cycle-generic.rs:10:2: 10:2 ++ } ++ ++ bb2 (cleanup): { ++ resume; // scope 0 at $DIR/inline-cycle-generic.rs:8:1: 10:2 } } diff --git a/src/test/ui/issues/issue-67552.rs b/src/test/ui/issues/issue-67552.rs index 98192dae20da8..ec1997ccd5d66 100644 --- a/src/test/ui/issues/issue-67552.rs +++ b/src/test/ui/issues/issue-67552.rs @@ -1,4 +1,5 @@ // build-fail +// compile-flags: -Copt-level=0 // normalize-stderr-test: ".nll/" -> "/" fn main() { diff --git a/src/test/ui/issues/issue-67552.stderr b/src/test/ui/issues/issue-67552.stderr index cf05a72e921e0..2968be7c71fb5 100644 --- a/src/test/ui/issues/issue-67552.stderr +++ b/src/test/ui/issues/issue-67552.stderr @@ -1,11 +1,11 @@ error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>` - --> $DIR/issue-67552.rs:28:9 + --> $DIR/issue-67552.rs:29:9 | LL | rec(identity(&mut it)) | ^^^^^^^^^^^^^^^^^^^^^^ | note: `rec` defined here - --> $DIR/issue-67552.rs:21:1 + --> $DIR/issue-67552.rs:22:1 | LL | / fn rec(mut it: T) LL | | where diff --git a/src/test/ui/panics/location-detail-unwrap-no-file.rs b/src/test/ui/panics/location-detail-unwrap-no-file.rs index 16cf8a17ff190..5955d9a25ae73 100644 --- a/src/test/ui/panics/location-detail-unwrap-no-file.rs +++ b/src/test/ui/panics/location-detail-unwrap-no-file.rs @@ -1,6 +1,6 @@ // run-fail // check-run-results -// compile-flags: -Zlocation-detail=line,column +// compile-flags: -Copt-level=0 -Zlocation-detail=line,column // exec-env:RUST_BACKTRACE=0 fn main() { diff --git a/src/test/ui/polymorphization/generators.rs b/src/test/ui/polymorphization/generators.rs index 68ea4a026d7bf..779bac0ace29b 100644 --- a/src/test/ui/polymorphization/generators.rs +++ b/src/test/ui/polymorphization/generators.rs @@ -1,5 +1,5 @@ // build-fail -// compile-flags:-Zpolymorphize=on +// compile-flags:-Zpolymorphize=on -Zinline-mir=off #![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)] //~^ WARN the feature `generic_const_exprs` is incomplete diff --git a/src/test/ui/polymorphization/predicates.rs b/src/test/ui/polymorphization/predicates.rs index dea1e21e77fe3..6a5fc2e33de63 100644 --- a/src/test/ui/polymorphization/predicates.rs +++ b/src/test/ui/polymorphization/predicates.rs @@ -1,5 +1,6 @@ // build-fail -// compile-flags:-Zpolymorphize=on +// compile-flags: -Copt-level=0 -Zpolymorphize=on + #![feature(rustc_attrs)] // This test checks that `T` is considered used in `foo`, because it is used in a predicate for diff --git a/src/test/ui/polymorphization/predicates.stderr b/src/test/ui/polymorphization/predicates.stderr index dc6ebceae2197..6a74e63fdfe3b 100644 --- a/src/test/ui/polymorphization/predicates.stderr +++ b/src/test/ui/polymorphization/predicates.stderr @@ -1,17 +1,17 @@ error: item has unused generic parameters - --> $DIR/predicates.rs:14:4 + --> $DIR/predicates.rs:15:4 | LL | fn foo(_: I) | ^^^ - generic parameter `T` is unused error: item has unused generic parameters - --> $DIR/predicates.rs:23:4 + --> $DIR/predicates.rs:24:4 | LL | fn baz(_: I) | ^^^ - generic parameter `T` is unused error: item has unused generic parameters - --> $DIR/predicates.rs:44:19 + --> $DIR/predicates.rs:45:19 | LL | impl<'a, I, T: 'a, E> Iterator for Foo<'a, I, E> | - - generic parameter `E` is unused @@ -22,7 +22,7 @@ LL | self.find(|_| true) | ^^^^^^^^ error: item has unused generic parameters - --> $DIR/predicates.rs:58:4 + --> $DIR/predicates.rs:59:4 | LL | fn quux() -> usize | ^^^^ - - generic parameter `B` is unused @@ -30,19 +30,19 @@ LL | fn quux() -> usize | generic parameter `A` is unused error: item has unused generic parameters - --> $DIR/predicates.rs:75:4 + --> $DIR/predicates.rs:76:4 | LL | fn foobar() -> usize | ^^^^^^ - generic parameter `F` is unused error: item has unused generic parameters - --> $DIR/predicates.rs:9:4 + --> $DIR/predicates.rs:10:4 | LL | fn bar() { | ^^^ - generic parameter `I` is unused note: the above error was encountered while instantiating `fn foo::, T>` - --> $DIR/predicates.rs:85:5 + --> $DIR/predicates.rs:86:5 | LL | foo(x.iter()); | ^^^^^^^^^^^^^ diff --git a/src/test/ui/recursion/issue-83150.rs b/src/test/ui/recursion/issue-83150.rs index aa3f66b2e28e1..e647f0ff4fb8b 100644 --- a/src/test/ui/recursion/issue-83150.rs +++ b/src/test/ui/recursion/issue-83150.rs @@ -1,5 +1,6 @@ // build-fail -//~^ ERROR overflow evaluating the requirement +// compile-flags: -Copt-level=0 +//~^^ ERROR overflow evaluating the requirement fn main() { let mut iter = 0u8..1; diff --git a/src/test/ui/recursion/issue-83150.stderr b/src/test/ui/recursion/issue-83150.stderr index 4c8469be62616..aaa5884c60c77 100644 --- a/src/test/ui/recursion/issue-83150.stderr +++ b/src/test/ui/recursion/issue-83150.stderr @@ -1,5 +1,5 @@ warning: function cannot return without recursing - --> $DIR/issue-83150.rs:9:1 + --> $DIR/issue-83150.rs:10:1 | LL | fn func>(iter: &mut T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing @@ -9,10 +9,10 @@ LL | func(&mut iter.map(|x| x + 1)) = note: `#[warn(unconditional_recursion)]` on by default = help: a `loop` may express intention better if this is on purpose -error[E0275]: overflow evaluating the requirement `Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>: Iterator` +error[E0275]: overflow evaluating the requirement `Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>: Iterator` | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`) - = note: required because of the requirements on the impl of `Iterator` for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>, [closure@$DIR/issue-83150.rs:10:24: 10:33]>` + = note: required because of the requirements on the impl of `Iterator` for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>, [closure@$DIR/issue-83150.rs:11:24: 11:33]>` error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.rs b/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.rs deleted file mode 100644 index fd975aaaee4a8..0000000000000 --- a/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.rs +++ /dev/null @@ -1,43 +0,0 @@ -// known-bug: #93008 -// build-fail -// failure-status: 101 -// compile-flags:--crate-type=lib -Zmir-opt-level=3 -// rustc-env:RUST_BACKTRACE=0 - -// normalize-stderr-test "thread 'rustc' panicked.*" -> "thread 'rustc' panicked" -// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> "" -// normalize-stderr-test "error: internal compiler error.*" -> "error: internal compiler error" -// normalize-stderr-test "encountered.*with incompatible types:" "encountered ... with incompatible types:" -// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" -// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" -// normalize-stderr-test "note: compiler flags.*\n\n" -> "" -// normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "query stack during panic:\n" -> "" -// normalize-stderr-test "we're just showing a limited slice of the query stack\n" -> "" -// normalize-stderr-test "end of query stack\n" -> "" -// normalize-stderr-test "#.*\n" -> "" - -// This is a known bug that @compiler-errors tried to fix in #94238, -// but the solution was probably not correct. - -pub trait Factory { - type Item; -} - -pub struct IntFactory; - -impl Factory for IntFactory { - type Item = usize; -} - -pub fn foo() -where - IntFactory: Factory, -{ - let mut x: >::Item = bar::(); -} - -#[inline] -pub fn bar() -> >::Item { - 0usize -} diff --git a/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.stderr b/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.stderr deleted file mode 100644 index 56cc5c93c96f2..0000000000000 --- a/src/test/ui/trait-bounds/select-param-env-instead-of-blanket.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: internal compiler error - -error: internal compiler error - encountered ... with incompatible types: - left-hand side has type: >::Item - right-hand side has type: usize - --> $DIR/select-param-env-instead-of-blanket.rs:42:5 - | -LL | let mut x: >::Item = bar::(); - | ---------- in this inlined function call -... -LL | 0usize - | ^^^^^^ - | - = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:128:36 - -thread 'rustc' panicked - diff --git a/src/test/ui/traits/issue-91949-hangs-on-recursion.rs b/src/test/ui/traits/issue-91949-hangs-on-recursion.rs index cf2218fe52292..499a64f281699 100644 --- a/src/test/ui/traits/issue-91949-hangs-on-recursion.rs +++ b/src/test/ui/traits/issue-91949-hangs-on-recursion.rs @@ -1,4 +1,5 @@ // build-fail +// compile-flags: -Zinline-mir=no // error-pattern: overflow evaluating the requirement `(): Sized` // error-pattern: function cannot return without recursing diff --git a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr index 6c04616344f54..f34e7d270f914 100644 --- a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr +++ b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr @@ -1,5 +1,5 @@ warning: function cannot return without recursing - --> $DIR/issue-91949-hangs-on-recursion.rs:21:1 + --> $DIR/issue-91949-hangs-on-recursion.rs:22:1 | LL | / fn recurse(elements: T) -> Vec LL | | where @@ -18,7 +18,7 @@ error[E0275]: overflow evaluating the requirement `(): Sized` = help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`) = note: required because of the requirements on the impl of `Iterator` for `std::iter::Empty<()>` = note: 171 redundant requirements hidden - = note: required because of the requirements on the impl of `Iterator` for `IteratorOfWrapped<(), Map>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>` + = note: required because of the requirements on the impl of `Iterator` for `IteratorOfWrapped<(), Map>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:52]>>` error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/type_length_limit.rs b/src/test/ui/type_length_limit.rs index c1f3acbecf95f..ce6fdf811213f 100644 --- a/src/test/ui/type_length_limit.rs +++ b/src/test/ui/type_length_limit.rs @@ -1,8 +1,10 @@ // build-fail // error-pattern: reached the type-length limit while instantiating +// compile-flags: -Copt-level=0 // normalize-stderr-test: ".nll/" -> "/" // Test that the type length limit can be changed. +// The exact type depends on optimizations, so disable them. #![allow(dead_code)] #![type_length_limit="4"]