Skip to content

Rollup of 10 pull requests #122794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3dfd0fd
Report arm intersections
Nadrieril Mar 17, 2024
e4487ad
Improve the `WitnessPat: Debug` impl
Nadrieril Mar 4, 2024
d697dd4
Add a crate-custom test harness
Nadrieril Mar 4, 2024
a2c74b8
SeqCst->Relaxed in doc examples.
m-ou-se Mar 19, 2024
5e4cc6f
SeqCst->Relaxed in panic_unwind/emcc.
m-ou-se Mar 19, 2024
bf3debe
SeqCst->Relaxed for proc_macro bridge counter.
m-ou-se Mar 19, 2024
904fef0
SeqCst->{Release,Acquire} for alloc error hook.
m-ou-se Mar 19, 2024
9f25a04
SeqCst->Relaxed for FIRST_PANIC.
m-ou-se Mar 19, 2024
eb96698
SeqCst->{Release,Acquire} in xous mutex.
m-ou-se Mar 19, 2024
516684c
Use less restricted memory ordering in thread_parking::pthread.
m-ou-se Mar 19, 2024
e43aef0
SeqCst->{Release,Acquire} in sys_common::thread_local_key.
m-ou-se Mar 19, 2024
46bb073
SeqCst->{Release,Acquire} for wasm DropLock.
m-ou-se Mar 19, 2024
60ad490
SeqCst->Relaxed in pal::windows::pipe.
m-ou-se Mar 19, 2024
69a4d77
SeqCst->{Release,Acquire} for xous DropLock.
m-ou-se Mar 19, 2024
5a594f7
SeqCst->Relaxed for xous set_nonblocking.
m-ou-se Mar 19, 2024
75a5196
use more accurate terminology
tshepang Mar 19, 2024
70206f0
coverage: Regression test for ICE triggered by self-loops
Zalathar Mar 20, 2024
85bec7a
coverage: Remove incorrect assertions from counter allocation
Zalathar Mar 20, 2024
2f21e4f
coverage: Tidy imports in `rustc_mir_transform::coverage::counters`
Zalathar Mar 20, 2024
92f668c
Add usize::MAX arg tests for Vec
workingjubilee Mar 20, 2024
8b519f9
Use less restricted memory ordering in xous::thread_local_key.
m-ou-se Mar 19, 2024
b45a725
SeqCst->Relaxed in std::net::test.
m-ou-se Mar 19, 2024
acddc55
SeqCst->Relaxed in thread local test.
m-ou-se Mar 19, 2024
3462175
SeqCst->Relaxed in condvar test.
m-ou-se Mar 19, 2024
2fca27c
Add bare metal riscv32 target.
royb3 Mar 18, 2024
98e6655
Rename `hir::Let` into `hir::LetExpr`
GuillaumeGomez Mar 20, 2024
a845246
Ignore paths from expansion in `unused_qualifications`
Alexendoo Mar 15, 2024
19e0ea4
make `type_flags(ReError) & HAS_ERROR`
aliemjay Mar 19, 2024
0dc006b
register opaques that reference errors
aliemjay Mar 20, 2024
352587a
compiletest: mir_dump_dir.as_path() -> &mir_dump_dir
Enselic Mar 20, 2024
c3cc6c1
compiletest: Introduce remove_and_create_dir_all() helper
Enselic Mar 20, 2024
f343870
Rollup merge of #122545 - Alexendoo:unused-qualifications, r=petroche…
matthiaskrgr Mar 20, 2024
da76c0b
Rollup merge of #122644 - Nadrieril:complexity-tests, r=compiler-errors
matthiaskrgr Mar 20, 2024
6af9745
Rollup merge of #122696 - royb3:riscv32ima, r=petrochenkov
matthiaskrgr Mar 20, 2024
ac0d75e
Rollup merge of #122729 - m-ou-se:relax, r=Amanieu
matthiaskrgr Mar 20, 2024
f927a08
Rollup merge of #122740 - tshepang:patch-1, r=clubby789
matthiaskrgr Mar 20, 2024
79915ac
Rollup merge of #122749 - aliemjay:region-err, r=compiler-errors
matthiaskrgr Mar 20, 2024
30a4e0e
Rollup merge of #122764 - Zalathar:loopy, r=oli-obk
matthiaskrgr Mar 20, 2024
112f7b0
Rollup merge of #122765 - workingjubilee:test-for-vec-handling-usize-…
matthiaskrgr Mar 20, 2024
1ea3b75
Rollup merge of #122776 - GuillaumeGomez:rename-hir-let, r=oli-obk
matthiaskrgr Mar 20, 2024
1000526
Rollup merge of #122786 - Enselic:remove_and_create_dir_all, r=onur-o…
matthiaskrgr Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::ExprKind::AddrOf(*k, *m, ohs)
}
ExprKind::Let(pat, scrutinee, span, is_recovered) => {
hir::ExprKind::Let(self.arena.alloc(hir::Let {
hir::ExprKind::Let(self.arena.alloc(hir::LetExpr {
span: self.lower_span(*span),
pat: self.lower_pat(pat),
ty: None,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ pub struct Arm<'hir> {
/// In an `if let`, imagine it as `if (let <pat> = <expr>) { ... }`; in a let-else, it is part of
/// the desugaring to if-let. Only let-else supports the type annotation at present.
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub struct Let<'hir> {
pub struct LetExpr<'hir> {
pub span: Span,
pub pat: &'hir Pat<'hir>,
pub ty: Option<&'hir Ty<'hir>>,
Expand Down Expand Up @@ -1852,7 +1852,7 @@ pub enum ExprKind<'hir> {
///
/// These are not `Local` and only occur as expressions.
/// The `let Some(x) = foo()` in `if let Some(x) = foo()` is an example of `Let(..)`.
Let(&'hir Let<'hir>),
Let(&'hir LetExpr<'hir>),
/// An `if` block, with an optional else block.
///
/// I.e., `if <expr> { <expr> } else { <expr> }`.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
ExprKind::DropTemps(ref subexpression) => {
try_visit!(visitor.visit_expr(subexpression));
}
ExprKind::Let(Let { span: _, pat, ty, init, is_recovered: _ }) => {
ExprKind::Let(LetExpr { span: _, pat, ty, init, is_recovered: _ }) => {
// match the visit order in walk_local
try_visit!(visitor.visit_expr(init));
try_visit!(visitor.visit_pat(pat));
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_pretty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ impl<'a> State<'a> {
// Print `}`:
self.bclose_maybe_open(expr.span, true);
}
hir::ExprKind::Let(&hir::Let { pat, ty, init, .. }) => {
hir::ExprKind::Let(&hir::LetExpr { pat, ty, init, .. }) => {
self.print_let(pat, ty, init);
}
hir::ExprKind::If(test, blk, elseopt) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
err.note("`if` expressions without `else` evaluate to `()`");
err.help("consider adding an `else` block that evaluates to the expected type");
*error = true;
if let ExprKind::Let(hir::Let { span, pat, init, .. }) = cond_expr.kind
if let ExprKind::Let(hir::LetExpr { span, pat, init, .. }) = cond_expr.kind
&& let ExprKind::Block(block, _) = then_expr.kind
// Refutability checks occur on the MIR, so we approximate it here by checking
// if we have an enum with a single variant or a struct in the pattern.
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

pub(super) fn check_expr_let(&self, let_expr: &'tcx hir::Let<'tcx>, hir_id: HirId) -> Ty<'tcx> {
pub(super) fn check_expr_let(
&self,
let_expr: &'tcx hir::LetExpr<'tcx>,
hir_id: HirId,
) -> Ty<'tcx> {
// for let statements, this is done in check_stmt
let init = let_expr.init;
self.warn_if_unreachable(init.hir_id, init.span, "block in `let` expression");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/expr_use_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
}
}

hir::ExprKind::Let(hir::Let { pat, init, .. }) => {
hir::ExprKind::Let(hir::LetExpr { pat, init, .. }) => {
self.walk_local(init, pat, None, |t| t.borrow_expr(init, ty::ImmBorrow))
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_hir_typeck/src/gather_locals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<'a> DeclOrigin<'a> {
}
}

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

impl<'a> From<(&'a hir::Let<'a>, hir::HirId)> for Declaration<'a> {
fn from((let_expr, hir_id): (&'a hir::Let<'a>, hir::HirId)) -> Self {
let hir::Let { pat, ty, span, init, is_recovered: _ } = *let_expr;
impl<'a> From<(&'a hir::LetExpr<'a>, hir::HirId)> for Declaration<'a> {
fn from((let_expr, hir_id): (&'a hir::LetExpr<'a>, hir::HirId)) -> Self {
let hir::LetExpr { pat, ty, span, init, is_recovered: _ } = *let_expr;
Declaration { hir_id, pat, ty, span, init: Some(init), origin: DeclOrigin::LetExpr }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/pattern_type_mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clippy_utils::diagnostics::span_lint_and_help;
use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, Let, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, LetExpr, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::lint::in_external_macro;
use rustc_middle::ty;
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<'tcx> LateLintPass<'tcx> for PatternTypeMismatch {
}
}
}
if let ExprKind::Let(Let { pat, .. }) = expr.kind {
if let ExprKind::Let(LetExpr { pat, .. }) = expr.kind {
apply_lint(cx, pat, DerefPossible::Possible);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def::Res;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::hir_id::ItemLocalId;
use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp};
use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, LetExpr, Node, Pat, PatKind, QPath, UnOp};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::impl_lint_pass;
use rustc_span::{Span, Symbol};
Expand Down Expand Up @@ -238,7 +238,7 @@ fn find_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'
let init = match node {
Node::Arm(_) | Node::Pat(_) => continue,
Node::Expr(expr) => match expr.kind {
ExprKind::Match(e, _, _) | ExprKind::Let(&Let { init: e, .. }) => Some(e),
ExprKind::Match(e, _, _) | ExprKind::Let(&LetExpr { init: e, .. }) => Some(e),
_ => None,
},
Node::Local(local) => local.init,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/unused_io_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn non_consuming_ok_arm<'a>(cx: &LateContext<'a>, arm: &hir::Arm<'a>) -> bool {
fn check_expr<'a>(cx: &LateContext<'a>, expr: &'a hir::Expr<'a>) {
match expr.kind {
hir::ExprKind::If(cond, _, _)
if let ExprKind::Let(hir::Let { pat, init, .. }) = cond.kind
if let ExprKind::Let(hir::LetExpr { pat, init, .. }) = cond.kind
&& is_ok_wild_or_dotdot_pattern(cx, pat)
&& let Some(op) = should_lint(cx, init) =>
{
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_utils/src/higher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl<'hir> IfLet<'hir> {
if let ExprKind::If(
Expr {
kind:
ExprKind::Let(&hir::Let {
ExprKind::Let(&hir::LetExpr {
pat: let_pat,
init: let_expr,
span: let_span,
Expand Down Expand Up @@ -379,7 +379,7 @@ impl<'hir> WhileLet<'hir> {
ExprKind::If(
Expr {
kind:
ExprKind::Let(&hir::Let {
ExprKind::Let(&hir::LetExpr {
pat: let_pat,
init: let_expr,
span: let_span,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_hir::def::Res;
use rustc_hir::MatchSource::TryDesugar;
use rustc_hir::{
ArrayLen, BinOpKind, BindingAnnotation, Block, BodyId, Closure, Expr, ExprField, ExprKind, FnRetTy, GenericArg,
GenericArgs, HirId, HirIdMap, InlineAsmOperand, Let, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
PathSegment, PrimTy, QPath, Stmt, StmtKind, Ty, TyKind, TypeBinding,
};
use rustc_lexer::{tokenize, TokenKind};
Expand Down Expand Up @@ -837,7 +837,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
}
}
},
ExprKind::Let(Let { pat, init, ty, .. }) => {
ExprKind::Let(LetExpr { pat, init, ty, .. }) => {
self.hash_expr(init);
if let Some(ty) = ty {
self.hash_ty(ty);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_utils/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::intravisit::{self, walk_block, walk_expr, Visitor};
use rustc_hir::{
AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, Let, Pat, QPath,
AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, LetExpr, Pat, QPath,
Stmt, UnOp, UnsafeSource, Unsafety,
};
use rustc_lint::LateContext;
Expand Down Expand Up @@ -624,7 +624,7 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
| ExprKind::Field(e, _)
| ExprKind::Unary(UnOp::Deref, e)
| ExprKind::Match(e, ..)
| ExprKind::Let(&Let { init: e, .. }) => {
| ExprKind::Let(&LetExpr { init: e, .. }) => {
helper(typeck, false, e, f)?;
},
ExprKind::Block(&Block { expr: Some(e), .. }, _) | ExprKind::Cast(e, _) | ExprKind::Unary(_, e) => {
Expand Down