Skip to content

Commit fe0c86e

Browse files
[DO NOT MERGE] Make it a hard error for crater
1 parent 2af89b0 commit fe0c86e

3 files changed

Lines changed: 11 additions & 251 deletions

File tree

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,17 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
18711871
// If there are any non-trivial fields, then there can be no non-exhaustive 1-zsts.
18721872
// Otherwise, it's only an issue if there's >1 non-exhaustive 1-zst.
18731873
if non_trivial_count > 0 || prev_unsuited_1zst {
1874+
if matches!(unsuited.reason, UnsuitedReason::Array) {
1875+
#[derive(Diagnostic)]
1876+
#[diag("😱 Crater REGRESSION 😱")]
1877+
struct CraterFail {
1878+
#[primary_span]
1879+
span: Span,
1880+
}
1881+
1882+
tcx.dcx().emit_err(CraterFail { span: field.span });
1883+
}
1884+
18741885
tcx.emit_node_span_lint(
18751886
REPR_TRANSPARENT_NON_ZST_FIELDS,
18761887
tcx.local_def_id_to_hir_id(adt.did().expect_local()),

tests/ui/repr/repr-transparent-array.rs

Lines changed: 0 additions & 62 deletions
This file was deleted.

tests/ui/repr/repr-transparent-array.stderr

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)