diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs index 907a3f16b068..a71508c84f68 100644 --- a/compiler/rustc_borrowck/src/region_infer/mod.rs +++ b/compiler/rustc_borrowck/src/region_infer/mod.rs @@ -1950,8 +1950,14 @@ impl<'tcx> RegionInferenceContext<'tcx> { target_test: impl Fn(RegionVid) -> bool, ) -> (BlameConstraint<'tcx>, Vec) { // Find all paths - let (path, target_region) = - self.find_constraint_paths_between_regions(from_region, target_test).unwrap(); + let (path, target_region) = self + .find_constraint_paths_between_regions(from_region, target_test) + .or_else(|| { + self.find_constraint_paths_between_regions(from_region, |r| { + self.cannot_name_placeholder(from_region, r) + }) + }) + .unwrap(); debug!( "path={:#?}", path.iter() diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index e7ce5bc61401..3b02254548b1 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -266,7 +266,23 @@ fn default_hook(info: &PanicHookInfo<'_>) { // Use a lock to prevent mixed output in multithreading context. // Some platforms also require it when printing a backtrace, like `SymFromAddr` on Windows. let mut lock = backtrace::lock(); - let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}"); + // Try to write the panic message to a buffer first to prevent other concurrent outputs + // interleaving with it. + let mut buffer = [0u8; 512]; + let mut cursor = crate::io::Cursor::new(&mut buffer[..]); + + let write_msg = |dst: &mut dyn crate::io::Write| { + // We add a newline to ensure the panic message appears at the start of a line. + writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}") + }; + + if write_msg(&mut cursor).is_ok() { + let pos = cursor.position() as usize; + let _ = err.write_all(&buffer[0..pos]); + } else { + // The message did not fit into the buffer, write it directly instead. + let _ = write_msg(err); + }; static FIRST_PANIC: AtomicBool = AtomicBool::new(true); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 27b7d55f4d08..3c9e0914b59d 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -268,7 +268,7 @@ fn clean_poly_trait_ref_with_constraints<'tcx>( ) } -fn clean_lifetime(lifetime: &hir::Lifetime, cx: &mut DocContext<'_>) -> Lifetime { +fn clean_lifetime(lifetime: &hir::Lifetime, cx: &DocContext<'_>) -> Lifetime { if let Some( rbv::ResolvedArg::EarlyBound(did) | rbv::ResolvedArg::LateBound(_, _, did) @@ -362,9 +362,9 @@ pub(crate) fn clean_predicate<'tcx>( let bound_predicate = predicate.kind(); match bound_predicate.skip_binder() { ty::ClauseKind::Trait(pred) => clean_poly_trait_predicate(bound_predicate.rebind(pred), cx), - ty::ClauseKind::RegionOutlives(pred) => clean_region_outlives_predicate(pred), + ty::ClauseKind::RegionOutlives(pred) => Some(clean_region_outlives_predicate(pred)), ty::ClauseKind::TypeOutlives(pred) => { - clean_type_outlives_predicate(bound_predicate.rebind(pred), cx) + Some(clean_type_outlives_predicate(bound_predicate.rebind(pred), cx)) } ty::ClauseKind::Projection(pred) => { Some(clean_projection_predicate(bound_predicate.rebind(pred), cx)) @@ -396,32 +396,30 @@ fn clean_poly_trait_predicate<'tcx>( }) } -fn clean_region_outlives_predicate( - pred: ty::RegionOutlivesPredicate<'_>, -) -> Option { +fn clean_region_outlives_predicate(pred: ty::RegionOutlivesPredicate<'_>) -> WherePredicate { let ty::OutlivesPredicate(a, b) = pred; - Some(WherePredicate::RegionPredicate { + WherePredicate::RegionPredicate { lifetime: clean_middle_region(a).expect("failed to clean lifetime"), bounds: vec![GenericBound::Outlives( clean_middle_region(b).expect("failed to clean bounds"), )], - }) + } } fn clean_type_outlives_predicate<'tcx>( pred: ty::Binder<'tcx, ty::TypeOutlivesPredicate<'tcx>>, cx: &mut DocContext<'tcx>, -) -> Option { +) -> WherePredicate { let ty::OutlivesPredicate(ty, lt) = pred.skip_binder(); - Some(WherePredicate::BoundPredicate { + WherePredicate::BoundPredicate { ty: clean_middle_ty(pred.rebind(ty), cx, None, None), bounds: vec![GenericBound::Outlives( clean_middle_region(lt).expect("failed to clean lifetimes"), )], bound_params: Vec::new(), - }) + } } fn clean_middle_term<'tcx>( @@ -1860,7 +1858,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T /// Returns `None` if the type could not be normalized fn normalize<'tcx>( - cx: &mut DocContext<'tcx>, + cx: &DocContext<'tcx>, ty: ty::Binder<'tcx, Ty<'tcx>>, ) -> Option>> { // HACK: low-churn fix for #79459 while we wait for a trait normalization fix diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr index 5f306cc8ab1f..8e63d78d759d 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index aef45042e8bd..b2a501db7763 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index aef45042e8bd..b2a501db7763 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr index a81e8226e5ac..767fd929fd44 100644 --- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr +++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr index db876cb5ce6d..e2a3d1600ea7 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr index ffc3a3eae960..2c9bea1724d6 100644 --- a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr +++ b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: aborted execution: attempted to instantiate uninhabited type `!` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr index 49cfc473bdff..0634298a38f3 100644 --- a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr +++ b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: aborted execution: attempted to zero-initialize type `fn()`, which is invalid note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/abort_unwind.stderr b/src/tools/miri/tests/fail/panic/abort_unwind.stderr index e9c5413693e4..3a63cb38ad06 100644 --- a/src/tools/miri/tests/fail/panic/abort_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/abort_unwind.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC: PANIC!!! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr index c152d1a96058..6ba39e8f7e23 100644 --- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr +++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr index 3e00821796ef..16e933be4348 100644 --- a/src/tools/miri/tests/fail/panic/double_panic.stderr +++ b/src/tools/miri/tests/fail/panic/double_panic.stderr @@ -1,10 +1,13 @@ + thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: first note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC: second stack backtrace: + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr index c5f04d581ca3..ca32722942fa 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC: panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr index 535cddfd4d41..8d113d805889 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr index e74cf342e3f4..2ce753ba6898 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr index 3983d169bdd8..c9c5ae107b79 100644 --- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr +++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr index d93062b4bdce..aadb9976609c 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr @@ -1,3 +1,4 @@ + thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr index c0a2a30dbe13..546ee7e1ed21 100644 --- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr +++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr @@ -1,3 +1,4 @@ + thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC: ow fatal runtime error: thread local panicked on drop diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr index e1c0fabd03d3..f2548bf5cdb2 100644 --- a/src/tools/miri/tests/fail/terminate-terminator.stderr +++ b/src/tools/miri/tests/fail/terminate-terminator.stderr @@ -1,9 +1,11 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best. + thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr index 818371220514..7b9a4383fc4c 100644 --- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr +++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a function that cannot unwind stack backtrace: diff --git a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr index 363298e49d99..2be069683213 100644 --- a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr +++ b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC: alloc error hook called note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr index 2cdff03f10f0..ddee4fd6ce37 100644 --- a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr +++ b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC: memory allocation of 4 bytes failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr index e47a754d38dd..4d4b0062d5e1 100644 --- a/src/tools/miri/tests/panic/div-by-zero-2.stderr +++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC: attempt to divide by zero note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr index ec75b6201c28..8bcd635e8bed 100644 --- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr +++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr @@ -1,8 +1,11 @@ + thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic + thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC: explicit panic diff --git a/src/tools/miri/tests/panic/mir-validation.stderr b/src/tools/miri/tests/panic/mir-validation.stderr index 534e2d5881ff..dc70d129da3c 100644 --- a/src/tools/miri/tests/panic/mir-validation.stderr +++ b/src/tools/miri/tests/panic/mir-validation.stderr @@ -1,3 +1,4 @@ + thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC: broken MIR in Item(DefId) (after phase change to runtime-optimized) at bb0[1]: place (*(_2.0: *mut i32)) has deref as a later projection (it is only permitted as the first projection) diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr index d608cec20a48..c0dabaff7721 100644 --- a/src/tools/miri/tests/panic/oob_subslice.stderr +++ b/src/tools/miri/tests/panic/oob_subslice.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC: range end index 5 out of range for slice of length 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr index 29150052b30d..d674e2beb8db 100644 --- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr +++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC: attempt to shift left with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr index 9a71a797dae8..bb94f2e12c4e 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr index b671c53c611d..0a29a57f3e13 100644 --- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr +++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC: attempt to shift right with overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr index 7e011bfd53b1..130bc7737a49 100644 --- a/src/tools/miri/tests/panic/panic1.stderr +++ b/src/tools/miri/tests/panic/panic1.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/panic1.rs:LL:CC: panicking from libstd stack backtrace: diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr index 5640bd0b8d6a..157ffdb6b5de 100644 --- a/src/tools/miri/tests/panic/panic2.stderr +++ b/src/tools/miri/tests/panic/panic2.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/panic2.rs:LL:CC: 42-panicking from libstd note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr index 0114320503b1..529ef70870b1 100644 --- a/src/tools/miri/tests/panic/panic3.stderr +++ b/src/tools/miri/tests/panic/panic3.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/panic3.rs:LL:CC: panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr index f13b355ea45a..ecd07dd7dedf 100644 --- a/src/tools/miri/tests/panic/panic4.stderr +++ b/src/tools/miri/tests/panic/panic4.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/panic4.rs:LL:CC: 42-panicking from libcore note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr index a9bc0eb9d01c..71e2d7a82085 100644 --- a/src/tools/miri/tests/panic/transmute_fat2.stderr +++ b/src/tools/miri/tests/panic/transmute_fat2.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC: index out of bounds: the len is 0 but the index is 0 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr index cb74312a83ae..bc745fca578c 100644 --- a/src/tools/miri/tests/pass/panic/catch_panic.stderr +++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr @@ -1,35 +1,46 @@ + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect Caught panic message (&str): Hello from std::panic + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic: 1 Caught panic message (String): Hello from std::panic: 1 + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from std::panic_any: 2 Caught panic message (String): Hello from std::panic_any: 2 + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Box Failed to get caught panic message. + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic Caught panic message (&str): Hello from core::panic + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: Hello from core::panic: 5 Caught panic message (String): Hello from core::panic: 5 + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: index out of bounds: the len is 3 but the index is 4 Caught panic message (String): index out of bounds: the len is 3 but the index is 4 + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: attempt to divide by zero Caught panic message (&str): attempt to divide by zero + thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC: align_offset: align is not a power-of-two Caught panic message (&str): align_offset: align is not a power-of-two + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false + thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC: assertion failed: false Caught panic message (&str): assertion failed: false diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr index 9c87489e8db3..4a3ac16debca 100644 --- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr +++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr @@ -1,5 +1,6 @@ Thread 1 starting, will block on mutex Thread 1 reported it has started + thread '' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 2 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace @@ -7,6 +8,7 @@ note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` Thread 2 blocking on thread 1 Thread 2 reported it has started Unlocking mutex + thread '' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC: panic in thread 1 Thread 1 has exited diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr index e066f7dfce16..8aff8f6ec550 100644 --- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr +++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: once note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC: twice stack backtrace: diff --git a/src/tools/miri/tests/pass/panic/thread_panic.stderr b/src/tools/miri/tests/pass/panic/thread_panic.stderr index 9464e76b6c9c..3bb2991805c9 100644 --- a/src/tools/miri/tests/pass/panic/thread_panic.stderr +++ b/src/tools/miri/tests/pass/panic/thread_panic.stderr @@ -1,6 +1,8 @@ + thread '' panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect + thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC: Hello, world! diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 401169c838f7..a02d02086455 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1667; +const ISSUES_ENTRY_LIMIT: u32 = 1679; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/run-make/libtest-json/output-default.json b/tests/run-make/libtest-json/output-default.json index a2293a032d01..a6a8a9f3b477 100644 --- a/tests/run-make/libtest-json/output-default.json +++ b/tests/run-make/libtest-json/output-default.json @@ -2,7 +2,7 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } { "type": "test", "name": "c", "event": "ok" } { "type": "test", "event": "started", "name": "d" } diff --git a/tests/run-make/libtest-json/output-stdout-success.json b/tests/run-make/libtest-json/output-stdout-success.json index cf92f01f63ac..a6c36e746b38 100644 --- a/tests/run-make/libtest-json/output-stdout-success.json +++ b/tests/run-make/libtest-json/output-stdout-success.json @@ -2,9 +2,9 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" } { "type": "test", "event": "started", "name": "c" } -{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" } +{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" } { "type": "test", "event": "started", "name": "d" } { "type": "test", "name": "d", "event": "ignored", "message": "msg" } { "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": "$EXEC_TIME" } diff --git a/tests/run-make/libtest-junit/output-default.xml b/tests/run-make/libtest-junit/output-default.xml index 58a9a28744f6..aa1b8c855aad 100644 --- a/tests/run-make/libtest-junit/output-default.xml +++ b/tests/run-make/libtest-junit/output-default.xml @@ -1 +1 @@ - + diff --git a/tests/run-make/libtest-junit/output-stdout-success.xml b/tests/run-make/libtest-junit/output-stdout-success.xml index 723816a4acda..2592ec7efb16 100644 --- a/tests/run-make/libtest-junit/output-stdout-success.xml +++ b/tests/run-make/libtest-junit/output-stdout-success.xml @@ -1 +1 @@ - + diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout index 1b37249dd60f..7aa965d543b1 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout @@ -26,6 +26,7 @@ stdout 2 stderr: stderr 1 stderr 2 + thread 'main' panicked at $DIR/failed-doctest-output-windows.rs:7:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout index 7b0cf9a432d4..a333f341ce53 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-output.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-output.stdout @@ -26,6 +26,7 @@ stdout 2 stderr: stderr 1 stderr 2 + thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/rustdoc-ui/ice-bug-report-url.stderr b/tests/rustdoc-ui/ice-bug-report-url.stderr index 66622a7654c9..14a961c2ce01 100644 --- a/tests/rustdoc-ui/ice-bug-report-url.stderr +++ b/tests/rustdoc-ui/ice-bug-report-url.stderr @@ -5,6 +5,7 @@ LL | fn wrong() | ^ expected one of `->`, `where`, or `{` + aborting due to `-Z treat-err-as-bug=1` stack backtrace: diff --git a/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout b/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout index 2102e2c38918..87d1e772b808 100644 --- a/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout +++ b/tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout @@ -8,6 +8,7 @@ failures: Test executable failed (exit status: 101). stderr: + thread 'main' panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/array-slice-vec/dst-raw-slice.rs b/tests/ui/array-slice-vec/dst-raw-slice.rs index f1281f4e302f..8430676f1068 100644 --- a/tests/ui/array-slice-vec/dst-raw-slice.rs +++ b/tests/ui/array-slice-vec/dst-raw-slice.rs @@ -1,7 +1,7 @@ // Test bounds checking for DST raw slices //@ run-fail -//@ error-pattern:index out of bounds +//@ check-run-results:index out of bounds //@ ignore-emscripten no processes #[allow(unconditional_panic)] diff --git a/tests/ui/array-slice-vec/dst-raw-slice.run.stderr b/tests/ui/array-slice-vec/dst-raw-slice.run.stderr new file mode 100644 index 000000000000..1948ed5c568d --- /dev/null +++ b/tests/ui/array-slice-vec/dst-raw-slice.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/dst-raw-slice.rs:11:18: +index out of bounds: the len is 3 but the index is 3 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/array-slice-vec/vec-overrun.rs b/tests/ui/array-slice-vec/vec-overrun.rs index 10f8350869fb..732d56546d86 100644 --- a/tests/ui/array-slice-vec/vec-overrun.rs +++ b/tests/ui/array-slice-vec/vec-overrun.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 1 but the index is 2 +//@ check-run-results:index out of bounds: the len is 1 but the index is 2 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/array-slice-vec/vec-overrun.run.stderr b/tests/ui/array-slice-vec/vec-overrun.run.stderr new file mode 100644 index 000000000000..6f1a56845b55 --- /dev/null +++ b/tests/ui/array-slice-vec/vec-overrun.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/vec-overrun.rs:11:17: +index out of bounds: the len is 1 but the index is 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs index a8b05a4befa5..81d9eec61614 100644 --- a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs @@ -2,8 +2,8 @@ // be talking about `async fn`s instead. //@ run-fail -//@ error-pattern: thread 'main' panicked -//@ error-pattern: `async fn` resumed after completion +//@ check-run-results: thread 'main' panicked +//@ check-run-results: `async fn` resumed after completion //@ edition:2018 #![feature(coroutines, coroutine_trait)] diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.run.stderr b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.run.stderr new file mode 100644 index 000000000000..f4b9dfbe9a07 --- /dev/null +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-completion.rs:11:16: +`async fn` resumed after completion +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs index 94366e662638..7ac00042ac92 100644 --- a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs @@ -3,8 +3,8 @@ //@ run-fail //@ needs-unwind -//@ error-pattern: thread 'main' panicked -//@ error-pattern: `async fn` resumed after panicking +//@ check-run-results: thread 'main' panicked +//@ check-run-results: `async fn` resumed after panicking //@ edition:2018 #![feature(coroutines, coroutine_trait)] diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.run.stderr b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.run.stderr new file mode 100644 index 000000000000..a0f0eceb552a --- /dev/null +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:15:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:14:16: +`async fn` resumed after panicking diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs b/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs index 6b7dfc1235e8..757ab8a75b17 100644 --- a/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs @@ -3,7 +3,7 @@ // panic when resumed after completion. //@ run-fail -//@ error-pattern:coroutine resumed after completion +//@ check-run-results:coroutine resumed after completion //@ edition:2018 #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] diff --git a/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.run.stderr b/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.run.stderr new file mode 100644 index 000000000000..8ea3512c66a3 --- /dev/null +++ b/tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-65419-coroutine-resume-after-completion.rs:15:5: +coroutine resumed after completion +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/backtrace/synchronized-panic-handler.run.stderr b/tests/ui/backtrace/synchronized-panic-handler.run.stderr index 8a06d00ea599..7a60ef2da60f 100644 --- a/tests/ui/backtrace/synchronized-panic-handler.run.stderr +++ b/tests/ui/backtrace/synchronized-panic-handler.run.stderr @@ -1,5 +1,7 @@ + thread '' panicked at $DIR/synchronized-panic-handler.rs:11:5: oops oh no woe is me note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread '' panicked at $DIR/synchronized-panic-handler.rs:11:5: oops oh no woe is me diff --git a/tests/ui/binop/binop-fail-3.rs b/tests/ui/binop/binop-fail-3.rs index b1e70a1c5961..3170db524da1 100644 --- a/tests/ui/binop/binop-fail-3.rs +++ b/tests/ui/binop/binop-fail-3.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:quux +//@ check-run-results:quux //@ ignore-emscripten no processes fn foo() -> ! { diff --git a/tests/ui/binop/binop-fail-3.run.stderr b/tests/ui/binop/binop-fail-3.run.stderr new file mode 100644 index 000000000000..ded58ce52b73 --- /dev/null +++ b/tests/ui/binop/binop-fail-3.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/binop-fail-3.rs:6:5: +quux +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/binop/binop-panic.rs b/tests/ui/binop/binop-panic.rs index 8dbf62a922e4..73ade8db4a0e 100644 --- a/tests/ui/binop/binop-panic.rs +++ b/tests/ui/binop/binop-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:quux +//@ check-run-results:quux //@ ignore-emscripten no processes fn my_err(s: String) -> ! { diff --git a/tests/ui/binop/binop-panic.run.stderr b/tests/ui/binop/binop-panic.run.stderr new file mode 100644 index 000000000000..09fcb1a8e81a --- /dev/null +++ b/tests/ui/binop/binop-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/binop-panic.rs:7:5: +quux +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/binop/binop-panic.run.stdout b/tests/ui/binop/binop-panic.run.stdout new file mode 100644 index 000000000000..b023018cabc3 --- /dev/null +++ b/tests/ui/binop/binop-panic.run.stdout @@ -0,0 +1 @@ +bye diff --git a/tests/ui/borrowck/borrowck-local-borrow.rs b/tests/ui/borrowck/borrowck-local-borrow.rs index de6ee5983c86..f742ce09a0af 100644 --- a/tests/ui/borrowck/borrowck-local-borrow.rs +++ b/tests/ui/borrowck/borrowck-local-borrow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:panic 1 +//@ check-run-results:panic 1 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/borrowck/borrowck-local-borrow.run.stderr b/tests/ui/borrowck/borrowck-local-borrow.run.stderr new file mode 100644 index 000000000000..0d156ec2e714 --- /dev/null +++ b/tests/ui/borrowck/borrowck-local-borrow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/borrowck-local-borrow.rs:8:5: +panic 1 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/crashes/133252.rs b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.rs similarity index 81% rename from tests/crashes/133252.rs rename to tests/ui/borrowck/implementation-not-general-enough-ice-133252.rs index 3cecf448287b..7ee16e62b9a7 100644 --- a/tests/crashes/133252.rs +++ b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.rs @@ -1,4 +1,4 @@ -//@ known-bug: #133252 +// Regression test for borrowck ICE #133252 //@ edition:2021 use std::future::Future; @@ -7,6 +7,8 @@ fn ice() -> impl Future { async { let not_static = 0; force_send(async_load(¬_static)); + //~^ ERROR implementation of `LoadQuery` is not general enough + //~| ERROR `not_static` does not live long enough loop {} } } @@ -41,3 +43,5 @@ impl Future for SimpleFuture { loop {} } } + +fn main() {} diff --git a/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr new file mode 100644 index 000000000000..13c768dcbf63 --- /dev/null +++ b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr @@ -0,0 +1,34 @@ +error: implementation of `LoadQuery` is not general enough + --> $DIR/implementation-not-general-enough-ice-133252.rs:9:9 + | +LL | force_send(async_load(¬_static)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `LoadQuery` is not general enough + | + = note: `LoadQuery<'0>` would have to be implemented for the type `&u8`, for any lifetime `'0`... + = note: ...but `LoadQuery<'1>` is actually implemented for the type `&'1 u8`, for some specific lifetime `'1` + +error[E0597]: `not_static` does not live long enough + --> $DIR/implementation-not-general-enough-ice-133252.rs:9:31 + | +LL | async { + | - return type of async block is &(dyn Owned + '1) +LL | let not_static = 0; + | ---------- binding `not_static` declared here +LL | force_send(async_load(¬_static)); + | -----------^^^^^^^^^^^- + | | | + | | borrowed value does not live long enough + | argument requires that `not_static` is borrowed for `'1` +... +LL | } + | - `not_static` dropped here while still borrowed + | +note: due to current limitations in the borrow checker, this implies a `'static` lifetime + --> $DIR/implementation-not-general-enough-ice-133252.rs:16:18 + | +LL | fn force_send(_: T) {} + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/tests/ui/borrowck/issue-28934.rs b/tests/ui/borrowck/issue-28934.rs index a3ac663c5b5c..aef9098a9f34 100644 --- a/tests/ui/borrowck/issue-28934.rs +++ b/tests/ui/borrowck/issue-28934.rs @@ -2,7 +2,7 @@ // which were not being considered during the contraction phase. //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes struct Parser<'i: 't, 't>(&'i u8, &'t u8); diff --git a/tests/ui/borrowck/issue-28934.run.stderr b/tests/ui/borrowck/issue-28934.run.stderr new file mode 100644 index 000000000000..8f1475a5ead9 --- /dev/null +++ b/tests/ui/borrowck/issue-28934.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-28934.rs:14:9: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/closures/diverging-closure.rs b/tests/ui/closures/diverging-closure.rs index dda829d8af42..191beeccb9de 100644 --- a/tests/ui/closures/diverging-closure.rs +++ b/tests/ui/closures/diverging-closure.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:oops +//@ check-run-results:oops //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/closures/diverging-closure.run.stderr b/tests/ui/closures/diverging-closure.run.stderr new file mode 100644 index 000000000000..01020b04a597 --- /dev/null +++ b/tests/ui/closures/diverging-closure.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/diverging-closure.rs:7:9: +oops +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr index 01529599d37d..c851a8380f2c 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -1,6 +1,7 @@ error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:LL:CC: unsized type for `NullaryOp::SizeOf` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + Box query stack during panic: #0 [eval_to_allocation_raw] const-evaluating + checking `::{constant#0}` diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.stderr b/tests/ui/consts/const-eval/const-eval-query-stack.stderr index 0a28c5b80bf7..5a71c770fdc7 100644 --- a/tests/ui/consts/const-eval/const-eval-query-stack.stderr +++ b/tests/ui/consts/const-eval/const-eval-query-stack.stderr @@ -4,6 +4,7 @@ error: internal compiler error[E0080]: evaluation of constant value failed LL | const X: i32 = 1 / 0; | ^^^^^ attempt to divide `1_i32` by zero + note: please make sure that you have updated to the latest nightly query stack during panic: diff --git a/tests/ui/consts/issue-29798.rs b/tests/ui/consts/issue-29798.rs index bdabbad6491f..663fd2e87707 100644 --- a/tests/ui/consts/issue-29798.rs +++ b/tests/ui/consts/issue-29798.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 5 but the index is 5 +//@ check-run-results:index out of bounds: the len is 5 but the index is 5 //@ ignore-emscripten no processes const fn test(x: usize) -> i32 { diff --git a/tests/ui/consts/issue-29798.run.stderr b/tests/ui/consts/issue-29798.run.stderr new file mode 100644 index 000000000000..8be15d9e6c79 --- /dev/null +++ b/tests/ui/consts/issue-29798.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-29798.rs:6:5: +index out of bounds: the len is 5 but the index is 5 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/coroutine/coroutine-resume-after-panic.rs b/tests/ui/coroutine/coroutine-resume-after-panic.rs index 2745ebc61326..7c9a53d291ae 100644 --- a/tests/ui/coroutine/coroutine-resume-after-panic.rs +++ b/tests/ui/coroutine/coroutine-resume-after-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ needs-unwind -//@ error-pattern:coroutine resumed after panicking +//@ check-run-results:coroutine resumed after panicking //@ ignore-emscripten no processes // Test that we get the correct message for resuming a panicked coroutine. diff --git a/tests/ui/coroutine/coroutine-resume-after-panic.run.stderr b/tests/ui/coroutine/coroutine-resume-after-panic.run.stderr new file mode 100644 index 000000000000..26d6e8628d04 --- /dev/null +++ b/tests/ui/coroutine/coroutine-resume-after-panic.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:18:9: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:17:30: +coroutine resumed after panicking diff --git a/tests/ui/expr/if/expr-if-panic-fn.rs b/tests/ui/expr/if/expr-if-panic-fn.rs index 4f3d7fd48e36..2aa44cb7265a 100644 --- a/tests/ui/expr/if/expr-if-panic-fn.rs +++ b/tests/ui/expr/if/expr-if-panic-fn.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn f() -> ! { diff --git a/tests/ui/expr/if/expr-if-panic-fn.run.stderr b/tests/ui/expr/if/expr-if-panic-fn.run.stderr new file mode 100644 index 000000000000..feafe49558a9 --- /dev/null +++ b/tests/ui/expr/if/expr-if-panic-fn.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/expr-if-panic-fn.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/expr/if/expr-if-panic.rs b/tests/ui/expr/if/expr-if-panic.rs index 0b43d1d6b006..6fbfada7be8f 100644 --- a/tests/ui/expr/if/expr-if-panic.rs +++ b/tests/ui/expr/if/expr-if-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/expr/if/expr-if-panic.run.stderr b/tests/ui/expr/if/expr-if-panic.run.stderr new file mode 100644 index 000000000000..cb7fd3ece561 --- /dev/null +++ b/tests/ui/expr/if/expr-if-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/expr-if-panic.rs:9:9: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/expr/if/if-check-panic.rs b/tests/ui/expr/if/if-check-panic.rs index 4b400deaca46..7210441213bf 100644 --- a/tests/ui/expr/if/if-check-panic.rs +++ b/tests/ui/expr/if/if-check-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:Number is odd +//@ check-run-results:Number is odd //@ ignore-emscripten no processes fn even(x: usize) -> bool { diff --git a/tests/ui/expr/if/if-check-panic.run.stderr b/tests/ui/expr/if/if-check-panic.run.stderr new file mode 100644 index 000000000000..ee8294d68319 --- /dev/null +++ b/tests/ui/expr/if/if-check-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/if-check-panic.rs:19:9: +Number is odd +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/expr/if/if-cond-bot.rs b/tests/ui/expr/if/if-cond-bot.rs index ddb5559ffca7..84b1e96a412b 100644 --- a/tests/ui/expr/if/if-cond-bot.rs +++ b/tests/ui/expr/if/if-cond-bot.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:quux +//@ check-run-results:quux //@ ignore-emscripten no processes fn my_err(s: String) -> ! { diff --git a/tests/ui/expr/if/if-cond-bot.run.stderr b/tests/ui/expr/if/if-cond-bot.run.stderr new file mode 100644 index 000000000000..669059b57f50 --- /dev/null +++ b/tests/ui/expr/if/if-cond-bot.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/if-cond-bot.rs:7:5: +quux +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/expr/if/if-cond-bot.run.stdout b/tests/ui/expr/if/if-cond-bot.run.stdout new file mode 100644 index 000000000000..b023018cabc3 --- /dev/null +++ b/tests/ui/expr/if/if-cond-bot.run.stdout @@ -0,0 +1 @@ +bye diff --git a/tests/ui/extern/extern-types-field-offset.run.stderr b/tests/ui/extern/extern-types-field-offset.run.stderr index 1b04b860db5a..07bd4fcb13f9 100644 --- a/tests/ui/extern/extern-types-field-offset.run.stderr +++ b/tests/ui/extern/extern-types-field-offset.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `Opaque` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/extern/extern-types-size_of_val.align.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr index 20c4d8785e84..5ba372d60fa7 100644 --- a/tests/ui/extern/extern-types-size_of_val.align.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.align.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr index 20c4d8785e84..5ba372d60fa7 100644 --- a/tests/ui/extern/extern-types-size_of_val.size.run.stderr +++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: attempted to compute the size or alignment of extern type `A` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/extern/issue-18576.rs b/tests/ui/extern/issue-18576.rs index 0a98e85e4844..a1345979f022 100644 --- a/tests/ui/extern/issue-18576.rs +++ b/tests/ui/extern/issue-18576.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:stop +//@ check-run-results:stop //@ ignore-emscripten no processes // #18576 diff --git a/tests/ui/extern/issue-18576.run.stderr b/tests/ui/extern/issue-18576.run.stderr new file mode 100644 index 000000000000..7a401840fe4b --- /dev/null +++ b/tests/ui/extern/issue-18576.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-18576.rs:11:5: +stop +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/fn/expr-fn-panic.rs b/tests/ui/fn/expr-fn-panic.rs index 23946b7533d6..67419a1393fc 100644 --- a/tests/ui/fn/expr-fn-panic.rs +++ b/tests/ui/fn/expr-fn-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn f() -> ! { diff --git a/tests/ui/fn/expr-fn-panic.run.stderr b/tests/ui/fn/expr-fn-panic.run.stderr new file mode 100644 index 000000000000..00b51164e489 --- /dev/null +++ b/tests/ui/fn/expr-fn-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/expr-fn-panic.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/hashmap/hashmap-capacity-overflow.rs b/tests/ui/hashmap/hashmap-capacity-overflow.rs index 91aebc3bbba8..c50bb6322478 100644 --- a/tests/ui/hashmap/hashmap-capacity-overflow.rs +++ b/tests/ui/hashmap/hashmap-capacity-overflow.rs @@ -1,6 +1,7 @@ //@ run-fail //@ error-pattern:capacity overflow //@ ignore-emscripten no processes +//@ compile-flags: --remap-path-prefix={{rust-src-base}}=remapped use std::collections::hash_map::HashMap; use std::mem::size_of; diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr index b9086ecef814..5cd07dcda4c4 100644 --- a/tests/ui/hygiene/panic-location.run.stderr +++ b/tests/ui/hygiene/panic-location.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/panic-location.rs:LL:CC: capacity overflow note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/imports/glob-use-std.rs b/tests/ui/imports/glob-use-std.rs index b625543da81f..6aff0ee78e22 100644 --- a/tests/ui/imports/glob-use-std.rs +++ b/tests/ui/imports/glob-use-std.rs @@ -1,7 +1,7 @@ // Issue #7580 //@ run-fail -//@ error-pattern:panic works +//@ check-run-results:panic works //@ ignore-emscripten no processes use std::*; diff --git a/tests/ui/imports/glob-use-std.run.stderr b/tests/ui/imports/glob-use-std.run.stderr new file mode 100644 index 000000000000..87d7bbf8ef0f --- /dev/null +++ b/tests/ui/imports/glob-use-std.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/glob-use-std.rs:10:5: +panic works +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr index a0024c0920ff..71d792b7f771 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8: byte index 1 is out of bounds of `` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr index 8f38d54146b8..4f11f5966ed1 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:15:5: Aaah! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/not-overridden.stderr b/tests/ui/intrinsics/not-overridden.stderr index 9b8849cea1ce..b5273a4fa47f 100644 --- a/tests/ui/intrinsics/not-overridden.stderr +++ b/tests/ui/intrinsics/not-overridden.stderr @@ -4,6 +4,7 @@ error: must be overridden by codegen backend, but isn't LL | unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + query stack during panic: end of query stack error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-12920.rs b/tests/ui/issues/issue-12920.rs index 7f453e499d48..9ed61b17115d 100644 --- a/tests/ui/issues/issue-12920.rs +++ b/tests/ui/issues/issue-12920.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes pub fn main() { diff --git a/tests/ui/issues/issue-12920.run.stderr b/tests/ui/issues/issue-12920.run.stderr new file mode 100644 index 000000000000..92e8c2b22c18 --- /dev/null +++ b/tests/ui/issues/issue-12920.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-12920.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-13202.rs b/tests/ui/issues/issue-13202.rs index 89205fc7fd1a..d78e66ac87af 100644 --- a/tests/ui/issues/issue-13202.rs +++ b/tests/ui/issues/issue-13202.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:bad input +//@ check-run-results:bad input //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/issues/issue-13202.run.stderr b/tests/ui/issues/issue-13202.run.stderr new file mode 100644 index 000000000000..2edadb4becd2 --- /dev/null +++ b/tests/ui/issues/issue-13202.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-13202.rs:6:27: +bad input +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-20971.rs b/tests/ui/issues/issue-20971.rs index 377a3d9ea304..066c8cde9908 100644 --- a/tests/ui/issues/issue-20971.rs +++ b/tests/ui/issues/issue-20971.rs @@ -1,7 +1,7 @@ // Regression test for Issue #20971. //@ run-fail -//@ error-pattern:Hello, world! +//@ check-run-results:Hello, world! //@ ignore-emscripten no processes pub trait Parser { diff --git a/tests/ui/issues/issue-20971.run.stderr b/tests/ui/issues/issue-20971.run.stderr new file mode 100644 index 000000000000..93fa571a3ae4 --- /dev/null +++ b/tests/ui/issues/issue-20971.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-20971.rs:18:5: +Hello, world! +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-23354-2.rs b/tests/ui/issues/issue-23354-2.rs index 90de1276cc6b..30eaeebeadbf 100644 --- a/tests/ui/issues/issue-23354-2.rs +++ b/tests/ui/issues/issue-23354-2.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:panic evaluated +//@ check-run-results:panic evaluated //@ ignore-emscripten no processes #[allow(unused_variables)] diff --git a/tests/ui/issues/issue-23354-2.run.stderr b/tests/ui/issues/issue-23354-2.run.stderr new file mode 100644 index 000000000000..6d896c0c8c93 --- /dev/null +++ b/tests/ui/issues/issue-23354-2.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-23354-2.rs:8:14: +panic evaluated +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-23354.rs b/tests/ui/issues/issue-23354.rs index 31783842dac0..238b38a18f49 100644 --- a/tests/ui/issues/issue-23354.rs +++ b/tests/ui/issues/issue-23354.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:panic evaluated +//@ check-run-results:panic evaluated //@ ignore-emscripten no processes #[allow(unused_variables)] diff --git a/tests/ui/issues/issue-23354.run.stderr b/tests/ui/issues/issue-23354.run.stderr new file mode 100644 index 000000000000..6eef0d750df7 --- /dev/null +++ b/tests/ui/issues/issue-23354.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-23354.rs:7:14: +panic evaluated +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-2761.rs b/tests/ui/issues/issue-2761.rs index b44a24e09f25..9b641288b884 100644 --- a/tests/ui/issues/issue-2761.rs +++ b/tests/ui/issues/issue-2761.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:custom message +//@ check-run-results:custom message //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/issues/issue-2761.run.stderr b/tests/ui/issues/issue-2761.run.stderr new file mode 100644 index 000000000000..e64e358d433c --- /dev/null +++ b/tests/ui/issues/issue-2761.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-2761.rs:6:5: +custom message +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-3029.rs b/tests/ui/issues/issue-3029.rs index a070578969cb..7ab26716a7fa 100644 --- a/tests/ui/issues/issue-3029.rs +++ b/tests/ui/issues/issue-3029.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:so long +//@ check-run-results:so long //@ ignore-emscripten no processes #![allow(unreachable_code)] diff --git a/tests/ui/issues/issue-3029.run.stderr b/tests/ui/issues/issue-3029.run.stderr new file mode 100644 index 000000000000..aa694de13492 --- /dev/null +++ b/tests/ui/issues/issue-3029.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-3029.rs:10:5: +so long +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-30380.rs b/tests/ui/issues/issue-30380.rs index 534bb3423d0f..322612617ca8 100644 --- a/tests/ui/issues/issue-30380.rs +++ b/tests/ui/issues/issue-30380.rs @@ -2,7 +2,7 @@ // destroyed values lying around for other destructors to observe. //@ run-fail -//@ error-pattern:panicking destructors ftw! +//@ check-run-results:panicking destructors ftw! //@ ignore-emscripten no processes struct Observer<'a>(&'a mut FilledOnDrop); diff --git a/tests/ui/issues/issue-30380.run.stderr b/tests/ui/issues/issue-30380.run.stderr new file mode 100644 index 000000000000..8d57c1e5fdee --- /dev/null +++ b/tests/ui/issues/issue-30380.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-30380.rs:17:13: +panicking destructors ftw! +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-44216-add-instant.rs b/tests/ui/issues/issue-44216-add-instant.rs index ca2c52b99a82..75fc57b50136 100644 --- a/tests/ui/issues/issue-44216-add-instant.rs +++ b/tests/ui/issues/issue-44216-add-instant.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:overflow +//@ check-run-results:overflow use std::time::{Duration, Instant}; diff --git a/tests/ui/issues/issue-44216-add-instant.run.stderr b/tests/ui/issues/issue-44216-add-instant.run.stderr new file mode 100644 index 000000000000..09d288875943 --- /dev/null +++ b/tests/ui/issues/issue-44216-add-instant.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at library/std/src/time.rs:417:33: +overflow when adding duration to instant +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-44216-add-system-time.rs b/tests/ui/issues/issue-44216-add-system-time.rs index 207f72fade81..476fc6696e3a 100644 --- a/tests/ui/issues/issue-44216-add-system-time.rs +++ b/tests/ui/issues/issue-44216-add-system-time.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:overflow +//@ check-run-results:overflow //@ ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/tests/ui/issues/issue-44216-add-system-time.run.stderr b/tests/ui/issues/issue-44216-add-system-time.run.stderr new file mode 100644 index 000000000000..1d377287081b --- /dev/null +++ b/tests/ui/issues/issue-44216-add-system-time.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at library/std/src/time.rs:601:31: +overflow when adding duration to instant +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-44216-sub-instant.rs b/tests/ui/issues/issue-44216-sub-instant.rs index 2457d2aaa044..10ca3b613d75 100644 --- a/tests/ui/issues/issue-44216-sub-instant.rs +++ b/tests/ui/issues/issue-44216-sub-instant.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:overflow +//@ check-run-results:overflow //@ ignore-emscripten no processes use std::time::{Instant, Duration}; diff --git a/tests/ui/issues/issue-44216-sub-instant.run.stderr b/tests/ui/issues/issue-44216-sub-instant.run.stderr new file mode 100644 index 000000000000..3bce1f8626b8 --- /dev/null +++ b/tests/ui/issues/issue-44216-sub-instant.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at library/std/src/time.rs:433:33: +overflow when subtracting duration from instant +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-44216-sub-system-time.rs b/tests/ui/issues/issue-44216-sub-system-time.rs index 7e33f2279337..59cb018c2c25 100644 --- a/tests/ui/issues/issue-44216-sub-system-time.rs +++ b/tests/ui/issues/issue-44216-sub-system-time.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:overflow +//@ check-run-results:overflow //@ ignore-emscripten no processes use std::time::{Duration, SystemTime}; diff --git a/tests/ui/issues/issue-44216-sub-system-time.run.stderr b/tests/ui/issues/issue-44216-sub-system-time.run.stderr new file mode 100644 index 000000000000..0c814b2926ab --- /dev/null +++ b/tests/ui/issues/issue-44216-sub-system-time.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at library/std/src/time.rs:617:31: +overflow when subtracting duration from instant +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/issues/issue-87707.run.stderr b/tests/ui/issues/issue-87707.run.stderr index 255a77a6ab12..eb1d65a081fe 100644 --- a/tests/ui/issues/issue-87707.run.stderr +++ b/tests/ui/issues/issue-87707.run.stderr @@ -1,5 +1,7 @@ + thread 'main' panicked at $DIR/issue-87707.rs:14:24: Here Once instance is poisoned. note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/issue-87707.rs:16:7: Once instance has previously been poisoned diff --git a/tests/ui/layout/valid_range_oob.stderr b/tests/ui/layout/valid_range_oob.stderr index d56804a35a7f..9c360b2cd6e7 100644 --- a/tests/ui/layout/valid_range_oob.stderr +++ b/tests/ui/layout/valid_range_oob.stderr @@ -1,3 +1,4 @@ + 257 > 255 error: the compiler unexpectedly panicked. this is a bug. diff --git a/tests/ui/loops/for-each-loop-panic.rs b/tests/ui/loops/for-each-loop-panic.rs index 04784cac8f2f..429519767025 100644 --- a/tests/ui/loops/for-each-loop-panic.rs +++ b/tests/ui/loops/for-each-loop-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:moop +//@ check-run-results:moop //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/loops/for-each-loop-panic.run.stderr b/tests/ui/loops/for-each-loop-panic.run.stderr new file mode 100644 index 000000000000..fb21679d1009 --- /dev/null +++ b/tests/ui/loops/for-each-loop-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/for-each-loop-panic.rs:7:9: +moop +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.rs b/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.rs index 03717c7c22d5..d2459c1fb586 100644 --- a/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.rs +++ b/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -C opt-level=3 -//@ error-pattern: index out of bounds: the len is 0 but the index is 16777216 +//@ check-run-results: index out of bounds: the len is 0 but the index is 16777216 fn do_test(x: usize) { let mut arr = vec![vec![0u8; 3]]; diff --git a/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.run.stderr b/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.run.stderr new file mode 100644 index 000000000000..b9cb5008f14d --- /dev/null +++ b/tests/ui/loops/issue-69225-SCEVAddExpr-wrap-flag.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-69225-SCEVAddExpr-wrap-flag.rs:22:17: +index out of bounds: the len is 0 but the index is 16777216 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/loops/issue-69225-layout-repeated-checked-add.rs b/tests/ui/loops/issue-69225-layout-repeated-checked-add.rs index 048c7c8872c1..580a6491dfc5 100644 --- a/tests/ui/loops/issue-69225-layout-repeated-checked-add.rs +++ b/tests/ui/loops/issue-69225-layout-repeated-checked-add.rs @@ -3,7 +3,7 @@ //@ run-fail //@ compile-flags: -C opt-level=3 -//@ error-pattern: index out of bounds: the len is 0 but the index is 16777216 +//@ check-run-results: index out of bounds: the len is 0 but the index is 16777216 fn do_test(x: usize) { let arr = vec![vec![0u8; 3]]; diff --git a/tests/ui/loops/issue-69225-layout-repeated-checked-add.run.stderr b/tests/ui/loops/issue-69225-layout-repeated-checked-add.run.stderr new file mode 100644 index 000000000000..c627f5e9a48b --- /dev/null +++ b/tests/ui/loops/issue-69225-layout-repeated-checked-add.run.stderr @@ -0,0 +1,4 @@ +0 0 3 0 +thread 'main' panicked at $DIR/issue-69225-layout-repeated-checked-add.rs:20:35: +index out of bounds: the len is 0 but the index is 16777216 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-as-macro.rs b/tests/ui/macros/assert-as-macro.rs index 391b056292f8..ffb660893a2b 100644 --- a/tests/ui/macros/assert-as-macro.rs +++ b/tests/ui/macros/assert-as-macro.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:assertion failed: 1 == 2 +//@ check-run-results:assertion failed: 1 == 2 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-as-macro.run.stderr b/tests/ui/macros/assert-as-macro.run.stderr new file mode 100644 index 000000000000..c07fb8d7ef87 --- /dev/null +++ b/tests/ui/macros/assert-as-macro.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/assert-as-macro.rs:6:5: +assertion failed: 1 == 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-eq-macro-msg.rs b/tests/ui/macros/assert-eq-macro-msg.rs index 39eeefeeef90..3cff91bc5663 100644 --- a/tests/ui/macros/assert-eq-macro-msg.rs +++ b/tests/ui/macros/assert-eq-macro-msg.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:assertion `left == right` failed: 1 + 1 definitely should be 3 -//@ error-pattern: left: 2 -//@ error-pattern: right: 3 +//@ check-run-results:assertion `left == right` failed: 1 + 1 definitely should be 3 +//@ check-run-results: left: 2 +//@ check-run-results: right: 3 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-eq-macro-msg.run.stderr b/tests/ui/macros/assert-eq-macro-msg.run.stderr new file mode 100644 index 000000000000..b3cf1add2888 --- /dev/null +++ b/tests/ui/macros/assert-eq-macro-msg.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/assert-eq-macro-msg.rs:8:5: +assertion `left == right` failed: 1 + 1 definitely should be 3 + left: 2 + right: 3 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-eq-macro-panic.rs b/tests/ui/macros/assert-eq-macro-panic.rs index 22c3a8a634f4..23595766610c 100644 --- a/tests/ui/macros/assert-eq-macro-panic.rs +++ b/tests/ui/macros/assert-eq-macro-panic.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:assertion `left == right` failed -//@ error-pattern: left: 14 -//@ error-pattern: right: 15 +//@ check-run-results:assertion `left == right` failed +//@ check-run-results: left: 14 +//@ check-run-results: right: 15 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-eq-macro-panic.run.stderr b/tests/ui/macros/assert-eq-macro-panic.run.stderr new file mode 100644 index 000000000000..6860f1c7a890 --- /dev/null +++ b/tests/ui/macros/assert-eq-macro-panic.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/assert-eq-macro-panic.rs:8:5: +assertion `left == right` failed + left: 14 + right: 15 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-long-condition.run.stderr b/tests/ui/macros/assert-long-condition.run.stderr index 5c0ff357cb7a..c2c5fe5d7d5a 100644 --- a/tests/ui/macros/assert-long-condition.run.stderr +++ b/tests/ui/macros/assert-long-condition.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/assert-long-condition.rs:7:5: assertion failed: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 == 0 diff --git a/tests/ui/macros/assert-macro-explicit.rs b/tests/ui/macros/assert-macro-explicit.rs index 167581d2525e..ad331feac268 100644 --- a/tests/ui/macros/assert-macro-explicit.rs +++ b/tests/ui/macros/assert-macro-explicit.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:assertion failed: false +//@ check-run-results:assertion failed: false //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-explicit.run.stderr b/tests/ui/macros/assert-macro-explicit.run.stderr new file mode 100644 index 000000000000..42b12ebe41b3 --- /dev/null +++ b/tests/ui/macros/assert-macro-explicit.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/assert-macro-explicit.rs:6:5: +assertion failed: false +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-macro-fmt.rs b/tests/ui/macros/assert-macro-fmt.rs index 475544303796..cd4e8681ec28 100644 --- a/tests/ui/macros/assert-macro-fmt.rs +++ b/tests/ui/macros/assert-macro-fmt.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern: panicked -//@ error-pattern: test-assert-fmt 42 rust +//@ check-run-results: panicked +//@ check-run-results: test-assert-fmt 42 rust //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-fmt.run.stderr b/tests/ui/macros/assert-macro-fmt.run.stderr new file mode 100644 index 000000000000..e283fb5f46c6 --- /dev/null +++ b/tests/ui/macros/assert-macro-fmt.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/assert-macro-fmt.rs:7:5: +test-assert-fmt 42 rust +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-macro-owned.rs b/tests/ui/macros/assert-macro-owned.rs index 46a59db1390c..e6dad778cb2f 100644 --- a/tests/ui/macros/assert-macro-owned.rs +++ b/tests/ui/macros/assert-macro-owned.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:test-assert-owned +//@ check-run-results:panicked +//@ check-run-results:test-assert-owned //@ ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/macros/assert-macro-owned.run.stderr b/tests/ui/macros/assert-macro-owned.run.stderr new file mode 100644 index 000000000000..e6d29a57534d --- /dev/null +++ b/tests/ui/macros/assert-macro-owned.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/assert-macro-owned.rs:9:5: +test-assert-owned +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-macro-static.rs b/tests/ui/macros/assert-macro-static.rs index 7d9e345d516a..9fe778fb59e8 100644 --- a/tests/ui/macros/assert-macro-static.rs +++ b/tests/ui/macros/assert-macro-static.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:test-assert-static +//@ check-run-results:panicked +//@ check-run-results:test-assert-static //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-macro-static.run.stderr b/tests/ui/macros/assert-macro-static.run.stderr new file mode 100644 index 000000000000..48b0c3241b20 --- /dev/null +++ b/tests/ui/macros/assert-macro-static.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/assert-macro-static.rs:7:5: +test-assert-static +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-matches-macro-msg.rs b/tests/ui/macros/assert-matches-macro-msg.rs index efa4121da923..60cc344369d3 100644 --- a/tests/ui/macros/assert-matches-macro-msg.rs +++ b/tests/ui/macros/assert-matches-macro-msg.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:assertion `left matches right` failed: 1 + 1 definitely should be 3 -//@ error-pattern: left: 2 -//@ error-pattern: right: 3 +//@ check-run-results:assertion `left matches right` failed: 1 + 1 definitely should be 3 +//@ check-run-results: left: 2 +//@ check-run-results: right: 3 //@ ignore-emscripten no processes #![feature(assert_matches)] diff --git a/tests/ui/macros/assert-matches-macro-msg.run.stderr b/tests/ui/macros/assert-matches-macro-msg.run.stderr new file mode 100644 index 000000000000..4a8f7e475f3f --- /dev/null +++ b/tests/ui/macros/assert-matches-macro-msg.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/assert-matches-macro-msg.rs:12:5: +assertion `left matches right` failed: 1 + 1 definitely should be 3 + left: 2 + right: 3 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-ne-macro-msg.rs b/tests/ui/macros/assert-ne-macro-msg.rs index 0a578e1baf93..9fb50fb600a5 100644 --- a/tests/ui/macros/assert-ne-macro-msg.rs +++ b/tests/ui/macros/assert-ne-macro-msg.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:assertion `left != right` failed: 1 + 1 definitely should not be 2 -//@ error-pattern: left: 2 -//@ error-pattern: right: 2 +//@ check-run-results:assertion `left != right` failed: 1 + 1 definitely should not be 2 +//@ check-run-results: left: 2 +//@ check-run-results: right: 2 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-ne-macro-msg.run.stderr b/tests/ui/macros/assert-ne-macro-msg.run.stderr new file mode 100644 index 000000000000..3320bfb4c62b --- /dev/null +++ b/tests/ui/macros/assert-ne-macro-msg.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/assert-ne-macro-msg.rs:8:5: +assertion `left != right` failed: 1 + 1 definitely should not be 2 + left: 2 + right: 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/assert-ne-macro-panic.rs b/tests/ui/macros/assert-ne-macro-panic.rs index 9cf5f05e9f18..07becf2a46f0 100644 --- a/tests/ui/macros/assert-ne-macro-panic.rs +++ b/tests/ui/macros/assert-ne-macro-panic.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:assertion `left != right` failed -//@ error-pattern: left: 14 -//@ error-pattern: right: 14 +//@ check-run-results:assertion `left != right` failed +//@ check-run-results: left: 14 +//@ check-run-results: right: 14 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/assert-ne-macro-panic.run.stderr b/tests/ui/macros/assert-ne-macro-panic.run.stderr new file mode 100644 index 000000000000..8c5bfe6d13d7 --- /dev/null +++ b/tests/ui/macros/assert-ne-macro-panic.run.stderr @@ -0,0 +1,5 @@ +thread 'main' panicked at $DIR/assert-ne-macro-panic.rs:8:5: +assertion `left != right` failed + left: 14 + right: 14 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/die-macro-2.rs b/tests/ui/macros/die-macro-2.rs index e5456bdfca0f..187fce2ea4f5 100644 --- a/tests/ui/macros/die-macro-2.rs +++ b/tests/ui/macros/die-macro-2.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:test +//@ check-run-results:test //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/die-macro-2.run.stderr b/tests/ui/macros/die-macro-2.run.stderr new file mode 100644 index 000000000000..01710b9a60e9 --- /dev/null +++ b/tests/ui/macros/die-macro-2.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/die-macro-2.rs:6:5: +test +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/die-macro-expr.rs b/tests/ui/macros/die-macro-expr.rs index fb92dd66e3dc..9d423e4ced11 100644 --- a/tests/ui/macros/die-macro-expr.rs +++ b/tests/ui/macros/die-macro-expr.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:test +//@ check-run-results:test //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/die-macro-expr.run.stderr b/tests/ui/macros/die-macro-expr.run.stderr new file mode 100644 index 000000000000..7aa09425c6b6 --- /dev/null +++ b/tests/ui/macros/die-macro-expr.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/die-macro-expr.rs:6:26: +test +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/die-macro-pure.rs b/tests/ui/macros/die-macro-pure.rs index 484eed3d720f..05a9ff42f9e9 100644 --- a/tests/ui/macros/die-macro-pure.rs +++ b/tests/ui/macros/die-macro-pure.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:test +//@ check-run-results:test //@ ignore-emscripten no processes fn f() { diff --git a/tests/ui/macros/die-macro-pure.run.stderr b/tests/ui/macros/die-macro-pure.run.stderr new file mode 100644 index 000000000000..38778a2a423f --- /dev/null +++ b/tests/ui/macros/die-macro-pure.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/die-macro-pure.rs:6:5: +test +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/unimplemented-macro-panic.rs b/tests/ui/macros/unimplemented-macro-panic.rs index d3bff8ca10ba..ed5f1ad83067 100644 --- a/tests/ui/macros/unimplemented-macro-panic.rs +++ b/tests/ui/macros/unimplemented-macro-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:not implemented +//@ check-run-results:not implemented //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/unimplemented-macro-panic.run.stderr b/tests/ui/macros/unimplemented-macro-panic.run.stderr new file mode 100644 index 000000000000..4a75d8fd00f8 --- /dev/null +++ b/tests/ui/macros/unimplemented-macro-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unimplemented-macro-panic.rs:6:5: +not implemented +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/unreachable-fmt-msg.rs b/tests/ui/macros/unreachable-fmt-msg.rs index b16394a1920e..c53536c53598 100644 --- a/tests/ui/macros/unreachable-fmt-msg.rs +++ b/tests/ui/macros/unreachable-fmt-msg.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:internal error: entered unreachable code: 6 is not prime +//@ check-run-results:internal error: entered unreachable code: 6 is not prime //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/unreachable-fmt-msg.run.stderr b/tests/ui/macros/unreachable-fmt-msg.run.stderr new file mode 100644 index 000000000000..321b08ecb8ef --- /dev/null +++ b/tests/ui/macros/unreachable-fmt-msg.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unreachable-fmt-msg.rs:6:5: +internal error: entered unreachable code: 6 is not prime +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/unreachable-macro-panic.rs b/tests/ui/macros/unreachable-macro-panic.rs index 7909bcb76242..9888a35dd034 100644 --- a/tests/ui/macros/unreachable-macro-panic.rs +++ b/tests/ui/macros/unreachable-macro-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:internal error: entered unreachable code +//@ check-run-results:internal error: entered unreachable code //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/unreachable-macro-panic.run.stderr b/tests/ui/macros/unreachable-macro-panic.run.stderr new file mode 100644 index 000000000000..bb428252d63a --- /dev/null +++ b/tests/ui/macros/unreachable-macro-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unreachable-macro-panic.rs:6:5: +internal error: entered unreachable code +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/unreachable-static-msg.rs b/tests/ui/macros/unreachable-static-msg.rs index 3e917897da45..e6f4255af863 100644 --- a/tests/ui/macros/unreachable-static-msg.rs +++ b/tests/ui/macros/unreachable-static-msg.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:internal error: entered unreachable code: uhoh +//@ check-run-results:internal error: entered unreachable code: uhoh //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/unreachable-static-msg.run.stderr b/tests/ui/macros/unreachable-static-msg.run.stderr new file mode 100644 index 000000000000..12bfe2a59531 --- /dev/null +++ b/tests/ui/macros/unreachable-static-msg.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unreachable-static-msg.rs:6:5: +internal error: entered unreachable code: uhoh +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/macros/unreachable.rs b/tests/ui/macros/unreachable.rs index 7909bcb76242..9888a35dd034 100644 --- a/tests/ui/macros/unreachable.rs +++ b/tests/ui/macros/unreachable.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:internal error: entered unreachable code +//@ check-run-results:internal error: entered unreachable code //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/macros/unreachable.run.stderr b/tests/ui/macros/unreachable.run.stderr new file mode 100644 index 000000000000..877e104cb81a --- /dev/null +++ b/tests/ui/macros/unreachable.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unreachable.rs:6:5: +internal error: entered unreachable code +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/match/expr-match-panic-fn.rs b/tests/ui/match/expr-match-panic-fn.rs index 82991d20df88..8cae554e2929 100644 --- a/tests/ui/match/expr-match-panic-fn.rs +++ b/tests/ui/match/expr-match-panic-fn.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn f() -> ! { diff --git a/tests/ui/match/expr-match-panic-fn.run.stderr b/tests/ui/match/expr-match-panic-fn.run.stderr new file mode 100644 index 000000000000..94aa4c9383c5 --- /dev/null +++ b/tests/ui/match/expr-match-panic-fn.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/expr-match-panic-fn.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/match/expr-match-panic.rs b/tests/ui/match/expr-match-panic.rs index e332ba83b914..0f2078717bf4 100644 --- a/tests/ui/match/expr-match-panic.rs +++ b/tests/ui/match/expr-match-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/match/expr-match-panic.run.stderr b/tests/ui/match/expr-match-panic.run.stderr new file mode 100644 index 000000000000..f0ef21455865 --- /dev/null +++ b/tests/ui/match/expr-match-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/expr-match-panic.rs:8:17: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/match/match-bot-panic.rs b/tests/ui/match/match-bot-panic.rs index a155b5fb3f27..62f57dedbb76 100644 --- a/tests/ui/match/match-bot-panic.rs +++ b/tests/ui/match/match-bot-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes #![allow(unreachable_code)] diff --git a/tests/ui/match/match-bot-panic.run.stderr b/tests/ui/match/match-bot-panic.run.stderr new file mode 100644 index 000000000000..a5331ba4f469 --- /dev/null +++ b/tests/ui/match/match-bot-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/match-bot-panic.rs:13:29: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/match/match-disc-bot.rs b/tests/ui/match/match-disc-bot.rs index fdb98a0accb8..a69f13dcbcfe 100644 --- a/tests/ui/match/match-disc-bot.rs +++ b/tests/ui/match/match-disc-bot.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:quux +//@ check-run-results:quux //@ ignore-emscripten no processes fn f() -> ! { diff --git a/tests/ui/match/match-disc-bot.run.stderr b/tests/ui/match/match-disc-bot.run.stderr new file mode 100644 index 000000000000..e7e2a55b1b74 --- /dev/null +++ b/tests/ui/match/match-disc-bot.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/match-disc-bot.rs:6:5: +quux +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/match/match-wildcards.rs b/tests/ui/match/match-wildcards.rs index 4fddee6666ea..ebad22b06a43 100644 --- a/tests/ui/match/match-wildcards.rs +++ b/tests/ui/match/match-wildcards.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:squirrelcupcake +//@ check-run-results:squirrelcupcake //@ ignore-emscripten no processes fn cmp() -> isize { diff --git a/tests/ui/match/match-wildcards.run.stderr b/tests/ui/match/match-wildcards.run.stderr new file mode 100644 index 000000000000..ce90488e256c --- /dev/null +++ b/tests/ui/match/match-wildcards.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/match-wildcards.rs:8:13: +squirrelcupcake +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/lint/storage-live.stderr b/tests/ui/mir/lint/storage-live.stderr index 7d4c3f0832a9..c70123195122 100644 --- a/tests/ui/mir/lint/storage-live.stderr +++ b/tests/ui/mir/lint/storage-live.stderr @@ -11,6 +11,7 @@ note: delayed at compiler/rustc_mir_transform/src/lint.rs:LL:CC - disabled backt LL | StorageLive(a); | ^^^^^^^^^^^^^^ + aborting due to `-Z treat-err-as-bug=1` error: the compiler unexpectedly panicked. this is a bug. diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops.rs b/tests/ui/mir/mir_codegen_calls_converging_drops.rs index 5c3c8b999b2d..5145766a98db 100644 --- a/tests/ui/mir/mir_codegen_calls_converging_drops.rs +++ b/tests/ui/mir/mir_codegen_calls_converging_drops.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:converging_fn called -//@ error-pattern:0 dropped -//@ error-pattern:exit +//@ check-run-results:converging_fn called +//@ check-run-results:0 dropped +//@ check-run-results:exit //@ ignore-emscripten no processes struct Droppable(u8); diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops.run.stderr b/tests/ui/mir/mir_codegen_calls_converging_drops.run.stderr new file mode 100644 index 000000000000..41f49b090eb0 --- /dev/null +++ b/tests/ui/mir/mir_codegen_calls_converging_drops.run.stderr @@ -0,0 +1,5 @@ +converging_fn called +0 dropped +thread 'main' panicked at $DIR/mir_codegen_calls_converging_drops.rs:25:5: +exit +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs b/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs index e3cb9a96de0d..6a6a221c3d15 100644 --- a/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs +++ b/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs @@ -1,7 +1,7 @@ //@ run-fail -//@ error-pattern:complex called -//@ error-pattern:dropped -//@ error-pattern:exit +//@ check-run-results:complex called +//@ check-run-results:dropped +//@ check-run-results:exit //@ ignore-emscripten no processes struct Droppable; diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops_2.run.stderr b/tests/ui/mir/mir_codegen_calls_converging_drops_2.run.stderr new file mode 100644 index 000000000000..c0ece81a9ef2 --- /dev/null +++ b/tests/ui/mir/mir_codegen_calls_converging_drops_2.run.stderr @@ -0,0 +1,5 @@ +complex called +dropped +thread 'main' panicked at $DIR/mir_codegen_calls_converging_drops_2.rs:29:5: +exit +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_codegen_calls_diverging.rs b/tests/ui/mir/mir_codegen_calls_diverging.rs index c62527f01d38..583ac76e5458 100644 --- a/tests/ui/mir/mir_codegen_calls_diverging.rs +++ b/tests/ui/mir/mir_codegen_calls_diverging.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:diverging_fn called +//@ check-run-results:diverging_fn called //@ ignore-emscripten no processes fn diverging_fn() -> ! { diff --git a/tests/ui/mir/mir_codegen_calls_diverging.run.stderr b/tests/ui/mir/mir_codegen_calls_diverging.run.stderr new file mode 100644 index 000000000000..3086e67108f3 --- /dev/null +++ b/tests/ui/mir/mir_codegen_calls_diverging.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/mir_codegen_calls_diverging.rs:6:5: +diverging_fn called +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_codegen_calls_diverging_drops.rs b/tests/ui/mir/mir_codegen_calls_diverging_drops.rs index b0675a6a5a0c..e4cfbff9e8ba 100644 --- a/tests/ui/mir/mir_codegen_calls_diverging_drops.rs +++ b/tests/ui/mir/mir_codegen_calls_diverging_drops.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:diverging_fn called -//@ error-pattern:0 dropped +//@ check-run-results:diverging_fn called +//@ check-run-results:0 dropped //@ needs-unwind this test checks that a destructor is called after panicking struct Droppable(u8); diff --git a/tests/ui/mir/mir_codegen_calls_diverging_drops.run.stderr b/tests/ui/mir/mir_codegen_calls_diverging_drops.run.stderr new file mode 100644 index 000000000000..ecab3a699d7a --- /dev/null +++ b/tests/ui/mir/mir_codegen_calls_diverging_drops.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at $DIR/mir_codegen_calls_diverging_drops.rs:14:5: +diverging_fn called +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +0 dropped diff --git a/tests/ui/mir/mir_drop_panics.rs b/tests/ui/mir/mir_drop_panics.rs index ec846fc241b2..94b7971d6428 100644 --- a/tests/ui/mir/mir_drop_panics.rs +++ b/tests/ui/mir/mir_drop_panics.rs @@ -1,7 +1,7 @@ //@ run-fail //@ needs-unwind -//@ error-pattern:panic 1 -//@ error-pattern:drop 2 +//@ check-run-results:panic 1 +//@ check-run-results:drop 2 struct Droppable(u32); impl Drop for Droppable { diff --git a/tests/ui/mir/mir_drop_panics.run.stderr b/tests/ui/mir/mir_drop_panics.run.stderr new file mode 100644 index 000000000000..778cd7c777a8 --- /dev/null +++ b/tests/ui/mir/mir_drop_panics.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at $DIR/mir_drop_panics.rs:10:13: +panic 1 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +drop 2 diff --git a/tests/ui/mir/mir_dynamic_drops_1.rs b/tests/ui/mir/mir_dynamic_drops_1.rs index ffb8cc26100e..58293d77c276 100644 --- a/tests/ui/mir/mir_dynamic_drops_1.rs +++ b/tests/ui/mir/mir_dynamic_drops_1.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:drop 1 -//@ error-pattern:drop 2 +//@ check-run-results:drop 1 +//@ check-run-results:drop 2 //@ ignore-emscripten no processes /// Structure which will not allow to be dropped twice. diff --git a/tests/ui/mir/mir_dynamic_drops_1.run.stderr b/tests/ui/mir/mir_dynamic_drops_1.run.stderr new file mode 100644 index 000000000000..52eecd01a94d --- /dev/null +++ b/tests/ui/mir/mir_dynamic_drops_1.run.stderr @@ -0,0 +1,5 @@ +drop 1 +drop 2 +thread 'main' panicked at $DIR/mir_dynamic_drops_1.rs:30:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_dynamic_drops_2.rs b/tests/ui/mir/mir_dynamic_drops_2.rs index dc71f414673d..a0bcf0d193c0 100644 --- a/tests/ui/mir/mir_dynamic_drops_2.rs +++ b/tests/ui/mir/mir_dynamic_drops_2.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:drop 1 +//@ check-run-results:drop 1 //@ ignore-emscripten no processes /// Structure which will not allow to be dropped twice. diff --git a/tests/ui/mir/mir_dynamic_drops_2.run.stderr b/tests/ui/mir/mir_dynamic_drops_2.run.stderr new file mode 100644 index 000000000000..b251e5f4c033 --- /dev/null +++ b/tests/ui/mir/mir_dynamic_drops_2.run.stderr @@ -0,0 +1,4 @@ +drop 1 +thread 'main' panicked at $DIR/mir_dynamic_drops_2.rs:28:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_dynamic_drops_3.rs b/tests/ui/mir/mir_dynamic_drops_3.rs index fe84502ef1dc..4b96da55f344 100644 --- a/tests/ui/mir/mir_dynamic_drops_3.rs +++ b/tests/ui/mir/mir_dynamic_drops_3.rs @@ -1,9 +1,9 @@ //@ run-fail //@ needs-unwind -//@ error-pattern:unwind happens -//@ error-pattern:drop 3 -//@ error-pattern:drop 2 -//@ error-pattern:drop 1 +//@ check-run-results:unwind happens +//@ check-run-results:drop 3 +//@ check-run-results:drop 2 +//@ check-run-results:drop 1 //@ ignore-emscripten no processes /// Structure which will not allow to be dropped twice. diff --git a/tests/ui/mir/mir_dynamic_drops_3.run.stderr b/tests/ui/mir/mir_dynamic_drops_3.run.stderr new file mode 100644 index 000000000000..6ae5ea71b123 --- /dev/null +++ b/tests/ui/mir/mir_dynamic_drops_3.run.stderr @@ -0,0 +1,6 @@ +thread 'main' panicked at $DIR/mir_dynamic_drops_3.rs:23:5: +unwind happens +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +drop 3 +drop 2 +drop 1 diff --git a/tests/ui/mir/mir_indexing_oob_1.rs b/tests/ui/mir/mir_indexing_oob_1.rs index 3afc2f0b32e6..038cc1e6e047 100644 --- a/tests/ui/mir/mir_indexing_oob_1.rs +++ b/tests/ui/mir/mir_indexing_oob_1.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 5 but the index is 10 +//@ check-run-results:index out of bounds: the len is 5 but the index is 10 //@ ignore-emscripten no processes const C: [u32; 5] = [0; 5]; diff --git a/tests/ui/mir/mir_indexing_oob_1.run.stderr b/tests/ui/mir/mir_indexing_oob_1.run.stderr new file mode 100644 index 000000000000..e6d757532899 --- /dev/null +++ b/tests/ui/mir/mir_indexing_oob_1.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/mir_indexing_oob_1.rs:9:5: +index out of bounds: the len is 5 but the index is 10 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_indexing_oob_2.rs b/tests/ui/mir/mir_indexing_oob_2.rs index 6e7c1c83536f..15c297c742ef 100644 --- a/tests/ui/mir/mir_indexing_oob_2.rs +++ b/tests/ui/mir/mir_indexing_oob_2.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 5 but the index is 10 +//@ check-run-results:index out of bounds: the len is 5 but the index is 10 //@ ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/tests/ui/mir/mir_indexing_oob_2.run.stderr b/tests/ui/mir/mir_indexing_oob_2.run.stderr new file mode 100644 index 000000000000..1e4c0628c53e --- /dev/null +++ b/tests/ui/mir/mir_indexing_oob_2.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/mir_indexing_oob_2.rs:9:5: +index out of bounds: the len is 5 but the index is 10 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/mir/mir_indexing_oob_3.rs b/tests/ui/mir/mir_indexing_oob_3.rs index 4012864c6ce6..71419ffc0a91 100644 --- a/tests/ui/mir/mir_indexing_oob_3.rs +++ b/tests/ui/mir/mir_indexing_oob_3.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 5 but the index is 10 +//@ check-run-results:index out of bounds: the len is 5 but the index is 10 //@ ignore-emscripten no processes const C: &'static [u8; 5] = b"hello"; diff --git a/tests/ui/mir/mir_indexing_oob_3.run.stderr b/tests/ui/mir/mir_indexing_oob_3.run.stderr new file mode 100644 index 000000000000..a0732b48831d --- /dev/null +++ b/tests/ui/mir/mir_indexing_oob_3.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/mir_indexing_oob_3.rs:9:5: +index out of bounds: the len is 5 but the index is 10 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/never_type/return-never-coerce.rs b/tests/ui/never_type/return-never-coerce.rs index 559b7d0e985e..4d462adae1e6 100644 --- a/tests/ui/never_type/return-never-coerce.rs +++ b/tests/ui/never_type/return-never-coerce.rs @@ -1,7 +1,7 @@ // Test that ! coerces to other types. //@ run-fail -//@ error-pattern:aah! +//@ check-run-results:aah! //@ ignore-emscripten no processes fn call_another_fn T>(f: F) -> T { diff --git a/tests/ui/never_type/return-never-coerce.run.stderr b/tests/ui/never_type/return-never-coerce.run.stderr new file mode 100644 index 000000000000..a425ac8e7881 --- /dev/null +++ b/tests/ui/never_type/return-never-coerce.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/return-never-coerce.rs:12:5: +aah! +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/nll/issue-51345-2.rs b/tests/ui/nll/issue-51345-2.rs index f2501fdbab40..ca400a5104d3 100644 --- a/tests/ui/nll/issue-51345-2.rs +++ b/tests/ui/nll/issue-51345-2.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:explicit panic +//@ check-run-results:thread 'main' panicked +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/nll/issue-51345-2.run.stderr b/tests/ui/nll/issue-51345-2.run.stderr new file mode 100644 index 000000000000..f585a7315664 --- /dev/null +++ b/tests/ui/nll/issue-51345-2.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-51345-2.rs:8:26: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/divide-by-zero.rs b/tests/ui/numbers-arithmetic/divide-by-zero.rs index 626daf9771de..a806520b911e 100644 --- a/tests/ui/numbers-arithmetic/divide-by-zero.rs +++ b/tests/ui/numbers-arithmetic/divide-by-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:attempt to divide by zero +//@ check-run-results:attempt to divide by zero //@ ignore-emscripten no processes #[allow(unconditional_panic)] diff --git a/tests/ui/numbers-arithmetic/divide-by-zero.run.stderr b/tests/ui/numbers-arithmetic/divide-by-zero.run.stderr new file mode 100644 index 000000000000..3146cdb159cb --- /dev/null +++ b/tests/ui/numbers-arithmetic/divide-by-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/divide-by-zero.rs:8:14: +attempt to divide by zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs index 8014bae2889c..4abad452fb58 100644 --- a/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-add-assign-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-add-assign-overflow.rs +//@ check-run-results:location-add-assign-overflow.rs fn main() { let mut a: u8 = 255; diff --git a/tests/ui/numbers-arithmetic/location-add-assign-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-add-assign-overflow.run.stderr new file mode 100644 index 000000000000..07872b28f032 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-add-assign-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-add-assign-overflow.rs:6:5: +attempt to add with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-add-overflow.rs b/tests/ui/numbers-arithmetic/location-add-overflow.rs index 0d2e52d532ef..81a88a01d764 100644 --- a/tests/ui/numbers-arithmetic/location-add-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-add-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-add-overflow.rs +//@ check-run-results:location-add-overflow.rs fn main() { let _: u8 = 255 + &1; diff --git a/tests/ui/numbers-arithmetic/location-add-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-add-overflow.run.stderr new file mode 100644 index 000000000000..476112d29c50 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-add-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-add-overflow.rs:5:17: +attempt to add with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs index 63fbab5ecc49..521e7e82769f 100644 --- a/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs +++ b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-divide-assign-by-zero.rs +//@ check-run-results:location-divide-assign-by-zero.rs fn main() { let mut a = 1; diff --git a/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.run.stderr b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.run.stderr new file mode 100644 index 000000000000..67ab55209f45 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-divide-assign-by-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-divide-assign-by-zero.rs:6:5: +attempt to divide by zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-divide-by-zero.rs b/tests/ui/numbers-arithmetic/location-divide-by-zero.rs index 88c1b51c1bb4..16809d44d2c4 100644 --- a/tests/ui/numbers-arithmetic/location-divide-by-zero.rs +++ b/tests/ui/numbers-arithmetic/location-divide-by-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-divide-by-zero.rs +//@ check-run-results:location-divide-by-zero.rs // https://github.com/rust-lang/rust/issues/114814 diff --git a/tests/ui/numbers-arithmetic/location-divide-by-zero.run.stderr b/tests/ui/numbers-arithmetic/location-divide-by-zero.run.stderr new file mode 100644 index 000000000000..d850ea8dfc00 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-divide-by-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-divide-by-zero.rs:7:13: +attempt to divide by zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs index ae62f5c26d9a..f54494114f5c 100644 --- a/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs +++ b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-mod-assign-by-zero.rs +//@ check-run-results:location-mod-assign-by-zero.rs fn main() { let mut a = 1; diff --git a/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.run.stderr b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.run.stderr new file mode 100644 index 000000000000..2daea7843499 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mod-assign-by-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-mod-assign-by-zero.rs:6:5: +attempt to calculate the remainder with a divisor of zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-mod-by-zero.rs b/tests/ui/numbers-arithmetic/location-mod-by-zero.rs index 6a2e1b158bf7..d2b8e02ec743 100644 --- a/tests/ui/numbers-arithmetic/location-mod-by-zero.rs +++ b/tests/ui/numbers-arithmetic/location-mod-by-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-mod-by-zero.rs +//@ check-run-results:location-mod-by-zero.rs fn main() { let _ = 1 % &0; diff --git a/tests/ui/numbers-arithmetic/location-mod-by-zero.run.stderr b/tests/ui/numbers-arithmetic/location-mod-by-zero.run.stderr new file mode 100644 index 000000000000..f4d900f9c663 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mod-by-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-mod-by-zero.rs:5:13: +attempt to calculate the remainder with a divisor of zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs index 07cec7d17303..d306c9cd86d3 100644 --- a/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-mul-assign-overflow.rs +//@ check-run-results:location-mul-assign-overflow.rs fn main() { let mut a: u8 = 255; diff --git a/tests/ui/numbers-arithmetic/location-mul-assign-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.run.stderr new file mode 100644 index 000000000000..92a260e07733 --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mul-assign-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-mul-assign-overflow.rs:6:5: +attempt to multiply with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-mul-overflow.rs b/tests/ui/numbers-arithmetic/location-mul-overflow.rs index 0a00d3beaa78..918bed47ed91 100644 --- a/tests/ui/numbers-arithmetic/location-mul-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-mul-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-mul-overflow.rs +//@ check-run-results:location-mul-overflow.rs fn main() { let _: u8 = 255 * &2; diff --git a/tests/ui/numbers-arithmetic/location-mul-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-mul-overflow.run.stderr new file mode 100644 index 000000000000..720c7355c05b --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-mul-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-mul-overflow.rs:5:17: +attempt to multiply with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs index 13f074b0ffef..9363b38cc090 100644 --- a/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-sub-assign-overflow.rs +//@ check-run-results:location-sub-assign-overflow.rs fn main() { let mut a: u8 = 0; diff --git a/tests/ui/numbers-arithmetic/location-sub-assign-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.run.stderr new file mode 100644 index 000000000000..8c3d5b3a8d1a --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-sub-assign-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-sub-assign-overflow.rs:6:5: +attempt to subtract with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/location-sub-overflow.rs b/tests/ui/numbers-arithmetic/location-sub-overflow.rs index 9a0fabe1cd63..18b16990fda0 100644 --- a/tests/ui/numbers-arithmetic/location-sub-overflow.rs +++ b/tests/ui/numbers-arithmetic/location-sub-overflow.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:location-sub-overflow.rs +//@ check-run-results:location-sub-overflow.rs fn main() { let _: u8 = 0 - &1; diff --git a/tests/ui/numbers-arithmetic/location-sub-overflow.run.stderr b/tests/ui/numbers-arithmetic/location-sub-overflow.run.stderr new file mode 100644 index 000000000000..9c53e3ca73ae --- /dev/null +++ b/tests/ui/numbers-arithmetic/location-sub-overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/location-sub-overflow.rs:5:17: +attempt to subtract with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/mod-zero.rs b/tests/ui/numbers-arithmetic/mod-zero.rs index f3cc7c9fc88f..49115876e23a 100644 --- a/tests/ui/numbers-arithmetic/mod-zero.rs +++ b/tests/ui/numbers-arithmetic/mod-zero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:attempt to calculate the remainder with a divisor of zero +//@ check-run-results:attempt to calculate the remainder with a divisor of zero //@ ignore-emscripten no processes #[allow(unconditional_panic)] diff --git a/tests/ui/numbers-arithmetic/mod-zero.run.stderr b/tests/ui/numbers-arithmetic/mod-zero.run.stderr new file mode 100644 index 000000000000..75ef2a9c300e --- /dev/null +++ b/tests/ui/numbers-arithmetic/mod-zero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/mod-zero.rs:8:14: +attempt to calculate the remainder with a divisor of zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-add.rs b/tests/ui/numbers-arithmetic/overflowing-add.rs index 16583f6eb749..6190d002fcf6 100644 --- a/tests/ui/numbers-arithmetic/overflowing-add.rs +++ b/tests/ui/numbers-arithmetic/overflowing-add.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:attempt to add with overflow +//@ check-run-results:thread 'main' panicked +//@ check-run-results:attempt to add with overflow //@ compile-flags: -C debug-assertions //@ ignore-emscripten no processes diff --git a/tests/ui/numbers-arithmetic/overflowing-add.run.stderr b/tests/ui/numbers-arithmetic/overflowing-add.run.stderr new file mode 100644 index 000000000000..c87525aaacff --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-add.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/overflowing-add.rs:10:14: +attempt to add with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.rs b/tests/ui/numbers-arithmetic/overflowing-mul.rs index 59575d2e86e0..5e80de33ff8a 100644 --- a/tests/ui/numbers-arithmetic/overflowing-mul.rs +++ b/tests/ui/numbers-arithmetic/overflowing-mul.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:attempt to multiply with overflow +//@ check-run-results:thread 'main' panicked +//@ check-run-results:attempt to multiply with overflow //@ ignore-emscripten no processes //@ compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.run.stderr b/tests/ui/numbers-arithmetic/overflowing-mul.run.stderr new file mode 100644 index 000000000000..520128341c63 --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-mul.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/overflowing-mul.rs:10:13: +attempt to multiply with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs index 8aa0d04e500c..37e447328781 100644 --- a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs +++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:attempt to negate with overflow +//@ check-run-results:attempt to negate with overflow //@ ignore-emscripten no processes //@ compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.run.stderr b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.run.stderr new file mode 100644 index 000000000000..33fe9fd91c50 --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $SRC_DIR/core/src/ops/arith.rs:LL:COL: +attempt to negate with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs index 69e22c2262a3..5af28ba23c96 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:attempt to multiply with overflow +//@ check-run-results:thread 'main' panicked +//@ check-run-results:attempt to multiply with overflow //@ ignore-emscripten no processes //@ compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.run.stderr b/tests/ui/numbers-arithmetic/overflowing-pow-signed.run.stderr new file mode 100644 index 000000000000..8e8a8c99b707 --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $SRC_DIR/core/src/num/mod.rs:LL:COL: +attempt to multiply with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs index f980033c480e..ef47bd72eaf3 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:attempt to multiply with overflow +//@ check-run-results:thread 'main' panicked +//@ check-run-results:attempt to multiply with overflow //@ ignore-emscripten no processes //@ compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.run.stderr b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.run.stderr new file mode 100644 index 000000000000..8e8a8c99b707 --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $SRC_DIR/core/src/num/mod.rs:LL:COL: +attempt to multiply with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.rs b/tests/ui/numbers-arithmetic/overflowing-sub.rs index 44aadf6b3e70..db142a4a37d0 100644 --- a/tests/ui/numbers-arithmetic/overflowing-sub.rs +++ b/tests/ui/numbers-arithmetic/overflowing-sub.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:attempt to subtract with overflow +//@ check-run-results:thread 'main' panicked +//@ check-run-results:attempt to subtract with overflow //@ ignore-emscripten no processes //@ compile-flags: -C debug-assertions diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.run.stderr b/tests/ui/numbers-arithmetic/overflowing-sub.run.stderr new file mode 100644 index 000000000000..7f48e13f75a8 --- /dev/null +++ b/tests/ui/numbers-arithmetic/overflowing-sub.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/overflowing-sub.rs:10:14: +attempt to subtract with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/numbers-arithmetic/promoted_overflow.rs b/tests/ui/numbers-arithmetic/promoted_overflow.rs index 96c5f3b87e18..06f7c3de54c6 100644 --- a/tests/ui/numbers-arithmetic/promoted_overflow.rs +++ b/tests/ui/numbers-arithmetic/promoted_overflow.rs @@ -1,7 +1,7 @@ #![allow(arithmetic_overflow)] //@ run-fail -//@ error-pattern: overflow +//@ check-run-results: overflow //@ compile-flags: -C overflow-checks=yes // for some reason, fails to match error string on // wasm32-unknown-unknown with stripped debuginfo and symbols, diff --git a/tests/ui/numbers-arithmetic/promoted_overflow.run.stderr b/tests/ui/numbers-arithmetic/promoted_overflow.run.stderr new file mode 100644 index 000000000000..0ee2b214b2c1 --- /dev/null +++ b/tests/ui/numbers-arithmetic/promoted_overflow.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/promoted_overflow.rs:12:28: +attempt to subtract with overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panic-runtime/unwind-interleaved.rs b/tests/ui/panic-runtime/unwind-interleaved.rs index e5505cd893a1..22a4afc94b59 100644 --- a/tests/ui/panic-runtime/unwind-interleaved.rs +++ b/tests/ui/panic-runtime/unwind-interleaved.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn a() {} diff --git a/tests/ui/panic-runtime/unwind-interleaved.run.stderr b/tests/ui/panic-runtime/unwind-interleaved.run.stderr new file mode 100644 index 000000000000..4409324c7089 --- /dev/null +++ b/tests/ui/panic-runtime/unwind-interleaved.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unwind-interleaved.rs:8:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panic-runtime/unwind-rec.rs b/tests/ui/panic-runtime/unwind-rec.rs index d4b53c887681..e305226d26b5 100644 --- a/tests/ui/panic-runtime/unwind-rec.rs +++ b/tests/ui/panic-runtime/unwind-rec.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn build() -> Vec { diff --git a/tests/ui/panic-runtime/unwind-rec.run.stderr b/tests/ui/panic-runtime/unwind-rec.run.stderr new file mode 100644 index 000000000000..432e56323f57 --- /dev/null +++ b/tests/ui/panic-runtime/unwind-rec.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unwind-rec.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panic-runtime/unwind-rec2.rs b/tests/ui/panic-runtime/unwind-rec2.rs index 6ac9a5a58054..747342f95173 100644 --- a/tests/ui/panic-runtime/unwind-rec2.rs +++ b/tests/ui/panic-runtime/unwind-rec2.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn build1() -> Vec { diff --git a/tests/ui/panic-runtime/unwind-rec2.run.stderr b/tests/ui/panic-runtime/unwind-rec2.run.stderr new file mode 100644 index 000000000000..30ff71e50c76 --- /dev/null +++ b/tests/ui/panic-runtime/unwind-rec2.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unwind-rec2.rs:10:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panic-runtime/unwind-unique.rs b/tests/ui/panic-runtime/unwind-unique.rs index a6cd59690ca9..3d92780390e4 100644 --- a/tests/ui/panic-runtime/unwind-unique.rs +++ b/tests/ui/panic-runtime/unwind-unique.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit panic +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn failfn() { diff --git a/tests/ui/panic-runtime/unwind-unique.run.stderr b/tests/ui/panic-runtime/unwind-unique.run.stderr new file mode 100644 index 000000000000..7a3a541cf882 --- /dev/null +++ b/tests/ui/panic-runtime/unwind-unique.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unwind-unique.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/args-panic.rs b/tests/ui/panics/args-panic.rs index 091ced9b4791..8eb69279c2a0 100644 --- a/tests/ui/panics/args-panic.rs +++ b/tests/ui/panics/args-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:meep +//@ check-run-results:meep //@ ignore-emscripten no processes fn f(_a: isize, _b: isize, _c: Box) { diff --git a/tests/ui/panics/args-panic.run.stderr b/tests/ui/panics/args-panic.run.stderr new file mode 100644 index 000000000000..905b1657522b --- /dev/null +++ b/tests/ui/panics/args-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/args-panic.rs:10:10: +meep +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/default-backtrace-ice.stderr b/tests/ui/panics/default-backtrace-ice.stderr index 046b2cca7f9b..2147b0971b5f 100644 --- a/tests/ui/panics/default-backtrace-ice.stderr +++ b/tests/ui/panics/default-backtrace-ice.stderr @@ -5,6 +5,7 @@ LL | fn main() { missing_ident; } | ^^^^^^^^^^^^^ not found in this scope + aborting due to `-Z treat-err-as-bug=1` stack backtrace: (end_short_backtrace) diff --git a/tests/ui/panics/doublepanic.rs b/tests/ui/panics/doublepanic.rs index 51945ea708c2..b37137358f36 100644 --- a/tests/ui/panics/doublepanic.rs +++ b/tests/ui/panics/doublepanic.rs @@ -1,7 +1,7 @@ #![allow(unreachable_code)] //@ run-fail -//@ error-pattern:One +//@ check-run-results:One //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/doublepanic.run.stderr b/tests/ui/panics/doublepanic.run.stderr new file mode 100644 index 000000000000..ce9f1c564618 --- /dev/null +++ b/tests/ui/panics/doublepanic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/doublepanic.rs:8:5: +One +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/explicit-panic-msg.rs b/tests/ui/panics/explicit-panic-msg.rs index ef0c5b39f099..aa9dab759d77 100644 --- a/tests/ui/panics/explicit-panic-msg.rs +++ b/tests/ui/panics/explicit-panic-msg.rs @@ -3,7 +3,7 @@ #![allow(non_fmt_panics)] //@ run-fail -//@ error-pattern:wooooo +//@ check-run-results:wooooo //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/explicit-panic-msg.run.stderr b/tests/ui/panics/explicit-panic-msg.run.stderr new file mode 100644 index 000000000000..8f85273e15a7 --- /dev/null +++ b/tests/ui/panics/explicit-panic-msg.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/explicit-panic-msg.rs:14:5: +wooooo +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/explicit-panic.rs b/tests/ui/panics/explicit-panic.rs index 34e952ef68f9..eac94041053f 100644 --- a/tests/ui/panics/explicit-panic.rs +++ b/tests/ui/panics/explicit-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:explicit +//@ check-run-results:explicit //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/explicit-panic.run.stderr b/tests/ui/panics/explicit-panic.run.stderr new file mode 100644 index 000000000000..8e4918eaeeb6 --- /dev/null +++ b/tests/ui/panics/explicit-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/explicit-panic.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/fmt-only-once.run.stderr b/tests/ui/panics/fmt-only-once.run.stderr index a991706d34e1..faa3cc91151d 100644 --- a/tests/ui/panics/fmt-only-once.run.stderr +++ b/tests/ui/panics/fmt-only-once.run.stderr @@ -1,4 +1,5 @@ fmt + thread 'main' panicked at $DIR/fmt-only-once.rs:20:5: PrintOnFmt note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/fmt-panic.rs b/tests/ui/panics/fmt-panic.rs index 032f65cb2e4b..c324a0d81d17 100644 --- a/tests/ui/panics/fmt-panic.rs +++ b/tests/ui/panics/fmt-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:meh +//@ check-run-results:meh //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/fmt-panic.run.stderr b/tests/ui/panics/fmt-panic.run.stderr new file mode 100644 index 000000000000..74b05cd33297 --- /dev/null +++ b/tests/ui/panics/fmt-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/fmt-panic.rs:7:5: +meh +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/issue-47429-short-backtraces.run.stderr b/tests/ui/panics/issue-47429-short-backtraces.run.stderr index 6a22e0215fee..c6e2d13fb5da 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.run.stderr +++ b/tests/ui/panics/issue-47429-short-backtraces.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:26:5: explicit panic stack backtrace: diff --git a/tests/ui/panics/location-detail-panic-no-column.run.stderr b/tests/ui/panics/location-detail-panic-no-column.run.stderr index 6d8d02a3a55f..f63c09652b8f 100644 --- a/tests/ui/panics/location-detail-panic-no-column.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-column.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-column.rs:7:0: column-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-file.run.stderr b/tests/ui/panics/location-detail-panic-no-file.run.stderr index 492ad37f5c7c..3d1c6defa316 100644 --- a/tests/ui/panics/location-detail-panic-no-file.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-file.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at :7:5: file-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-line.run.stderr b/tests/ui/panics/location-detail-panic-no-line.run.stderr index fdbc43c4311d..9809ab5e2b4d 100644 --- a/tests/ui/panics/location-detail-panic-no-line.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-line.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/location-detail-panic-no-line.rs:0:5: line-redacted note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr index 1e9002df9558..f68a0d663c0f 100644 --- a/tests/ui/panics/location-detail-panic-no-location-info.run.stderr +++ b/tests/ui/panics/location-detail-panic-no-location-info.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at :0:0: no location info note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr index 52019f622332..af4a4997faea 100644 --- a/tests/ui/panics/location-detail-unwrap-no-file.run.stderr +++ b/tests/ui/panics/location-detail-unwrap-no-file.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at :8:9: called `Option::unwrap()` on a `None` value note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/main-panic.rs b/tests/ui/panics/main-panic.rs index b69f1656ca49..55eb1d5cb5bd 100644 --- a/tests/ui/panics/main-panic.rs +++ b/tests/ui/panics/main-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked at +//@ check-run-results:thread 'main' panicked at //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/main-panic.run.stderr b/tests/ui/panics/main-panic.run.stderr new file mode 100644 index 000000000000..4ae51faf33f1 --- /dev/null +++ b/tests/ui/panics/main-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/main-panic.rs:6:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-arg.rs b/tests/ui/panics/panic-arg.rs index 10be6d5ff6ce..602af92fd424 100644 --- a/tests/ui/panics/panic-arg.rs +++ b/tests/ui/panics/panic-arg.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:woe +//@ check-run-results:woe //@ ignore-emscripten no processes fn f(a: isize) { diff --git a/tests/ui/panics/panic-arg.run.stderr b/tests/ui/panics/panic-arg.run.stderr new file mode 100644 index 000000000000..250c500df354 --- /dev/null +++ b/tests/ui/panics/panic-arg.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-arg.rs:10:7: +woe +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-in-cleanup.rs b/tests/ui/panics/panic-in-cleanup.rs index 8cddeb37348d..9d25564499a6 100644 --- a/tests/ui/panics/panic-in-cleanup.rs +++ b/tests/ui/panics/panic-in-cleanup.rs @@ -1,7 +1,7 @@ //@ run-fail //@ exec-env:RUST_BACKTRACE=0 //@ check-run-results -//@ error-pattern: panic in a destructor during cleanup +//@ check-run-results: panic in a destructor during cleanup //@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> "" //@ normalize-stderr: "\n +at [^\n]+" -> "" //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" diff --git a/tests/ui/panics/panic-in-cleanup.run.stderr b/tests/ui/panics/panic-in-cleanup.run.stderr index e7def11b0e94..34383562c367 100644 --- a/tests/ui/panics/panic-in-cleanup.run.stderr +++ b/tests/ui/panics/panic-in-cleanup.run.stderr @@ -1,9 +1,12 @@ + thread 'main' panicked at $DIR/panic-in-cleanup.rs:22:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9: BOOM stack backtrace: + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. diff --git a/tests/ui/panics/panic-in-ffi.rs b/tests/ui/panics/panic-in-ffi.rs index 6068e4fdc59b..8ad5b106353b 100644 --- a/tests/ui/panics/panic-in-ffi.rs +++ b/tests/ui/panics/panic-in-ffi.rs @@ -1,8 +1,8 @@ //@ run-fail //@ exec-env:RUST_BACKTRACE=0 //@ check-run-results -//@ error-pattern: panic in a function that cannot unwind -//@ error-pattern: Noisy Drop +//@ check-run-results: panic in a function that cannot unwind +//@ check-run-results: Noisy Drop //@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> "" //@ normalize-stderr: "\n +at [^\n]+" -> "" //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr index fe8c2b04b91a..a6f3ebe5657a 100644 --- a/tests/ui/panics/panic-in-ffi.run.stderr +++ b/tests/ui/panics/panic-in-ffi.run.stderr @@ -1,7 +1,9 @@ + thread 'main' panicked at $DIR/panic-in-ffi.rs:21:5: Test note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Noisy Drop + thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL: panic in a function that cannot unwind stack backtrace: diff --git a/tests/ui/panics/panic-in-message-fmt.rs b/tests/ui/panics/panic-in-message-fmt.rs index 1e9bbaf45c54..502924f8c86c 100644 --- a/tests/ui/panics/panic-in-message-fmt.rs +++ b/tests/ui/panics/panic-in-message-fmt.rs @@ -3,7 +3,7 @@ //@ run-fail //@ exec-env:RUST_BACKTRACE=0 //@ check-run-results -//@ error-pattern: panicked while processing panic +//@ check-run-results panicked while processing panic //@ normalize-stderr: "\n +[0-9]+:[^\n]+" -> "" //@ normalize-stderr: "\n +at [^\n]+" -> "" //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL" diff --git a/tests/ui/panics/panic-macro-any-wrapped.rs b/tests/ui/panics/panic-macro-any-wrapped.rs index 7c6790e35fd1..2c3d5be28b13 100644 --- a/tests/ui/panics/panic-macro-any-wrapped.rs +++ b/tests/ui/panics/panic-macro-any-wrapped.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:Box +//@ check-run-results:panicked +//@ check-run-results:Box //@ ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-any-wrapped.run.stderr b/tests/ui/panics/panic-macro-any-wrapped.run.stderr new file mode 100644 index 000000000000..26b1216d67d2 --- /dev/null +++ b/tests/ui/panics/panic-macro-any-wrapped.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-any-wrapped.rs:9:5: +Box +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-macro-any.rs b/tests/ui/panics/panic-macro-any.rs index 75397333fa4a..b7c829bd89de 100644 --- a/tests/ui/panics/panic-macro-any.rs +++ b/tests/ui/panics/panic-macro-any.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:Box +//@ check-run-results:panicked +//@ check-run-results:Box //@ ignore-emscripten no processes #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-any.run.stderr b/tests/ui/panics/panic-macro-any.run.stderr new file mode 100644 index 000000000000..3a036ddae025 --- /dev/null +++ b/tests/ui/panics/panic-macro-any.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-any.rs:9:5: +Box +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-macro-explicit.rs b/tests/ui/panics/panic-macro-explicit.rs index 2c7b84d99fea..d89a7babfadc 100644 --- a/tests/ui/panics/panic-macro-explicit.rs +++ b/tests/ui/panics/panic-macro-explicit.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:explicit panic +//@ check-run-results:panicked +//@ check-run-results:explicit panic //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-explicit.run.stderr b/tests/ui/panics/panic-macro-explicit.run.stderr new file mode 100644 index 000000000000..ca60392cf610 --- /dev/null +++ b/tests/ui/panics/panic-macro-explicit.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-explicit.rs:7:5: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-macro-fmt.rs b/tests/ui/panics/panic-macro-fmt.rs index 1a63a06c75ad..e9280e16b4bf 100644 --- a/tests/ui/panics/panic-macro-fmt.rs +++ b/tests/ui/panics/panic-macro-fmt.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:test-fail-fmt 42 rust +//@ check-run-results:panicked +//@ check-run-results:test-fail-fmt 42 rust //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-fmt.run.stderr b/tests/ui/panics/panic-macro-fmt.run.stderr new file mode 100644 index 000000000000..8d1ea8a82da0 --- /dev/null +++ b/tests/ui/panics/panic-macro-fmt.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-fmt.rs:7:5: +test-fail-fmt 42 rust +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-macro-owned.rs b/tests/ui/panics/panic-macro-owned.rs index 1878f3d52abd..b63c1eb5d6e5 100644 --- a/tests/ui/panics/panic-macro-owned.rs +++ b/tests/ui/panics/panic-macro-owned.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:test-fail-owned +//@ check-run-results:panicked +//@ check-run-results:test-fail-owned //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-owned.run.stderr b/tests/ui/panics/panic-macro-owned.run.stderr new file mode 100644 index 000000000000..25d816ca08ff --- /dev/null +++ b/tests/ui/panics/panic-macro-owned.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-owned.rs:7:5: +test-fail-owned +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-macro-static.rs b/tests/ui/panics/panic-macro-static.rs index 018166e60cfa..791d8a27070d 100644 --- a/tests/ui/panics/panic-macro-static.rs +++ b/tests/ui/panics/panic-macro-static.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:panicked -//@ error-pattern:test-fail-static +//@ check-run-results:panicked +//@ check-run-results:test-fail-static //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-macro-static.run.stderr b/tests/ui/panics/panic-macro-static.run.stderr new file mode 100644 index 000000000000..0f11b47c8a95 --- /dev/null +++ b/tests/ui/panics/panic-macro-static.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-macro-static.rs:7:5: +test-fail-static +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-main.rs b/tests/ui/panics/panic-main.rs index d71fca0754e9..274c82be340d 100644 --- a/tests/ui/panics/panic-main.rs +++ b/tests/ui/panics/panic-main.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:moop +//@ check-run-results:moop //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic-main.run.stderr b/tests/ui/panics/panic-main.run.stderr new file mode 100644 index 000000000000..4139a2971af4 --- /dev/null +++ b/tests/ui/panics/panic-main.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-main.rs:6:5: +moop +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-parens.rs b/tests/ui/panics/panic-parens.rs index 271d0363cab8..8b4d12482825 100644 --- a/tests/ui/panics/panic-parens.rs +++ b/tests/ui/panics/panic-parens.rs @@ -2,7 +2,7 @@ // certain positions //@ run-fail -//@ error-pattern:oops +//@ check-run-results:oops //@ ignore-emscripten no processes fn bigpanic() { diff --git a/tests/ui/panics/panic-parens.run.stderr b/tests/ui/panics/panic-parens.run.stderr new file mode 100644 index 000000000000..1043e7f7ff70 --- /dev/null +++ b/tests/ui/panics/panic-parens.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-parens.rs:9:12: +oops +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-set-handler.rs b/tests/ui/panics/panic-set-handler.rs index 39286ca865ba..825583c06800 100644 --- a/tests/ui/panics/panic-set-handler.rs +++ b/tests/ui/panics/panic-set-handler.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:greetings from the panic handler +//@ check-run-results:greetings from the panic handler //@ ignore-emscripten no processes use std::panic; diff --git a/tests/ui/panics/panic-set-handler.run.stderr b/tests/ui/panics/panic-set-handler.run.stderr new file mode 100644 index 000000000000..f9e95ee965e4 --- /dev/null +++ b/tests/ui/panics/panic-set-handler.run.stderr @@ -0,0 +1 @@ +greetings from the panic handler diff --git a/tests/ui/panics/panic-set-unset-handler.rs b/tests/ui/panics/panic-set-unset-handler.rs index 02f1599338b6..97cc1c08fc15 100644 --- a/tests/ui/panics/panic-set-unset-handler.rs +++ b/tests/ui/panics/panic-set-unset-handler.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:foobar +//@ check-run-results:thread 'main' panicked +//@ check-run-results:foobar //@ ignore-emscripten no processes use std::panic; diff --git a/tests/ui/panics/panic-set-unset-handler.run.stderr b/tests/ui/panics/panic-set-unset-handler.run.stderr new file mode 100644 index 000000000000..46ff1ba7de89 --- /dev/null +++ b/tests/ui/panics/panic-set-unset-handler.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-set-unset-handler.rs:13:5: +foobar +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-take-handler-nop.rs b/tests/ui/panics/panic-take-handler-nop.rs index 89e1d234df13..935097a3b8ea 100644 --- a/tests/ui/panics/panic-take-handler-nop.rs +++ b/tests/ui/panics/panic-take-handler-nop.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'main' panicked -//@ error-pattern:foobar +//@ check-run-results:thread 'main' panicked +//@ check-run-results:foobar //@ ignore-emscripten no processes use std::panic; diff --git a/tests/ui/panics/panic-take-handler-nop.run.stderr b/tests/ui/panics/panic-take-handler-nop.run.stderr new file mode 100644 index 000000000000..8003f35c21bb --- /dev/null +++ b/tests/ui/panics/panic-take-handler-nop.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic-take-handler-nop.rs:10:5: +foobar +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/panic-task-name-none.rs b/tests/ui/panics/panic-task-name-none.rs index 8695771ff5ea..d590485507f0 100644 --- a/tests/ui/panics/panic-task-name-none.rs +++ b/tests/ui/panics/panic-task-name-none.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread '' panicked -//@ error-pattern:test +//@ check-run-results:thread '' panicked +//@ check-run-results:test //@ needs-threads use std::thread; diff --git a/tests/ui/panics/panic-task-name-none.run.stderr b/tests/ui/panics/panic-task-name-none.run.stderr new file mode 100644 index 000000000000..d024c90f4825 --- /dev/null +++ b/tests/ui/panics/panic-task-name-none.run.stderr @@ -0,0 +1,5 @@ +thread '' panicked at $DIR/panic-task-name-none.rs:10:32: +test +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread 'main' panicked at $DIR/panic-task-name-none.rs:13:5: +assertion failed: r.is_ok() diff --git a/tests/ui/panics/panic-task-name-owned.rs b/tests/ui/panics/panic-task-name-owned.rs index 42ae33b5d351..d4395606a88c 100644 --- a/tests/ui/panics/panic-task-name-owned.rs +++ b/tests/ui/panics/panic-task-name-owned.rs @@ -1,6 +1,6 @@ //@ run-fail -//@ error-pattern:thread 'owned name' panicked -//@ error-pattern:test +//@ check-run-results:thread 'owned name' panicked +//@ check-run-results:test //@ needs-threads use std::thread::Builder; diff --git a/tests/ui/panics/panic-task-name-owned.run.stderr b/tests/ui/panics/panic-task-name-owned.run.stderr new file mode 100644 index 000000000000..29bb3cd498a3 --- /dev/null +++ b/tests/ui/panics/panic-task-name-owned.run.stderr @@ -0,0 +1,5 @@ +thread 'owned name' panicked at $DIR/panic-task-name-owned.rs:12:25: +test +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread 'main' panicked at $DIR/panic-task-name-owned.rs:17:22: +called `Result::unwrap()` on an `Err` value: Any { .. } diff --git a/tests/ui/panics/panic.rs b/tests/ui/panics/panic.rs index b9721ac8230f..54cfc6bee424 100644 --- a/tests/ui/panics/panic.rs +++ b/tests/ui/panics/panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:1 == 2 +//@ check-run-results:1 == 2 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/panic.run.stderr b/tests/ui/panics/panic.run.stderr new file mode 100644 index 000000000000..d4993dd6527d --- /dev/null +++ b/tests/ui/panics/panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/panic.rs:6:5: +assertion failed: 1 == 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/result-get-panic.rs b/tests/ui/panics/result-get-panic.rs index d7f6dfe8406d..af4810c39449 100644 --- a/tests/ui/panics/result-get-panic.rs +++ b/tests/ui/panics/result-get-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:called `Result::unwrap()` on an `Err` value +//@ check-run-results:called `Result::unwrap()` on an `Err` value //@ ignore-emscripten no processes use std::result::Result::Err; diff --git a/tests/ui/panics/result-get-panic.run.stderr b/tests/ui/panics/result-get-panic.run.stderr new file mode 100644 index 000000000000..7a46648e54cd --- /dev/null +++ b/tests/ui/panics/result-get-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/result-get-panic.rs:8:62: +called `Result::unwrap()` on an `Err` value: "kitty" +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/runtime-switch.run.stderr b/tests/ui/panics/runtime-switch.run.stderr index 35be010d6be7..458a0ee534a9 100644 --- a/tests/ui/panics/runtime-switch.run.stderr +++ b/tests/ui/panics/runtime-switch.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/runtime-switch.rs:29:5: explicit panic stack backtrace: diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr index ab23ce780625..1fddcca69510 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:63:5: debug!!! stack backtrace: diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr index d2616911e3bf..630b09d8d1ec 100644 --- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr +++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:59:5: debug!!! stack backtrace: diff --git a/tests/ui/panics/unique-panic.rs b/tests/ui/panics/unique-panic.rs index 63ff38b6d128..131fa40cb044 100644 --- a/tests/ui/panics/unique-panic.rs +++ b/tests/ui/panics/unique-panic.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern: panic +//@ check-run-results: panic // for some reason, fails to match error string on // wasm32-unknown-unknown with stripped debuginfo and symbols, // so don't strip it diff --git a/tests/ui/panics/unique-panic.run.stderr b/tests/ui/panics/unique-panic.run.stderr new file mode 100644 index 000000000000..e528d7e115f3 --- /dev/null +++ b/tests/ui/panics/unique-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/unique-panic.rs:9:14: +explicit panic +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/while-body-panics.rs b/tests/ui/panics/while-body-panics.rs index bddcd5d50ce4..571e4cdae552 100644 --- a/tests/ui/panics/while-body-panics.rs +++ b/tests/ui/panics/while-body-panics.rs @@ -1,7 +1,7 @@ #![allow(while_true)] //@ run-fail -//@ error-pattern:quux +//@ check-run-results:quux //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/while-body-panics.run.stderr b/tests/ui/panics/while-body-panics.run.stderr new file mode 100644 index 000000000000..529f0737296b --- /dev/null +++ b/tests/ui/panics/while-body-panics.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/while-body-panics.rs:10:13: +quux +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/panics/while-panic.rs b/tests/ui/panics/while-panic.rs index 2961e8599c35..cc1189d8ab83 100644 --- a/tests/ui/panics/while-panic.rs +++ b/tests/ui/panics/while-panic.rs @@ -1,7 +1,7 @@ #![allow(while_true)] //@ run-fail -//@ error-pattern:giraffe +//@ check-run-results:giraffe //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/panics/while-panic.run.stderr b/tests/ui/panics/while-panic.run.stderr new file mode 100644 index 000000000000..d8462f2856e3 --- /dev/null +++ b/tests/ui/panics/while-panic.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/while-panic.rs:10:13: +giraffe +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/precondition-checks/alignment.rs b/tests/ui/precondition-checks/alignment.rs index 92400528fa07..a5ea4e06a09c 100644 --- a/tests/ui/precondition-checks/alignment.rs +++ b/tests/ui/precondition-checks/alignment.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: Alignment::new_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: Alignment::new_unchecked requires #![feature(ptr_alignment_type)] diff --git a/tests/ui/precondition-checks/alignment.run.stderr b/tests/ui/precondition-checks/alignment.run.stderr new file mode 100644 index 000000000000..367f1c7ef156 --- /dev/null +++ b/tests/ui/precondition-checks/alignment.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: Alignment::new_unchecked requires a power of two +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/ascii-char-digit_unchecked.rs b/tests/ui/precondition-checks/ascii-char-digit_unchecked.rs index 30c6f79fb08f..f518a691e2f3 100644 --- a/tests/ui/precondition-checks/ascii-char-digit_unchecked.rs +++ b/tests/ui/precondition-checks/ascii-char-digit_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: `ascii::Char::digit_unchecked` input cannot exceed 9 +//@ check-run-results: unsafe precondition(s) violated: `ascii::Char::digit_unchecked` #![feature(ascii_char)] diff --git a/tests/ui/precondition-checks/ascii-char-digit_unchecked.run.stderr b/tests/ui/precondition-checks/ascii-char-digit_unchecked.run.stderr new file mode 100644 index 000000000000..c06f81958b5f --- /dev/null +++ b/tests/ui/precondition-checks/ascii-char-digit_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: `ascii::Char::digit_unchecked` input cannot exceed 9. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/assert_unchecked.rs b/tests/ui/precondition-checks/assert_unchecked.rs index 22b2b4145502..0c27f486024f 100644 --- a/tests/ui/precondition-checks/assert_unchecked.rs +++ b/tests/ui/precondition-checks/assert_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: hint::assert_unchecked must never be called when the condition is false +//@ check-run-results: unsafe precondition(s) violated: hint::assert_unchecked must never fn main() { unsafe { diff --git a/tests/ui/precondition-checks/assert_unchecked.run.stderr b/tests/ui/precondition-checks/assert_unchecked.run.stderr new file mode 100644 index 000000000000..e93a37813fa2 --- /dev/null +++ b/tests/ui/precondition-checks/assert_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: hint::assert_unchecked must never be called when the condition is false +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/char-from_u32_unchecked.rs b/tests/ui/precondition-checks/char-from_u32_unchecked.rs index d950f20c7720..a1652299ffa1 100644 --- a/tests/ui/precondition-checks/char-from_u32_unchecked.rs +++ b/tests/ui/precondition-checks/char-from_u32_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: invalid value for `char` +//@ check-run-results: unsafe precondition(s) violated: invalid value for `char` fn main() { unsafe { diff --git a/tests/ui/precondition-checks/char-from_u32_unchecked.run.stderr b/tests/ui/precondition-checks/char-from_u32_unchecked.run.stderr new file mode 100644 index 000000000000..10bb0f961bee --- /dev/null +++ b/tests/ui/precondition-checks/char-from_u32_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: invalid value for `char` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_dst.run.stderr b/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_dst.run.stderr new file mode 100644 index 000000000000..e1ff4665e71e --- /dev/null +++ b/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_src.run.stderr b/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_src.run.stderr new file mode 100644 index 000000000000..e1ff4665e71e --- /dev/null +++ b/tests/ui/precondition-checks/copy-nonoverlapping.misaligned_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.null_dst.run.stderr b/tests/ui/precondition-checks/copy-nonoverlapping.null_dst.run.stderr new file mode 100644 index 000000000000..e1ff4665e71e --- /dev/null +++ b/tests/ui/precondition-checks/copy-nonoverlapping.null_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.null_src.run.stderr b/tests/ui/precondition-checks/copy-nonoverlapping.null_src.run.stderr new file mode 100644 index 000000000000..e1ff4665e71e --- /dev/null +++ b/tests/ui/precondition-checks/copy-nonoverlapping.null_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.overlapping.run.stderr b/tests/ui/precondition-checks/copy-nonoverlapping.overlapping.run.stderr new file mode 100644 index 000000000000..e1ff4665e71e --- /dev/null +++ b/tests/ui/precondition-checks/copy-nonoverlapping.overlapping.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy-nonoverlapping.rs b/tests/ui/precondition-checks/copy-nonoverlapping.rs index 81018e4bff3e..057710aa4b61 100644 --- a/tests/ui/precondition-checks/copy-nonoverlapping.rs +++ b/tests/ui/precondition-checks/copy-nonoverlapping.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::copy_nonoverlapping requires +//@ check-run-results: unsafe precondition(s) violated: ptr::copy_nonoverlapping requires //@ revisions: null_src null_dst misaligned_src misaligned_dst overlapping use std::ptr; diff --git a/tests/ui/precondition-checks/copy.misaligned_dst.run.stderr b/tests/ui/precondition-checks/copy.misaligned_dst.run.stderr new file mode 100644 index 000000000000..ac9e5fa9b545 --- /dev/null +++ b/tests/ui/precondition-checks/copy.misaligned_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy requires that both pointer arguments are aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy.misaligned_src.run.stderr b/tests/ui/precondition-checks/copy.misaligned_src.run.stderr new file mode 100644 index 000000000000..ac9e5fa9b545 --- /dev/null +++ b/tests/ui/precondition-checks/copy.misaligned_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy requires that both pointer arguments are aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy.null_dst.run.stderr b/tests/ui/precondition-checks/copy.null_dst.run.stderr new file mode 100644 index 000000000000..ac9e5fa9b545 --- /dev/null +++ b/tests/ui/precondition-checks/copy.null_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy requires that both pointer arguments are aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy.null_src.run.stderr b/tests/ui/precondition-checks/copy.null_src.run.stderr new file mode 100644 index 000000000000..ac9e5fa9b545 --- /dev/null +++ b/tests/ui/precondition-checks/copy.null_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::copy requires that both pointer arguments are aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/copy.rs b/tests/ui/precondition-checks/copy.rs index 694853f950ab..10ed5acbecbe 100644 --- a/tests/ui/precondition-checks/copy.rs +++ b/tests/ui/precondition-checks/copy.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::copy requires +//@ check-run-results: unsafe precondition(s) violated: ptr::copy requires //@ revisions: null_src null_dst misaligned_src misaligned_dst use std::ptr; diff --git a/tests/ui/precondition-checks/layout.badalign.run.stderr b/tests/ui/precondition-checks/layout.badalign.run.stderr new file mode 100644 index 000000000000..c1831f06d048 --- /dev/null +++ b/tests/ui/precondition-checks/layout.badalign.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/layout.rs b/tests/ui/precondition-checks/layout.rs index 4ee66cc93288..32b498c986f0 100644 --- a/tests/ui/precondition-checks/layout.rs +++ b/tests/ui/precondition-checks/layout.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: Layout::from_size_align_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: Layout::from_size_align_unchecked requires //@ revisions: toolarge badalign fn main() { diff --git a/tests/ui/precondition-checks/layout.toolarge.run.stderr b/tests/ui/precondition-checks/layout.toolarge.run.stderr new file mode 100644 index 000000000000..c1831f06d048 --- /dev/null +++ b/tests/ui/precondition-checks/layout.toolarge.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/nonnull.rs b/tests/ui/precondition-checks/nonnull.rs index 6b8edd4e5825..4bc9508cd698 100644 --- a/tests/ui/precondition-checks/nonnull.rs +++ b/tests/ui/precondition-checks/nonnull.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: NonNull::new_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: NonNull::new_unchecked requires fn main() { unsafe { diff --git a/tests/ui/precondition-checks/nonnull.run.stderr b/tests/ui/precondition-checks/nonnull.run.stderr new file mode 100644 index 000000000000..d2e97ab96387 --- /dev/null +++ b/tests/ui/precondition-checks/nonnull.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: NonNull::new_unchecked requires that the pointer is non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/nonzero-from_mut_unchecked.rs b/tests/ui/precondition-checks/nonzero-from_mut_unchecked.rs index 46ce7dc356fe..6552da9c73e0 100644 --- a/tests/ui/precondition-checks/nonzero-from_mut_unchecked.rs +++ b/tests/ui/precondition-checks/nonzero-from_mut_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: NonZero::from_mut_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: NonZero::from_mut_unchecked requires #![feature(nonzero_from_mut)] diff --git a/tests/ui/precondition-checks/nonzero-from_mut_unchecked.run.stderr b/tests/ui/precondition-checks/nonzero-from_mut_unchecked.run.stderr new file mode 100644 index 000000000000..fb294a6c9da1 --- /dev/null +++ b/tests/ui/precondition-checks/nonzero-from_mut_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: NonZero::from_mut_unchecked requires the argument to dereference as non-zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/nonzero-new_unchecked.rs b/tests/ui/precondition-checks/nonzero-new_unchecked.rs index 7827a42844fd..4b0eb7e01008 100644 --- a/tests/ui/precondition-checks/nonzero-new_unchecked.rs +++ b/tests/ui/precondition-checks/nonzero-new_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: NonZero::new_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: NonZero::new_unchecked requires fn main() { unsafe { diff --git a/tests/ui/precondition-checks/nonzero-new_unchecked.run.stderr b/tests/ui/precondition-checks/nonzero-new_unchecked.run.stderr new file mode 100644 index 000000000000..4c19cc82237e --- /dev/null +++ b/tests/ui/precondition-checks/nonzero-new_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: NonZero::new_unchecked requires the argument to be non-zero +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/read.rs b/tests/ui/precondition-checks/read.rs index ab9921a0ceeb..bf8063a68096 100644 --- a/tests/ui/precondition-checks/read.rs +++ b/tests/ui/precondition-checks/read.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::read requires +//@ check-run-results: unsafe precondition(s) violated: ptr::read requires //@ revisions: null misaligned //@ ignore-test diff --git a/tests/ui/precondition-checks/read_volatile.misaligned.run.stderr b/tests/ui/precondition-checks/read_volatile.misaligned.run.stderr new file mode 100644 index 000000000000..07e316b1a81a --- /dev/null +++ b/tests/ui/precondition-checks/read_volatile.misaligned.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::read_volatile requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/read_volatile.null.run.stderr b/tests/ui/precondition-checks/read_volatile.null.run.stderr new file mode 100644 index 000000000000..07e316b1a81a --- /dev/null +++ b/tests/ui/precondition-checks/read_volatile.null.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::read_volatile requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/read_volatile.rs b/tests/ui/precondition-checks/read_volatile.rs index e14881d02903..15bd31d059e7 100644 --- a/tests/ui/precondition-checks/read_volatile.rs +++ b/tests/ui/precondition-checks/read_volatile.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::read_volatile requires +//@ check-run-results: unsafe precondition(s) violated: ptr::read_volatile requires //@ revisions: null misaligned use std::ptr; diff --git a/tests/ui/precondition-checks/replace.misaligned.run.stderr b/tests/ui/precondition-checks/replace.misaligned.run.stderr new file mode 100644 index 000000000000..e9f35666f6de --- /dev/null +++ b/tests/ui/precondition-checks/replace.misaligned.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::replace requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/replace.null.run.stderr b/tests/ui/precondition-checks/replace.null.run.stderr new file mode 100644 index 000000000000..e9f35666f6de --- /dev/null +++ b/tests/ui/precondition-checks/replace.null.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::replace requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/replace.rs b/tests/ui/precondition-checks/replace.rs index 2808cee7b64b..64a5a36fe609 100644 --- a/tests/ui/precondition-checks/replace.rs +++ b/tests/ui/precondition-checks/replace.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::replace requires +//@ check-run-results: unsafe precondition(s) violated: ptr::replace requires //@ revisions: null misaligned use std::ptr; diff --git a/tests/ui/precondition-checks/slice-from-raw-parts-mut.misaligned.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts-mut.misaligned.run.stderr new file mode 100644 index 000000000000..01dfe395a190 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts-mut.misaligned.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts_mut requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-from-raw-parts-mut.null.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts-mut.null.run.stderr new file mode 100644 index 000000000000..01dfe395a190 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts-mut.null.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts_mut requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-from-raw-parts-mut.rs b/tests/ui/precondition-checks/slice-from-raw-parts-mut.rs index 3801639e2551..f3063b8e3de9 100644 --- a/tests/ui/precondition-checks/slice-from-raw-parts-mut.rs +++ b/tests/ui/precondition-checks/slice-from-raw-parts-mut.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: slice::from_raw_parts_mut requires +//@ check-run-results: unsafe precondition(s) violated: slice::from_raw_parts_mut requires //@ revisions: null misaligned toolarge fn main() { diff --git a/tests/ui/precondition-checks/slice-from-raw-parts-mut.toolarge.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts-mut.toolarge.run.stderr new file mode 100644 index 000000000000..01dfe395a190 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts-mut.toolarge.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts_mut requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-from-raw-parts.misaligned.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts.misaligned.run.stderr new file mode 100644 index 000000000000..f049bb2481e6 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts.misaligned.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-from-raw-parts.null.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts.null.run.stderr new file mode 100644 index 000000000000..f049bb2481e6 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts.null.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-from-raw-parts.rs b/tests/ui/precondition-checks/slice-from-raw-parts.rs index a3690fa045eb..da20be554b86 100644 --- a/tests/ui/precondition-checks/slice-from-raw-parts.rs +++ b/tests/ui/precondition-checks/slice-from-raw-parts.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: slice::from_raw_parts requires +//@ check-run-results: unsafe precondition(s) violated: slice::from_raw_parts requires //@ revisions: null misaligned toolarge fn main() { diff --git a/tests/ui/precondition-checks/slice-from-raw-parts.toolarge.run.stderr b/tests/ui/precondition-checks/slice-from-raw-parts.toolarge.run.stderr new file mode 100644 index 000000000000..f049bb2481e6 --- /dev/null +++ b/tests/ui/precondition-checks/slice-from-raw-parts.toolarge.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX` +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked.backwards_range.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked.backwards_range.run.stderr new file mode 100644 index 000000000000..599a843b3f23 --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked.backwards_range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked.range.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked.range.run.stderr new file mode 100644 index 000000000000..599a843b3f23 --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked.range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked.range_from.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked.range_from.run.stderr new file mode 100644 index 000000000000..599a843b3f23 --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked.range_from.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked.range_to.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked.range_to.run.stderr new file mode 100644 index 000000000000..599a843b3f23 --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked.range_to.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked.rs b/tests/ui/precondition-checks/slice-get_unchecked.rs index 1d8188fb9531..cebfb02a96ce 100644 --- a/tests/ui/precondition-checks/slice-get_unchecked.rs +++ b/tests/ui/precondition-checks/slice-get_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: slice::get_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: slice::get_unchecked requires //@ revisions: usize range range_to range_from backwards_range fn main() { diff --git a/tests/ui/precondition-checks/slice-get_unchecked.usize.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked.usize.run.stderr new file mode 100644 index 000000000000..3e246ce178fc --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked.usize.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked requires that the index is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.backwards_range.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked_mut.backwards_range.run.stderr new file mode 100644 index 000000000000..64a56457e3df --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.backwards_range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked_mut requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.range.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked_mut.range.run.stderr new file mode 100644 index 000000000000..64a56457e3df --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked_mut requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.range_from.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked_mut.range_from.run.stderr new file mode 100644 index 000000000000..64a56457e3df --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.range_from.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked_mut requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.range_to.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked_mut.range_to.run.stderr new file mode 100644 index 000000000000..64a56457e3df --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.range_to.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked_mut requires that the range is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.rs b/tests/ui/precondition-checks/slice-get_unchecked_mut.rs index 34c1454af438..519a795e62ea 100644 --- a/tests/ui/precondition-checks/slice-get_unchecked_mut.rs +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: slice::get_unchecked_mut requires +//@ check-run-results: unsafe precondition(s) violated: slice::get_unchecked_mut requires //@ revisions: usize range range_to range_from backwards_range fn main() { diff --git a/tests/ui/precondition-checks/slice-get_unchecked_mut.usize.run.stderr b/tests/ui/precondition-checks/slice-get_unchecked_mut.usize.run.stderr new file mode 100644 index 000000000000..8e55b674d2c7 --- /dev/null +++ b/tests/ui/precondition-checks/slice-get_unchecked_mut.usize.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: slice::get_unchecked_mut requires that the index is within the slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/slice-swap_unchecked.oob_a.run.stderr b/tests/ui/precondition-checks/slice-swap_unchecked.oob_a.run.stderr new file mode 100644 index 000000000000..0bad0666c105 --- /dev/null +++ b/tests/ui/precondition-checks/slice-swap_unchecked.oob_a.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/slice-swap_unchecked.rs:10:14: +index out of bounds: the len is 2 but the index is 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/precondition-checks/slice-swap_unchecked.oob_b.run.stderr b/tests/ui/precondition-checks/slice-swap_unchecked.oob_b.run.stderr new file mode 100644 index 000000000000..2692f28a1b1d --- /dev/null +++ b/tests/ui/precondition-checks/slice-swap_unchecked.oob_b.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/slice-swap_unchecked.rs:12:14: +index out of bounds: the len is 2 but the index is 2 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/precondition-checks/slice-swap_unchecked.rs b/tests/ui/precondition-checks/slice-swap_unchecked.rs index 227a49091ec2..f48d7b2fec7b 100644 --- a/tests/ui/precondition-checks/slice-swap_unchecked.rs +++ b/tests/ui/precondition-checks/slice-swap_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: index out of bounds: the len is 2 but the index is 2 +//@ check-run-results: index out of bounds: the len is 2 but the index is 2 //@ revisions: oob_a oob_b fn main() { diff --git a/tests/ui/precondition-checks/str-get_unchecked.backwards_range.run.stderr b/tests/ui/precondition-checks/str-get_unchecked.backwards_range.run.stderr new file mode 100644 index 000000000000..bea6d067cb4a --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked.backwards_range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked.range.run.stderr b/tests/ui/precondition-checks/str-get_unchecked.range.run.stderr new file mode 100644 index 000000000000..bea6d067cb4a --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked.range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked.range_from.run.stderr b/tests/ui/precondition-checks/str-get_unchecked.range_from.run.stderr new file mode 100644 index 000000000000..bea6d067cb4a --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked.range_from.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked.range_to.run.stderr b/tests/ui/precondition-checks/str-get_unchecked.range_to.run.stderr new file mode 100644 index 000000000000..bea6d067cb4a --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked.range_to.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked.rs b/tests/ui/precondition-checks/str-get_unchecked.rs index 14d17f997ec9..e1404bb25e04 100644 --- a/tests/ui/precondition-checks/str-get_unchecked.rs +++ b/tests/ui/precondition-checks/str-get_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: str::get_unchecked requires +//@ check-run-results: unsafe precondition(s) violated: str::get_unchecked requires //@ revisions: range range_to range_from backwards_range fn main() { diff --git a/tests/ui/precondition-checks/str-get_unchecked_mut.backwards_range.run.stderr b/tests/ui/precondition-checks/str-get_unchecked_mut.backwards_range.run.stderr new file mode 100644 index 000000000000..7781d8f1ee22 --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked_mut.backwards_range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked_mut requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked_mut.range.run.stderr b/tests/ui/precondition-checks/str-get_unchecked_mut.range.run.stderr new file mode 100644 index 000000000000..7781d8f1ee22 --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked_mut.range.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked_mut requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked_mut.range_from.run.stderr b/tests/ui/precondition-checks/str-get_unchecked_mut.range_from.run.stderr new file mode 100644 index 000000000000..7781d8f1ee22 --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked_mut.range_from.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked_mut requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked_mut.range_to.run.stderr b/tests/ui/precondition-checks/str-get_unchecked_mut.range_to.run.stderr new file mode 100644 index 000000000000..7781d8f1ee22 --- /dev/null +++ b/tests/ui/precondition-checks/str-get_unchecked_mut.range_to.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: str::get_unchecked_mut requires that the range is within the string slice +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/str-get_unchecked_mut.rs b/tests/ui/precondition-checks/str-get_unchecked_mut.rs index ca1b16900555..fdcdbb1f9a21 100644 --- a/tests/ui/precondition-checks/str-get_unchecked_mut.rs +++ b/tests/ui/precondition-checks/str-get_unchecked_mut.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: str::get_unchecked_mut requires +//@ check-run-results: unsafe precondition(s) violated: str::get_unchecked_mut requires //@ revisions: range range_to range_from backwards_range fn main() { diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_dst.run.stderr b/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_dst.run.stderr new file mode 100644 index 000000000000..17a1c923740e --- /dev/null +++ b/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_src.run.stderr b/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_src.run.stderr new file mode 100644 index 000000000000..17a1c923740e --- /dev/null +++ b/tests/ui/precondition-checks/swap-nonoverlapping.misaligned_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.null_dst.run.stderr b/tests/ui/precondition-checks/swap-nonoverlapping.null_dst.run.stderr new file mode 100644 index 000000000000..17a1c923740e --- /dev/null +++ b/tests/ui/precondition-checks/swap-nonoverlapping.null_dst.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.null_src.run.stderr b/tests/ui/precondition-checks/swap-nonoverlapping.null_src.run.stderr new file mode 100644 index 000000000000..17a1c923740e --- /dev/null +++ b/tests/ui/precondition-checks/swap-nonoverlapping.null_src.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.overlapping.run.stderr b/tests/ui/precondition-checks/swap-nonoverlapping.overlapping.run.stderr new file mode 100644 index 000000000000..17a1c923740e --- /dev/null +++ b/tests/ui/precondition-checks/swap-nonoverlapping.overlapping.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/swap-nonoverlapping.rs b/tests/ui/precondition-checks/swap-nonoverlapping.rs index 52e4a3c870be..02caa9fad70a 100644 --- a/tests/ui/precondition-checks/swap-nonoverlapping.rs +++ b/tests/ui/precondition-checks/swap-nonoverlapping.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::swap_nonoverlapping requires +//@ check-run-results: unsafe precondition(s) violated: ptr::swap_nonoverlapping requires //@ revisions: null_src null_dst misaligned_src misaligned_dst overlapping use std::ptr; diff --git a/tests/ui/precondition-checks/unchecked_add.rs b/tests/ui/precondition-checks/unchecked_add.rs index f44a6ea32ad8..a94aa1f80ef3 100644 --- a/tests/ui/precondition-checks/unchecked_add.rs +++ b/tests/ui/precondition-checks/unchecked_add.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: u8::unchecked_add cannot overflow +//@ check-run-results: unsafe precondition(s) violated: u8::unchecked_add cannot overflow fn main() { unsafe { diff --git a/tests/ui/precondition-checks/unchecked_add.run.stderr b/tests/ui/precondition-checks/unchecked_add.run.stderr new file mode 100644 index 000000000000..3b30bad3b4f1 --- /dev/null +++ b/tests/ui/precondition-checks/unchecked_add.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: u8::unchecked_add cannot overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/unchecked_mul.rs b/tests/ui/precondition-checks/unchecked_mul.rs index 66655dda136e..87861574fcea 100644 --- a/tests/ui/precondition-checks/unchecked_mul.rs +++ b/tests/ui/precondition-checks/unchecked_mul.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: u8::unchecked_add cannot overflow +//@ check-run-results: unsafe precondition(s) violated: u8::unchecked_add cannot overflow fn main() { unsafe { diff --git a/tests/ui/precondition-checks/unchecked_mul.run.stderr b/tests/ui/precondition-checks/unchecked_mul.run.stderr new file mode 100644 index 000000000000..3b30bad3b4f1 --- /dev/null +++ b/tests/ui/precondition-checks/unchecked_mul.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: u8::unchecked_add cannot overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/unchecked_shl.rs b/tests/ui/precondition-checks/unchecked_shl.rs index 1c96db0b1ec7..9292610d678a 100644 --- a/tests/ui/precondition-checks/unchecked_shl.rs +++ b/tests/ui/precondition-checks/unchecked_shl.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: u8::unchecked_shl cannot overflow +//@ check-run-results: unsafe precondition(s) violated: u8::unchecked_shl cannot overflow #![feature(unchecked_shifts)] diff --git a/tests/ui/precondition-checks/unchecked_shl.run.stderr b/tests/ui/precondition-checks/unchecked_shl.run.stderr new file mode 100644 index 000000000000..c133bf2d1c8f --- /dev/null +++ b/tests/ui/precondition-checks/unchecked_shl.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: u8::unchecked_shl cannot overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/unchecked_shr.rs b/tests/ui/precondition-checks/unchecked_shr.rs index 4a6d9ffb1d35..5c3a3aa2df9c 100644 --- a/tests/ui/precondition-checks/unchecked_shr.rs +++ b/tests/ui/precondition-checks/unchecked_shr.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: u8::unchecked_shr cannot overflow +//@ check-run-results: unsafe precondition(s) violated: u8::unchecked_shr cannot overflow #![feature(unchecked_shifts)] diff --git a/tests/ui/precondition-checks/unchecked_shr.run.stderr b/tests/ui/precondition-checks/unchecked_shr.run.stderr new file mode 100644 index 000000000000..513d796809b8 --- /dev/null +++ b/tests/ui/precondition-checks/unchecked_shr.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: u8::unchecked_shr cannot overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/unchecked_sub.rs b/tests/ui/precondition-checks/unchecked_sub.rs index 545dde0e2780..2a621e3cb9ac 100644 --- a/tests/ui/precondition-checks/unchecked_sub.rs +++ b/tests/ui/precondition-checks/unchecked_sub.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: u8::unchecked_sub cannot overflow +//@ check-run-results: unsafe precondition(s) violated: u8::unchecked_sub cannot overflow fn main() { unsafe { diff --git a/tests/ui/precondition-checks/unchecked_sub.run.stderr b/tests/ui/precondition-checks/unchecked_sub.run.stderr new file mode 100644 index 000000000000..1956fe13126c --- /dev/null +++ b/tests/ui/precondition-checks/unchecked_sub.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: u8::unchecked_sub cannot overflow +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/unreachable_unchecked.rs b/tests/ui/precondition-checks/unreachable_unchecked.rs index 2435450c4b5a..6e788cca01f3 100644 --- a/tests/ui/precondition-checks/unreachable_unchecked.rs +++ b/tests/ui/precondition-checks/unreachable_unchecked.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: hint::unreachable_unchecked must never be reached +//@ check-run-results: unsafe precondition(s) violated: hint::unreachable_unchecked must never fn main() { unsafe { diff --git a/tests/ui/precondition-checks/unreachable_unchecked.run.stderr b/tests/ui/precondition-checks/unreachable_unchecked.run.stderr new file mode 100644 index 000000000000..728e9a1b6b5a --- /dev/null +++ b/tests/ui/precondition-checks/unreachable_unchecked.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: hint::unreachable_unchecked must never be reached +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/write.rs b/tests/ui/precondition-checks/write.rs index f76e776fcf35..98ba5f9ca357 100644 --- a/tests/ui/precondition-checks/write.rs +++ b/tests/ui/precondition-checks/write.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::write requires +//@ check-run-results: unsafe precondition(s) violated: ptr::write requires //@ revisions: null misaligned //@ ignore-test diff --git a/tests/ui/precondition-checks/write_bytes.rs b/tests/ui/precondition-checks/write_bytes.rs index 3f64be9d1ee1..d3ab696d48b4 100644 --- a/tests/ui/precondition-checks/write_bytes.rs +++ b/tests/ui/precondition-checks/write_bytes.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::write requires +//@ check-run-results: unsafe precondition(s) violated: ptr::write requires //@ revisions: null misaligned //@ ignore-test diff --git a/tests/ui/precondition-checks/write_volatile.misaligned.run.stderr b/tests/ui/precondition-checks/write_volatile.misaligned.run.stderr new file mode 100644 index 000000000000..56e4f85ee146 --- /dev/null +++ b/tests/ui/precondition-checks/write_volatile.misaligned.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::write_volatile requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/write_volatile.null.run.stderr b/tests/ui/precondition-checks/write_volatile.null.run.stderr new file mode 100644 index 000000000000..56e4f85ee146 --- /dev/null +++ b/tests/ui/precondition-checks/write_volatile.null.run.stderr @@ -0,0 +1,4 @@ +thread 'main' panicked at library/core/src/panicking.rs:218:5: +unsafe precondition(s) violated: ptr::write_volatile requires that the pointer argument is aligned and non-null +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread caused non-unwinding panic. aborting. diff --git a/tests/ui/precondition-checks/write_volatile.rs b/tests/ui/precondition-checks/write_volatile.rs index ac0b89b5ecf2..b2aadf49aa53 100644 --- a/tests/ui/precondition-checks/write_volatile.rs +++ b/tests/ui/precondition-checks/write_volatile.rs @@ -1,6 +1,6 @@ //@ run-fail //@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes -//@ error-pattern: unsafe precondition(s) violated: ptr::write_volatile requires +//@ check-run-results: unsafe precondition(s) violated: ptr::write_volatile requires //@ revisions: null misaligned use std::ptr; diff --git a/tests/ui/proc-macro/load-panic-backtrace.stderr b/tests/ui/proc-macro/load-panic-backtrace.stderr index 0f3db6c831e1..a1049f5a3241 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.stderr +++ b/tests/ui/proc-macro/load-panic-backtrace.stderr @@ -1,3 +1,4 @@ + at $DIR/auxiliary/test-macros.rs:38:5: panic-derive error: proc-macro derive panicked diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index 02b699036541..ad47925a1498 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -6,12 +6,17 @@ fn check_for_no_backtrace(test: std::process::Output) { assert!(!test.status.success()); let err = String::from_utf8_lossy(&test.stderr); - let mut it = err.lines(); + let mut it = err.lines().filter(|l| !l.is_empty()); assert_eq!(it.next().map(|l| l.starts_with("thread '' panicked")), Some(true)); assert_eq!(it.next().is_some(), true); - assert_eq!(it.next(), Some("note: run with `RUST_BACKTRACE=1` \ - environment variable to display a backtrace")); + assert_eq!( + it.next(), + Some( + "note: run with `RUST_BACKTRACE=1` \ + environment variable to display a backtrace" + ) + ); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next().is_some(), true); assert_eq!(it.next(), None); @@ -22,19 +27,22 @@ fn main() { if args.len() > 1 && args[1] == "run_test" { let _ = std::thread::spawn(|| { panic!(); - }).join(); + }) + .join(); panic!(); } else { - let test = std::process::Command::new(&args[0]).arg("run_test") - .env_remove("RUST_BACKTRACE") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env_remove("RUST_BACKTRACE") + .output() + .unwrap(); check_for_no_backtrace(test); - let test = std::process::Command::new(&args[0]).arg("run_test") - .env("RUST_BACKTRACE","0") - .output() - .unwrap(); + let test = std::process::Command::new(&args[0]) + .arg("run_test") + .env("RUST_BACKTRACE", "0") + .output() + .unwrap(); check_for_no_backtrace(test); } } diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr index a334c0ad2047..ab414994b56d 100644 --- a/tests/ui/process/println-with-broken-pipe.run.stderr +++ b/tests/ui/process/println-with-broken-pipe.run.stderr @@ -1,3 +1,4 @@ + thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC: failed printing to stdout: Broken pipe (os error 32) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/process/tls-exit-status.rs b/tests/ui/process/tls-exit-status.rs index cddcf369da0b..5ac65b8f5770 100644 --- a/tests/ui/process/tls-exit-status.rs +++ b/tests/ui/process/tls-exit-status.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:nonzero +//@ check-run-results:nonzero //@ exec-env:RUST_NEWRT=1 //@ ignore-wasm32 no processes diff --git a/tests/ui/process/tls-exit-status.run.stderr b/tests/ui/process/tls-exit-status.run.stderr new file mode 100644 index 000000000000..bdd3065c3bb6 --- /dev/null +++ b/tests/ui/process/tls-exit-status.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/tls-exit-status.rs:10:5: +please have a nonzero exit status +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/reachable/issue-948.rs b/tests/ui/reachable/issue-948.rs index 8e239a1115eb..67429d29ac28 100644 --- a/tests/ui/reachable/issue-948.rs +++ b/tests/ui/reachable/issue-948.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:beep boop +//@ check-run-results:beep boop //@ ignore-emscripten no processes #![allow(unused_variables)] diff --git a/tests/ui/reachable/issue-948.run.stderr b/tests/ui/reachable/issue-948.run.stderr new file mode 100644 index 000000000000..31d94665dd6e --- /dev/null +++ b/tests/ui/reachable/issue-948.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/issue-948.rs:14:32: +beep boop +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr index 98cad18d442c..804fa079bb99 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr @@ -16,7 +16,8 @@ LL | #[repr(C)] LL | struct Dealigned(u8, T); | ^ | - = Box + = +Box query stack during panic: #0 [mir_built] building MIR for `::eq` #1 [check_unsafety] unsafety-checking `::eq` diff --git a/tests/ui/resolve/proc_macro_generated_packed.stderr b/tests/ui/resolve/proc_macro_generated_packed.stderr index 4e716704610b..a5a02c9c393a 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.stderr +++ b/tests/ui/resolve/proc_macro_generated_packed.stderr @@ -7,7 +7,8 @@ LL | #[derive(PartialEq)] LL | struct Dealigned(u8, T); | ^ | - = Box + = +Box query stack during panic: #0 [mir_built] building MIR for `::eq` #1 [check_unsafety] unsafety-checking `::eq` diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs index fb6718e55b28..ad84bcd131a3 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:returned Box from main() +//@ check-run-results:returned Box from main() //@ failure-status: 1 //@ ignore-emscripten no processes diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.run.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.run.stderr new file mode 100644 index 000000000000..f7e7dc62094c --- /dev/null +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.run.stderr @@ -0,0 +1 @@ +Error: Custom { kind: Other, error: "returned Box from main()" } diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs index 91be3afbe225..88cc7a01ad80 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:oh, dear +//@ check-run-results:oh, dear //@ ignore-emscripten no processes fn main() -> ! { diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.run.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.run.stderr new file mode 100644 index 000000000000..feaf2d8df826 --- /dev/null +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/termination-trait-for-never.rs:6:5: +oh, dear +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs index f1d972b3c550..5cafc3e35f11 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:returned Box from main() +//@ check-run-results:returned Box from main() //@ failure-status: 1 //@ ignore-emscripten no processes diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.run.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.run.stderr new file mode 100644 index 000000000000..d6152237f91d --- /dev/null +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.run.stderr @@ -0,0 +1 @@ +Error: Custom { kind: Other, error: "returned Box from main()" } diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs index acf3da2d55f3..730bd359fe3d 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern: An error message for you +//@ check-run-results: An error message for you //@ failure-status: 1 //@ ignore-emscripten no processes diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.run.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.run.stderr new file mode 100644 index 000000000000..a66e6db7506f --- /dev/null +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.run.stderr @@ -0,0 +1 @@ +Error: "An error message for you" diff --git a/tests/ui/sanitizer/address.rs b/tests/ui/sanitizer/address.rs index 7a5e767687cf..d12191061318 100644 --- a/tests/ui/sanitizer/address.rs +++ b/tests/ui/sanitizer/address.rs @@ -5,8 +5,8 @@ //@ compile-flags: -Z sanitizer=address -O -g // //@ run-fail -//@ error-pattern: AddressSanitizer: stack-buffer-overflow -//@ error-pattern: 'xs' (line 14) <== Memory access at offset +//@ check-run-results: AddressSanitizer: stack-buffer-overflow +//@ check-run-results: 'xs' (line 14) <== Memory access at offset use std::hint::black_box; diff --git a/tests/ui/sanitizer/hwaddress.rs b/tests/ui/sanitizer/hwaddress.rs index e5939eb734b6..2aa5d1529e43 100644 --- a/tests/ui/sanitizer/hwaddress.rs +++ b/tests/ui/sanitizer/hwaddress.rs @@ -8,7 +8,7 @@ //@ compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16 // //@ run-fail -//@ error-pattern: HWAddressSanitizer: tag-mismatch +//@ check-run-results: HWAddressSanitizer: tag-mismatch use std::hint::black_box; diff --git a/tests/ui/sanitizer/leak.rs b/tests/ui/sanitizer/leak.rs index 65915ec24b72..50069e5c7ab8 100644 --- a/tests/ui/sanitizer/leak.rs +++ b/tests/ui/sanitizer/leak.rs @@ -4,7 +4,7 @@ //@ compile-flags: -Z sanitizer=leak -O // //@ run-fail -//@ error-pattern: LeakSanitizer: detected memory leaks +//@ check-run-results: LeakSanitizer: detected memory leaks use std::hint::black_box; use std::mem; diff --git a/tests/ui/sanitizer/memory-eager.rs b/tests/ui/sanitizer/memory-eager.rs index 9e7889fa1bc0..bd42738e052a 100644 --- a/tests/ui/sanitizer/memory-eager.rs +++ b/tests/ui/sanitizer/memory-eager.rs @@ -7,9 +7,9 @@ //@ [unoptimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins // //@ run-fail -//@ error-pattern: MemorySanitizer: use-of-uninitialized-value -//@ error-pattern: Uninitialized value was created by an allocation -//@ error-pattern: in the stack frame +//@ check-run-results: MemorySanitizer: use-of-uninitialized-value +//@ check-run-results: Uninitialized value was created by an allocation +//@ check-run-results: in the stack frame // // This test case intentionally limits the usage of the std, // since it will be linked with an uninstrumented version of it. diff --git a/tests/ui/sanitizer/memory.rs b/tests/ui/sanitizer/memory.rs index bd2d67717495..164f41878c00 100644 --- a/tests/ui/sanitizer/memory.rs +++ b/tests/ui/sanitizer/memory.rs @@ -7,9 +7,9 @@ //@ [unoptimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins // //@ run-fail -//@ error-pattern: MemorySanitizer: use-of-uninitialized-value -//@ error-pattern: Uninitialized value was created by an allocation -//@ error-pattern: in the stack frame +//@ check-run-results: MemorySanitizer: use-of-uninitialized-value +//@ check-run-results: Uninitialized value was created by an allocation +//@ check-run-results: in the stack frame // // This test case intentionally limits the usage of the std, // since it will be linked with an uninstrumented version of it. diff --git a/tests/ui/sanitizer/new-llvm-pass-manager-thin-lto.rs b/tests/ui/sanitizer/new-llvm-pass-manager-thin-lto.rs index b7dd4a437821..66777ac2c9af 100644 --- a/tests/ui/sanitizer/new-llvm-pass-manager-thin-lto.rs +++ b/tests/ui/sanitizer/new-llvm-pass-manager-thin-lto.rs @@ -12,7 +12,7 @@ //@[opt0]compile-flags: -Copt-level=0 //@[opt1]compile-flags: -Copt-level=1 //@ run-fail -//@ error-pattern: ERROR: AddressSanitizer: stack-use-after-scope +//@ check-run-results: ERROR: AddressSanitizer: stack-use-after-scope static mut P: *mut usize = std::ptr::null_mut(); diff --git a/tests/ui/sanitizer/thread.rs b/tests/ui/sanitizer/thread.rs index 566774d6b1d6..30de8cc13acd 100644 --- a/tests/ui/sanitizer/thread.rs +++ b/tests/ui/sanitizer/thread.rs @@ -16,9 +16,9 @@ //@ compile-flags: -Z sanitizer=thread -O // //@ run-fail -//@ error-pattern: WARNING: ThreadSanitizer: data race -//@ error-pattern: Location is heap block of size 4 -//@ error-pattern: allocated by main thread +//@ check-run-results: WARNING: ThreadSanitizer: data race +//@ check-run-results: Location is heap block of size 4 +//@ check-run-results: allocated by main thread #![feature(rustc_private)] extern crate libc; diff --git a/tests/ui/sanitizer/use-after-scope.rs b/tests/ui/sanitizer/use-after-scope.rs index 4d7f6f6c2f2b..890e4d8fc842 100644 --- a/tests/ui/sanitizer/use-after-scope.rs +++ b/tests/ui/sanitizer/use-after-scope.rs @@ -4,7 +4,7 @@ // //@ compile-flags: -Zsanitizer=address //@ run-fail -//@ error-pattern: ERROR: AddressSanitizer: stack-use-after-scope +//@ check-run-results: ERROR: AddressSanitizer: stack-use-after-scope static mut P: *mut usize = std::ptr::null_mut(); diff --git a/tests/ui/str/str-overrun.rs b/tests/ui/str/str-overrun.rs index b8e245475da9..49c41efb654d 100644 --- a/tests/ui/str/str-overrun.rs +++ b/tests/ui/str/str-overrun.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:index out of bounds: the len is 5 but the index is 5 +//@ check-run-results:index out of bounds: the len is 5 but the index is 5 //@ ignore-emscripten no processes fn main() { diff --git a/tests/ui/str/str-overrun.run.stderr b/tests/ui/str/str-overrun.run.stderr new file mode 100644 index 000000000000..d341da2814d8 --- /dev/null +++ b/tests/ui/str/str-overrun.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/str-overrun.rs:9:16: +index out of bounds: the len is 5 but the index is 5 +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/structs/rhs-type.rs b/tests/ui/structs/rhs-type.rs index fde5c16a0680..ceb52684dce5 100644 --- a/tests/ui/structs/rhs-type.rs +++ b/tests/ui/structs/rhs-type.rs @@ -2,7 +2,7 @@ // as a _|_-typed thing, not a str-typed thing //@ run-fail -//@ error-pattern:bye +//@ check-run-results:bye //@ ignore-emscripten no processes #![allow(unreachable_code)] diff --git a/tests/ui/structs/rhs-type.run.stderr b/tests/ui/structs/rhs-type.run.stderr new file mode 100644 index 000000000000..256eb580bcce --- /dev/null +++ b/tests/ui/structs/rhs-type.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at $DIR/rhs-type.rs:16:15: +bye +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/test-attrs/terse.run.stdout b/tests/ui/test-attrs/terse.run.stdout index 2b361361ae88..ac1ac28c98d5 100644 --- a/tests/ui/test-attrs/terse.run.stdout +++ b/tests/ui/test-attrs/terse.run.stdout @@ -9,15 +9,18 @@ foo2 --- FAILED failures: ---- abc stdout ---- + thread 'abc' panicked at $DIR/terse.rs:12:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- foo stdout ---- + thread 'foo' panicked at $DIR/terse.rs:17:5: explicit panic ---- foo2 stdout ---- + thread 'foo2' panicked at $DIR/terse.rs:22:5: explicit panic diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr index 16001b3eecd4..256811711703 100644 --- a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr @@ -1,8 +1,10 @@ + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:34:5: assertion `left == right` failed left: 2 right: 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace + thread 'main' panicked at $DIR/test-panic-abort-nocapture.rs:28:5: assertion `left == right` failed left: 2 diff --git a/tests/ui/test-attrs/test-panic-abort.run.stdout b/tests/ui/test-attrs/test-panic-abort.run.stdout index f5d14e77da96..844808e86370 100644 --- a/tests/ui/test-attrs/test-panic-abort.run.stdout +++ b/tests/ui/test-attrs/test-panic-abort.run.stdout @@ -17,6 +17,7 @@ hello, world testing123 ---- it_fails stderr ---- testing321 + thread 'main' panicked at $DIR/test-panic-abort.rs:39:5: assertion `left == right` failed left: 2 diff --git a/tests/ui/test-attrs/test-thread-capture.run.stdout b/tests/ui/test-attrs/test-thread-capture.run.stdout index 31261aaa2306..f9b9757f861a 100644 --- a/tests/ui/test-attrs/test-thread-capture.run.stdout +++ b/tests/ui/test-attrs/test-thread-capture.run.stdout @@ -10,6 +10,7 @@ fee fie foe fum + thread 'thready_fail' panicked at $DIR/test-thread-capture.rs:32:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/test-attrs/test-thread-nocapture.run.stderr b/tests/ui/test-attrs/test-thread-nocapture.run.stderr index 9266fe84197b..59560015fca6 100644 --- a/tests/ui/test-attrs/test-thread-nocapture.run.stderr +++ b/tests/ui/test-attrs/test-thread-nocapture.run.stderr @@ -1,3 +1,4 @@ + thread 'thready_fail' panicked at $DIR/test-thread-nocapture.rs:32:5: explicit panic note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/threads-sendsync/task-spawn-barefn.rs b/tests/ui/threads-sendsync/task-spawn-barefn.rs index a97e92206e20..48d1779d4ffa 100644 --- a/tests/ui/threads-sendsync/task-spawn-barefn.rs +++ b/tests/ui/threads-sendsync/task-spawn-barefn.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ error-pattern:Ensure that the child thread runs by panicking +//@ check-run-results:Ensure that the child thread runs by panicking //@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/task-spawn-barefn.run.stderr b/tests/ui/threads-sendsync/task-spawn-barefn.run.stderr new file mode 100644 index 000000000000..2ebaa3870892 --- /dev/null +++ b/tests/ui/threads-sendsync/task-spawn-barefn.run.stderr @@ -0,0 +1,5 @@ +thread '' panicked at $DIR/task-spawn-barefn.rs:17:5: +assertion failed: "Ensure that the child thread runs by panicking".is_empty() +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace +thread 'main' panicked at $DIR/task-spawn-barefn.rs:12:9: +explicit panic diff --git a/tests/ui/threads-sendsync/test-tasks-invalid-value.rs b/tests/ui/threads-sendsync/test-tasks-invalid-value.rs index 127086743ca8..78b21bb8186b 100644 --- a/tests/ui/threads-sendsync/test-tasks-invalid-value.rs +++ b/tests/ui/threads-sendsync/test-tasks-invalid-value.rs @@ -2,7 +2,7 @@ // properly. //@ run-fail -//@ error-pattern:should be a positive integer +//@ check-run-results:should be a positive integer //@ compile-flags: --test //@ exec-env:RUST_TEST_THREADS=foo //@ needs-threads diff --git a/tests/ui/threads-sendsync/test-tasks-invalid-value.run.stderr b/tests/ui/threads-sendsync/test-tasks-invalid-value.run.stderr new file mode 100644 index 000000000000..a2236e694a83 --- /dev/null +++ b/tests/ui/threads-sendsync/test-tasks-invalid-value.run.stderr @@ -0,0 +1,3 @@ +thread 'main' panicked at library/test/src/helpers/concurrency.rs:11:18: +RUST_TEST_THREADS is `foo`, should be a positive integer. +note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr index 436f9ecf93de..d2908bb91776 100644 --- a/tests/ui/track-diagnostics/track.stderr +++ b/tests/ui/track-diagnostics/track.stderr @@ -24,6 +24,7 @@ LL | break rust = note: rustc $VERSION running on $TARGET = note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics + thread 'rustc' panicked at compiler/rustc_hir_typeck/src/lib.rs:LL:CC: Box note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/treat-err-as-bug/err.stderr b/tests/ui/treat-err-as-bug/err.stderr index eb7b50b42103..df5fed3fb8e9 100644 --- a/tests/ui/treat-err-as-bug/err.stderr +++ b/tests/ui/treat-err-as-bug/err.stderr @@ -4,6 +4,7 @@ error: internal compiler error[E0080]: could not evaluate static initializer LL | pub static C: u32 = 0 - 1; | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: diff --git a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr index f0e8cd0ddb96..aec1b89c7666 100644 --- a/tests/ui/treat-err-as-bug/span_delayed_bug.stderr +++ b/tests/ui/treat-err-as-bug/span_delayed_bug.stderr @@ -4,6 +4,7 @@ error: internal compiler error: delayed bug triggered by #[rustc_error(delayed_b LL | fn main() {} | ^^^^^^^^^ + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: