Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b76fec3

Browse files
committedAug 14, 2022
Auto merge of #100511 - compiler-errors:rollup-vrte4w5, r=compiler-errors
Rollup of 11 pull requests Successful merges: - #100355 (rustdoc: Rename ``@has` FILE PATTERN` to ``@hasraw` FILE PATTERN`) - #100407 (avoid some int2ptr casts in thread_local_key tests) - #100434 (Fix HIR pretty printing of let else) - #100438 (Erase regions better in `promote_candidate`) - #100445 (adapt test for msan message change) - #100447 (Remove more Clean trait implementations) - #100464 (Make `[rust] use-lld=true` work on windows) - #100475 (Give a helpful diagnostic when the next struct field has an attribute) - #100490 (wf: correctly `shallow_resolve` consts) - #100501 (nicer Miri backtraces for from_exposed_addr) - #100509 (merge two test directories that mean the same thing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 75b7e52 + 860e093 commit b76fec3

File tree

128 files changed

+473
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+473
-353
lines changed
 

‎compiler/rustc_const_eval/src/transform/promote_consts.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,17 +839,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
839839
let mut promoted_operand = |ty, span| {
840840
promoted.span = span;
841841
promoted.local_decls[RETURN_PLACE] = LocalDecl::new(ty, span);
842+
let substs = tcx.erase_regions(InternalSubsts::identity_for_item(tcx, def.did));
842843
let _const = tcx.mk_const(ty::ConstS {
843844
ty,
844845
kind: ty::ConstKind::Unevaluated(ty::Unevaluated {
845846
def,
846-
substs: InternalSubsts::for_item(tcx, def.did, |param, _| {
847-
if let ty::GenericParamDefKind::Lifetime = param.kind {
848-
tcx.lifetimes.re_erased.into()
849-
} else {
850-
tcx.mk_param_from_def(param)
851-
}
852-
}),
847+
substs,
853848
promoted: Some(promoted_id),
854849
}),
855850
});

‎compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,10 @@ impl<'a> State<'a> {
911911
if let Some(els) = els {
912912
self.nbsp();
913913
self.word_space("else");
914+
// containing cbox, will be closed by print-block at `}`
915+
self.cbox(0);
916+
// head-box, will be closed by print-block after `{`
917+
self.ibox(0);
914918
self.print_block(els);
915919
}
916920

0 commit comments

Comments
 (0)
Please sign in to comment.