Skip to content

Commit

Permalink
Auto merge of rust-lang#106209 - fee1-dead-contrib:rollup-47ysdcu, r=…
Browse files Browse the repository at this point in the history
…fee1-dead

Rollup of 9 pull requests

Successful merges:

 - rust-lang#94145 (Test leaking of BinaryHeap Drain iterators)
 - rust-lang#103945 (Remove `iter::Empty` hack)
 - rust-lang#104024 (Fix `unused_must_use` warning for `Box::from_raw`)
 - rust-lang#104708 (Fix backoff doc to match implementation)
 - rust-lang#105347 (Account for `match` expr in single line)
 - rust-lang#105484 (Implement allow-by-default `multiple_supertrait_upcastable` lint)
 - rust-lang#106184 (Fix `core::any` docs)
 - rust-lang#106201 (Emit fewer errors on invalid `#[repr(transparent)]` on `enum`)
 - rust-lang#106205 (Remove some totally duplicated files in `rustc_infer`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 28, 2022
2 parents 9b889e5 + 5e9c91c commit 6a20f7d
Show file tree
Hide file tree
Showing 33 changed files with 321 additions and 706 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ declare_features! (
(active, intrinsics, "1.0.0", None, None),
/// Allows using `#[lang = ".."]` attribute for linking items to special compiler logic.
(active, lang_items, "1.0.0", None, None),
/// Allows the `multiple_supertrait_upcastable` lint.
(active, multiple_supertrait_upcastable, "CURRENT_RUSTC_VERSION", None, None),
/// Allows using `#[omit_gdb_pretty_printer_section]`.
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
/// Allows using `#[prelude_import]` on glob `use` items.
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,10 +1060,8 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)

if adt.variants().len() != 1 {
bad_variant_count(tcx, adt, tcx.def_span(adt.did()), adt.did());
if adt.variants().is_empty() {
// Don't bother checking the fields. No variants (and thus no fields) exist.
return;
}
// Don't bother checking the fields.
return;
}

// For each field, figure out if it's known to be a ZST and align(1), with "known"
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,15 +729,15 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
format!("this and all prior arms are found to be of type `{}`", t),
);
}
let outer_error_span = if any_multiline_arm {
let outer = if any_multiline_arm || !source_map.is_multiline(cause.span) {
// Cover just `match` and the scrutinee expression, not
// the entire match body, to reduce diagram noise.
cause.span.shrink_to_lo().to(scrut_span)
} else {
cause.span
};
let msg = "`match` arms have incompatible types";
err.span_label(outer_error_span, msg);
err.span_label(outer, msg);
self.suggest_remove_semi_or_return_binding(
err,
prior_arm_block_id,
Expand Down
Loading

0 comments on commit 6a20f7d

Please sign in to comment.