rust/tests/ui/mir
Nicholas Nethercote f1ac54123f Don't consider delayed bugs for -Ztreat-err-as-bug.
`-Ztreat-err-as-bug` treats normal errors and delayed bugs equally,
which can lead to some really surprising results.

This commit changes `-Ztreat-err-as-bug` so it ignores delayed bugs,
unless they get promoted to proper bugs and are printed.

This feels to me much simpler and more logical. And it simplifies the
implementation:
- The `-Ztreat-err-as-bug` check is removed from in
  `DiagCtxt::{delayed_bug,span_delayed_bug}`.
- `treat_err_as_bug` doesn't need to count delayed bugs.
- The `-Ztreat-err-as-bug` panic message is simpler, because it doesn't
  have to mention delayed bugs.

Output of delayed bugs is now more consistent. They're always printed
the same way. Previously when they triggered `-Ztreat-err-as-bug` they
would be printed slightly differently, via `span_bug` in
`span_delayed_bug` or `delayed_bug`.

A minor behaviour change: the "no errors encountered even though
`span_delayed_bug` issued" printed before delayed bugs is now a note
rather than a bug. This is done so it doesn't get counted as an error
that might trigger `-Ztreat-err-as-bug`, which would be silly.
This means that if you use `-Ztreat-err-as-bug=1` and there are no
normal errors but there are delayed bugs, the first delayed bug will be
shown (and the panic will happen after it's printed).

Also, I have added a second note saying "those delayed bugs will now be
shown as internal compiler errors". I think this makes it clearer what
is happening, because the whole concept of delayed bugs is non-obvious.

There are some test changes.
- equality-in-canonical-query.rs: Minor output changes, and the error
  count reduces by one because the "no errors encountered even though
  `span_delayed_bug` issued" message is no longer counted as an error.
- rpit_tait_equality_in_canonical_query.rs: Ditto.
- storage-live.rs: The query stack disappears because these delayed bugs
  are now printed at the end, rather than when they are created.
- storage-return.rs, span_delayed_bug.rs: now need
  `-Zeagerly-emit-delayed-bugs` because they need the delayed bugs
  emitted immediately to preserve behaviour.
2024-01-13 09:59:56 +11:00
..
alignment Check alignment of pointers only when read/written through 2023-11-04 13:01:32 -04:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
lint Don't consider delayed bugs for -Ztreat-err-as-bug. 2024-01-13 09:59:56 +11:00
mir-inlining Fix inlining with -Zalways-encode-mir 2023-08-27 23:52:27 +02:00
validate custom mir: make it clear what the return block is 2023-12-26 20:15:26 +01:00
build-async-error-body-correctly.rs Build pre-coroutine-transform coroutine body 2023-11-07 21:14:43 +00:00
build-async-error-body-correctly.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
checks_without_panic_impl.rs Only emit alignment checks if we have a panic_impl 2023-04-13 10:58:00 -04:00
debug-ref-undef.rs Add test. 2023-08-17 17:02:04 +00:00
drop-elaboration-after-borrowck-error.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
drop-elaboration-after-borrowck-error.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
field-projection-invariant.rs only require sub type relation on field projection types 2023-02-12 23:18:15 +01:00
field-projection-mutating-context2.rs only require sub type relation on field projection types 2023-02-12 23:18:15 +01:00
field-projection-mutating-context2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
field-projection-mutating-context.rs only require sub type relation on field projection types 2023-02-12 23:18:15 +01:00
field-projection-mutating-context.stderr recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
field-ty-ascription-enums.rs only require sub type relation on field projection types 2023-02-12 23:18:15 +01:00
field-ty-ascription.rs only require sub type relation on field projection types 2023-02-12 23:18:15 +01:00
important-higher-ranked-regions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue66339.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
issue-29227.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-46845.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-60390.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-66851.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-66930.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67639-normalization-ice.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67710-inline-projection.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67947.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67947.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-68841.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-71793-inline-args-storage.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
issue-73914.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-74739.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75053.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-75053.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-75419-validation-impl-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-76248.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-76375.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-76740-copy-propagation.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-76803-branches-not-same.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-77002.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-77359-simplify-arm-identity.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-77911.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-78496.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-80949.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
issue-83499-input-output-iteration-ice.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-83499-input-output-iteration-ice.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-89485.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-91745.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-92893.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
issue-92893.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-99852.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-99866.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-101844.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
issue-102389.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-102389.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-105809.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-106062.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-106062.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-107678-projection-with-lifetime.rs ReErased regions are local 2023-02-05 15:29:07 +01:00
issue-107691.rs yet another ui test 2023-02-05 22:51:37 +01:00
issue-109004-drop-large-array.rs Drop subslices of arrays 2023-03-17 12:26:04 +00:00
issue-109743.rs Move a const-prop-lint specific hack from mir interpret to const-prop-lint and make it fallible 2023-04-04 10:39:26 +00:00
issue-112269.rs Show note for type ascription interpreted as a constant pattern, not a new variable 2023-06-04 20:49:30 +08:00
issue-112269.stderr Show note for type ascription interpreted as a constant pattern, not a new variable 2023-06-04 20:49:30 +08:00
mir_adt_construction.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_ascription_coercion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_assign_eval_order.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_augmented_assignments.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_autoderef.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_build_match_comparisons.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_call_with_associated_type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_calls_to_shims.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_cast_fn_ret.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_array_2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_call_converging.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_calls_converging_drops_2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_calls_converging_drops.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_calls_diverging_drops.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_calls_diverging.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_calls.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_critical_edge.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_spike1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_codegen_ssa.rs Fix def-use dominance check 2023-01-27 00:54:31 +01:00
mir_codegen_switch.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
mir_codegen_switchint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_coercion_casts.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_coercions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_const_prop_identity.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_const_prop_tuple_field_reorder.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_constval_adts.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_detects_invalid_ops.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_detects_invalid_ops.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_drop_order.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_drop_panics.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_dynamic_drops_1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_dynamic_drops_2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_dynamic_drops_3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_early_return_scope.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_fat_ptr_drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_fat_ptr.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
mir_heavy_promoted.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_indexing_oob_1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_indexing_oob_2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_indexing_oob_3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_let_chains_drop_order.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_match_arm_guard.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_match_test.rs Lint overlapping ranges as a separate pass 2023-10-27 05:16:26 +02:00
mir_misc_casts.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_overflow_off.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_raw_fat_ptr.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
mir_refs_correct.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
mir_small_agg_arg.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_static_subtype.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_struct_with_assoc_ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_temp_promotions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_void_return_2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir_void_return.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir-typeck-normalize-fn-sig.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
remove-zsts-query-cycle.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
simplify-branch-same.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ssa_call_ret.rs custom mir: make it clear what the return block is 2023-12-26 20:15:26 +01:00
ssa-analysis-regression-50041.rs remove box_free and replace with drop impl 2023-06-16 13:41:06 -07:00
thir-constparam-temp.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
thir-constparam-temp.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
unsize-trait.rs Add test. 2023-03-05 20:55:29 +00:00