Skip to content

Commit 6a20f7d

Browse files
committed
Auto merge of #106209 - fee1-dead-contrib:rollup-47ysdcu, r=fee1-dead
Rollup of 9 pull requests Successful merges: - #94145 (Test leaking of BinaryHeap Drain iterators) - #103945 (Remove `iter::Empty` hack) - #104024 (Fix `unused_must_use` warning for `Box::from_raw`) - #104708 (Fix backoff doc to match implementation) - #105347 (Account for `match` expr in single line) - #105484 (Implement allow-by-default `multiple_supertrait_upcastable` lint) - #106184 (Fix `core::any` docs) - #106201 (Emit fewer errors on invalid `#[repr(transparent)]` on `enum`) - #106205 (Remove some totally duplicated files in `rustc_infer`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9b889e5 + 5e9c91c commit 6a20f7d

33 files changed

+321
-706
lines changed

compiler/rustc_feature/src/active.rs

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ declare_features! (
160160
(active, intrinsics, "1.0.0", None, None),
161161
/// Allows using `#[lang = ".."]` attribute for linking items to special compiler logic.
162162
(active, lang_items, "1.0.0", None, None),
163+
/// Allows the `multiple_supertrait_upcastable` lint.
164+
(active, multiple_supertrait_upcastable, "CURRENT_RUSTC_VERSION", None, None),
163165
/// Allows using `#[omit_gdb_pretty_printer_section]`.
164166
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
165167
/// Allows using `#[prelude_import]` on glob `use` items.

compiler/rustc_hir_analysis/src/check/check.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1060,10 +1060,8 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
10601060

10611061
if adt.variants().len() != 1 {
10621062
bad_variant_count(tcx, adt, tcx.def_span(adt.did()), adt.did());
1063-
if adt.variants().is_empty() {
1064-
// Don't bother checking the fields. No variants (and thus no fields) exist.
1065-
return;
1066-
}
1063+
// Don't bother checking the fields.
1064+
return;
10671065
}
10681066

10691067
// For each field, figure out if it's known to be a ZST and align(1), with "known"

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
729729
format!("this and all prior arms are found to be of type `{}`", t),
730730
);
731731
}
732-
let outer_error_span = if any_multiline_arm {
732+
let outer = if any_multiline_arm || !source_map.is_multiline(cause.span) {
733733
// Cover just `match` and the scrutinee expression, not
734734
// the entire match body, to reduce diagram noise.
735735
cause.span.shrink_to_lo().to(scrut_span)
736736
} else {
737737
cause.span
738738
};
739739
let msg = "`match` arms have incompatible types";
740-
err.span_label(outer_error_span, msg);
740+
err.span_label(outer, msg);
741741
self.suggest_remove_semi_or_return_binding(
742742
err,
743743
prior_arm_block_id,

0 commit comments

Comments
 (0)