Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bb319dd

Browse files
committed
Auto merge of rust-lang#122794 - matthiaskrgr:rollup-tql9mpa, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#122545 (Ignore paths from expansion in `unused_qualifications`) - rust-lang#122644 (pattern analysis: add a custom test harness) - rust-lang#122696 (Add bare metal riscv32 target.) - rust-lang#122729 (Relax SeqCst ordering in standard library.) - rust-lang#122740 (use more accurate terminology) - rust-lang#122749 (make `type_flags(ReError) & HAS_ERROR`) - rust-lang#122764 (coverage: Remove incorrect assertions from counter allocation) - rust-lang#122765 (Add `usize::MAX` arg tests for Vec) - rust-lang#122776 (Rename `hir::Let` into `hir::LetExpr`) - rust-lang#122786 (compiletest: Introduce `remove_and_create_dir_all()` helper) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1388d7a + 1000526 commit bb319dd

File tree

107 files changed

+1142
-840
lines changed

Some content is hidden

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

107 files changed

+1142
-840
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4440,6 +4440,8 @@ dependencies = [
44404440
"rustc_target",
44414441
"smallvec",
44424442
"tracing",
4443+
"tracing-subscriber",
4444+
"tracing-tree",
44434445
]
44444446

44454447
[[package]]

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
157157
hir::ExprKind::AddrOf(*k, *m, ohs)
158158
}
159159
ExprKind::Let(pat, scrutinee, span, is_recovered) => {
160-
hir::ExprKind::Let(self.arena.alloc(hir::Let {
160+
hir::ExprKind::Let(self.arena.alloc(hir::LetExpr {
161161
span: self.lower_span(*span),
162162
pat: self.lower_pat(pat),
163163
ty: None,

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,6 @@ fn check_opaque_type_parameter_valid(
434434
// Only check the parent generics, which will ignore any of the
435435
// duplicated lifetime args that come from reifying late-bounds.
436436
for (i, arg) in opaque_type_key.args.iter().take(parent_generics.count()).enumerate() {
437-
if let Err(guar) = arg.error_reported() {
438-
return Err(guar);
439-
}
440-
441437
let arg_is_param = match arg.unpack() {
442438
GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Param(_)),
443439
GenericArgKind::Lifetime(lt) if is_ty_alias => {

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ pub struct Arm<'hir> {
12591259
/// In an `if let`, imagine it as `if (let <pat> = <expr>) { ... }`; in a let-else, it is part of
12601260
/// the desugaring to if-let. Only let-else supports the type annotation at present.
12611261
#[derive(Debug, Clone, Copy, HashStable_Generic)]
1262-
pub struct Let<'hir> {
1262+
pub struct LetExpr<'hir> {
12631263
pub span: Span,
12641264
pub pat: &'hir Pat<'hir>,
12651265
pub ty: Option<&'hir Ty<'hir>>,
@@ -1852,7 +1852,7 @@ pub enum ExprKind<'hir> {
18521852
///
18531853
/// These are not `Local` and only occur as expressions.
18541854
/// The `let Some(x) = foo()` in `if let Some(x) = foo()` is an example of `Let(..)`.
1855-
Let(&'hir Let<'hir>),
1855+
Let(&'hir LetExpr<'hir>),
18561856
/// An `if` block, with an optional else block.
18571857
///
18581858
/// I.e., `if <expr> { <expr> } else { <expr> }`.

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
753753
ExprKind::DropTemps(ref subexpression) => {
754754
try_visit!(visitor.visit_expr(subexpression));
755755
}
756-
ExprKind::Let(Let { span: _, pat, ty, init, is_recovered: _ }) => {
756+
ExprKind::Let(LetExpr { span: _, pat, ty, init, is_recovered: _ }) => {
757757
// match the visit order in walk_local
758758
try_visit!(visitor.visit_expr(init));
759759
try_visit!(visitor.visit_pat(pat));

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ impl<'a> State<'a> {
13871387
// Print `}`:
13881388
self.bclose_maybe_open(expr.span, true);
13891389
}
1390-
hir::ExprKind::Let(&hir::Let { pat, ty, init, .. }) => {
1390+
hir::ExprKind::Let(&hir::LetExpr { pat, ty, init, .. }) => {
13911391
self.print_let(pat, ty, init);
13921392
}
13931393
hir::ExprKind::If(test, blk, elseopt) => {

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
317317
err.note("`if` expressions without `else` evaluate to `()`");
318318
err.help("consider adding an `else` block that evaluates to the expected type");
319319
*error = true;
320-
if let ExprKind::Let(hir::Let { span, pat, init, .. }) = cond_expr.kind
320+
if let ExprKind::Let(hir::LetExpr { span, pat, init, .. }) = cond_expr.kind
321321
&& let ExprKind::Block(block, _) = then_expr.kind
322322
// Refutability checks occur on the MIR, so we approximate it here by checking
323323
// if we have an enum with a single variant or a struct in the pattern.

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12611261
}
12621262
}
12631263

1264-
pub(super) fn check_expr_let(&self, let_expr: &'tcx hir::Let<'tcx>, hir_id: HirId) -> Ty<'tcx> {
1264+
pub(super) fn check_expr_let(
1265+
&self,
1266+
let_expr: &'tcx hir::LetExpr<'tcx>,
1267+
hir_id: HirId,
1268+
) -> Ty<'tcx> {
12651269
// for let statements, this is done in check_stmt
12661270
let init = let_expr.init;
12671271
self.warn_if_unreachable(init.hir_id, init.span, "block in `let` expression");

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
245245
}
246246
}
247247

248-
hir::ExprKind::Let(hir::Let { pat, init, .. }) => {
248+
hir::ExprKind::Let(hir::LetExpr { pat, init, .. }) => {
249249
self.walk_local(init, pat, None, |t| t.borrow_expr(init, ty::ImmBorrow))
250250
}
251251

compiler/rustc_hir_typeck/src/gather_locals.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a> DeclOrigin<'a> {
2929
}
3030
}
3131

32-
/// A declaration is an abstraction of [hir::Local] and [hir::Let].
32+
/// A declaration is an abstraction of [hir::Local] and [hir::LetExpr].
3333
///
3434
/// It must have a hir_id, as this is how we connect gather_locals to the check functions.
3535
pub(super) struct Declaration<'a> {
@@ -48,9 +48,9 @@ impl<'a> From<&'a hir::Local<'a>> for Declaration<'a> {
4848
}
4949
}
5050

51-
impl<'a> From<(&'a hir::Let<'a>, hir::HirId)> for Declaration<'a> {
52-
fn from((let_expr, hir_id): (&'a hir::Let<'a>, hir::HirId)) -> Self {
53-
let hir::Let { pat, ty, span, init, is_recovered: _ } = *let_expr;
51+
impl<'a> From<(&'a hir::LetExpr<'a>, hir::HirId)> for Declaration<'a> {
52+
fn from((let_expr, hir_id): (&'a hir::LetExpr<'a>, hir::HirId)) -> Self {
53+
let hir::LetExpr { pat, ty, span, init, is_recovered: _ } = *let_expr;
5454
Declaration { hir_id, pat, ty, span, init: Some(init), origin: DeclOrigin::LetExpr }
5555
}
5656
}

0 commit comments

Comments
 (0)