Skip to content

Rollup of 9 pull requests #145351

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 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a42833e
cargo update
invalid-email-address Aug 10, 2025
378dd7c
Add regression test for former ICE involving malformed meta items con…
fmease Aug 11, 2025
258915a
llvm: Accept new LLVM lifetime format
maurer Aug 8, 2025
db1a64c
simplify stack handling, be completely lazy
lcnr Aug 5, 2025
0b855bc
Switch to a bitflags `MacroKinds` to support macros with more than on…
joshtriplett Aug 8, 2025
d7b30be
Expand documentation of `GlobDelegation`
joshtriplett Aug 9, 2025
c81fcac
Only suggest changing `#[derive(mymacro)]` to `#[mymacro]` for attrib…
joshtriplett Aug 9, 2025
ba231db
Detect and report macro kind mismatches early, and more precisely
joshtriplett Aug 9, 2025
b74e1cb
mbe: Rename macro parsing state names to use `Bang` instead of `Not`
joshtriplett Aug 9, 2025
33ba4a2
clippy: Update for switch to `MacroKinds`
joshtriplett Aug 9, 2025
e1fc89a
rustdoc: Minimal fixes to compile with `MacroKinds`
joshtriplett Aug 9, 2025
c439a59
Change the desugaring of `assert!` for better error output
estebank Mar 17, 2024
5551d8c
-Zsanitize and -Zsanitizer-cfi-normalize-integers flags are now targe…
azhogin Mar 20, 2025
6056212
Make std use the edition 2024 prelude
theemathas Aug 13, 2025
02d4666
Set NumRegisterParameters LLVM module flag to `N` when `-Zregparm=N` is
winstonallo Aug 13, 2025
3590366
Rollup merge of #122661 - estebank:assert-macro-span, r=petrochenkov
jdonszelmann Aug 13, 2025
6cc8cbc
Rollup merge of #138736 - azhogin:azhogin/sanitizers-target-modificat…
jdonszelmann Aug 13, 2025
c4a20b4
Rollup merge of #144955 - lcnr:lazily-update-non-parent-goals, r=BoxyUwU
jdonszelmann Aug 13, 2025
e625cdf
Rollup merge of #145120 - maurer:llvm-time, r=nikic
jdonszelmann Aug 13, 2025
f202554
Rollup merge of #145153 - joshtriplett:macro-kinds-plural, r=petroche…
jdonszelmann Aug 13, 2025
3a3ad6d
Rollup merge of #145189 - rust-lang:cargo_update, r=clubby789
jdonszelmann Aug 13, 2025
ff27f29
Rollup merge of #145250 - fmease:regr-test-for-attr-meta-ice, r=jdons…
jdonszelmann Aug 13, 2025
adb713a
Rollup merge of #145309 - winstonallo:issue-145271-fix, r=tgross35
jdonszelmann Aug 13, 2025
4eb209b
Rollup merge of #145331 - theemathas:std-prelude-2024, r=tgross35
jdonszelmann Aug 13, 2025
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
91 changes: 46 additions & 45 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ dependencies = [

[[package]]
name = "anstream"
version = "0.6.19"
version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933"
checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192"
dependencies = [
"anstyle",
"anstyle-parse",
Expand Down Expand Up @@ -119,18 +119,18 @@ dependencies = [

[[package]]
name = "anstyle-query"
version = "1.1.3"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9"
checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.60.2",
]

[[package]]
name = "anstyle-svg"
version = "0.1.9"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a43964079ef399480603125d5afae2b219aceffb77478956e25f17b9bc3435c"
checksum = "dc03a770ef506fe1396c0e476120ac0e6523cf14b74218dd5f18cd6833326fa9"
dependencies = [
"anstyle",
"anstyle-lossy",
Expand All @@ -141,13 +141,13 @@ dependencies = [

[[package]]
name = "anstyle-wincon"
version = "3.0.9"
version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882"
checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.59.0",
"windows-sys 0.60.2",
]

[[package]]
Expand Down Expand Up @@ -353,9 +353,9 @@ checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e"

[[package]]
name = "camino"
version = "1.1.10"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab"
checksum = "5d07aa9a93b00c76f71bc35d598bed923f6d4f3a9ca5c24b7737ae1a292841c0"
dependencies = [
"serde",
]
Expand Down Expand Up @@ -518,9 +518,9 @@ dependencies = [

[[package]]
name = "clap"
version = "4.5.42"
version = "4.5.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882"
checksum = "50fd97c9dc2399518aa331917ac6f274280ec5eb34e555dd291899745c48ec6f"
dependencies = [
"clap_builder",
"clap_derive",
Expand All @@ -538,9 +538,9 @@ dependencies = [

[[package]]
name = "clap_builder"
version = "4.5.42"
version = "4.5.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966"
checksum = "c35b5830294e1fa0462034af85cc95225a4cb07092c088c55bda3147cfcd8f65"
dependencies = [
"anstream",
"anstyle",
Expand Down Expand Up @@ -937,9 +937,9 @@ dependencies = [

[[package]]
name = "cxx"
version = "1.0.161"
version = "1.0.166"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3523cc02ad831111491dd64b27ad999f1ae189986728e477604e61b81f828df"
checksum = "b5287274dfdf7e7eaa3d97d460eb2a94922539e6af214bda423f292105011ee2"
dependencies = [
"cc",
"cxxbridge-cmd",
Expand All @@ -951,9 +951,9 @@ dependencies = [

[[package]]
name = "cxx-build"
version = "1.0.161"
version = "1.0.166"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212b754247a6f07b10fa626628c157593f0abf640a3dd04cce2760eca970f909"
checksum = "65f3ce027a744135db10a1ebffa0863dab685aeef48f40a02c201f5e70c667d3"
dependencies = [
"cc",
"codespan-reporting",
Expand All @@ -966,9 +966,9 @@ dependencies = [

[[package]]
name = "cxxbridge-cmd"
version = "1.0.161"
version = "1.0.166"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f426a20413ec2e742520ba6837c9324b55ffac24ead47491a6e29f933c5b135a"
checksum = "a07dc23f2eea4774297f4c9a17ae4065fecb63127da556e6c9fadb0216d93595"
dependencies = [
"clap",
"codespan-reporting",
Expand All @@ -980,15 +980,15 @@ dependencies = [

[[package]]
name = "cxxbridge-flags"
version = "1.0.161"
version = "1.0.166"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a258b6069020b4e5da6415df94a50ee4f586a6c38b037a180e940a43d06a070d"
checksum = "f7a4dbad6171f763c4066c83dcd27546b6e93c5c5ae2229f9813bda7233f571d"

[[package]]
name = "cxxbridge-macro"
version = "1.0.161"
version = "1.0.166"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8dec184b52be5008d6eaf7e62fc1802caf1ad1227d11b3b7df2c409c7ffc3f4"
checksum = "a9be4b527950fc42db06163705e78e73eedc8fd723708e942afe3572a9a2c366"
dependencies = [
"indexmap",
"proc-macro2",
Expand Down Expand Up @@ -1055,9 +1055,9 @@ version = "0.1.91"

[[package]]
name = "derive-where"
version = "1.5.0"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "510c292c8cf384b1a340b816a9a6cf2599eb8f566a44949024af88418000c50b"
checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f"
dependencies = [
"proc-macro2",
"quote",
Expand Down Expand Up @@ -1567,9 +1567,9 @@ dependencies = [

[[package]]
name = "hashbrown"
version = "0.15.4"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"allocator-api2",
"equivalent",
Expand Down Expand Up @@ -1688,7 +1688,7 @@ dependencies = [
"potential_utf",
"yoke 0.8.0",
"zerofrom",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -1721,7 +1721,7 @@ dependencies = [
"litemap 0.8.0",
"tinystr 0.8.1",
"writeable 0.6.1",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -1769,7 +1769,7 @@ dependencies = [
"icu_properties",
"icu_provider 2.0.0",
"smallvec",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand All @@ -1791,7 +1791,7 @@ dependencies = [
"icu_provider 2.0.0",
"potential_utf",
"zerotrie",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -1831,7 +1831,7 @@ dependencies = [
"yoke 0.8.0",
"zerofrom",
"zerotrie",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -1909,9 +1909,9 @@ dependencies = [

[[package]]
name = "indenter"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5"

[[package]]
name = "indexmap"
Expand Down Expand Up @@ -2971,7 +2971,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585"
dependencies = [
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -3889,6 +3889,7 @@ dependencies = [
name = "rustc_hir"
version = "0.0.0"
dependencies = [
"bitflags",
"odht",
"rustc_abi",
"rustc_arena",
Expand Down Expand Up @@ -4918,9 +4919,9 @@ dependencies = [

[[package]]
name = "rustversion"
version = "1.0.21"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"

[[package]]
name = "ruzstd"
Expand Down Expand Up @@ -4978,9 +4979,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"

[[package]]
name = "scratch"
version = "1.0.8"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52"
checksum = "d68f2ec51b097e4c1a75b681a8bec621909b5e91f15bb7b840c4f2f7b01148b2"

[[package]]
name = "self_cell"
Expand Down Expand Up @@ -5506,7 +5507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b"
dependencies = [
"displaydoc",
"zerovec 0.11.2",
"zerovec 0.11.4",
]

[[package]]
Expand Down Expand Up @@ -6852,9 +6853,9 @@ dependencies = [

[[package]]
name = "zerovec"
version = "0.11.2"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428"
checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b"
dependencies = [
"yoke 0.8.0",
"zerofrom",
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
let body = Box::new(self.lower_delim_args(body));
let def_id = self.local_def_id(id);
let def_kind = self.tcx.def_kind(def_id);
let DefKind::Macro(macro_kind) = def_kind else {
let DefKind::Macro(macro_kinds) = def_kind else {
unreachable!(
"expected DefKind::Macro for macro item, found {}",
def_kind.descr(def_id.to_def_id())
);
};
let macro_def = self.arena.alloc(ast::MacroDef { body, macro_rules: *macro_rules });
hir::ItemKind::Macro(ident, macro_def, macro_kind)
hir::ItemKind::Macro(ident, macro_def, macro_kinds)
}
ItemKind::Delegation(box delegation) => {
let delegation_results = self.lower_delegation(delegation, id, false);
Expand Down
35 changes: 21 additions & 14 deletions compiler/rustc_builtin_macros/src/assert.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mod context;

use rustc_ast::token::Delimiter;
use rustc_ast::token::{self, Delimiter};
use rustc_ast::tokenstream::{DelimSpan, TokenStream};
use rustc_ast::{DelimArgs, Expr, ExprKind, MacCall, Path, PathSegment, UnOp, token};
use rustc_ast::{DelimArgs, Expr, ExprKind, MacCall, Path, PathSegment};
use rustc_ast_pretty::pprust;
use rustc_errors::PResult;
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult};
Expand All @@ -29,7 +29,7 @@ pub(crate) fn expand_assert<'cx>(

// `core::panic` and `std::panic` are different macros, so we use call-site
// context to pick up whichever is currently in scope.
let call_site_span = cx.with_call_site_ctxt(span);
let call_site_span = cx.with_call_site_ctxt(cond_expr.span);

let panic_path = || {
if use_panic_2021(span) {
Expand Down Expand Up @@ -63,7 +63,7 @@ pub(crate) fn expand_assert<'cx>(
}),
})),
);
expr_if_not(cx, call_site_span, cond_expr, then, None)
assert_cond_check(cx, call_site_span, cond_expr, then)
}
// If `generic_assert` is enabled, generates rich captured outputs
//
Expand All @@ -88,26 +88,33 @@ pub(crate) fn expand_assert<'cx>(
)),
)],
);
expr_if_not(cx, call_site_span, cond_expr, then, None)
assert_cond_check(cx, call_site_span, cond_expr, then)
};

ExpandResult::Ready(MacEager::expr(expr))
}

/// `assert!($cond_expr, $custom_message)`
struct Assert {
cond_expr: Box<Expr>,
custom_message: Option<TokenStream>,
}

// if !{ ... } { ... } else { ... }
fn expr_if_not(
cx: &ExtCtxt<'_>,
span: Span,
cond: Box<Expr>,
then: Box<Expr>,
els: Option<Box<Expr>>,
) -> Box<Expr> {
cx.expr_if(span, cx.expr(span, ExprKind::Unary(UnOp::Not, cond)), then, els)
/// `match <cond> { true => {} _ => <then> }`
fn assert_cond_check(cx: &ExtCtxt<'_>, span: Span, cond: Box<Expr>, then: Box<Expr>) -> Box<Expr> {
// Instead of expanding to `if !<cond> { <then> }`, we expand to
// `match <cond> { true => {} _ => <then> }`.
// This allows us to always complain about mismatched types instead of "cannot apply unary
// operator `!` to type `X`" when passing an invalid `<cond>`, while also allowing `<cond>` to
// be `&true`.
let els = cx.expr_block(cx.block(span, thin_vec![]));
let mut arms = thin_vec![];
arms.push(cx.arm(span, cx.pat_lit(span, cx.expr_bool(span, true)), els));
arms.push(cx.arm(span, cx.pat_wild(span), then));

// We wrap the `match` in a statement to limit the length of any borrows introduced in the
// condition.
cx.expr_block(cx.block(span, [cx.stmt_expr(cx.expr_match(span, cond, arms))].into()))
}

fn parse_assert<'a>(cx: &ExtCtxt<'a>, sp: Span, stream: TokenStream) -> PResult<'a, Assert> {
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,11 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
return;
}

self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]);
if crate::llvm_util::get_version() >= (22, 0, 0) {
self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[ptr]);
} else {
self.call_intrinsic(intrinsic, &[self.val_ty(ptr)], &[self.cx.const_u64(size), ptr]);
}
}
}
impl<'a, 'll, CX: Borrow<SCx<'ll>>> GenericBuilder<'a, 'll, CX> {
Expand Down
Loading
Loading