Skip to content

Rollup of 13 pull requests #144450

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 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4304b7b
add rdg push git config entry for git protocol pushers (again)
tshepang Jul 21, 2025
c8ef211
already documented elsewhere
tshepang Jul 21, 2025
ff2bfe0
Merge pull request #2514 from rust-lang/tshepang/for-ssh-protocol
Kobzol Jul 21, 2025
9ae298c
typo
tshepang Jul 21, 2025
44bec00
Merge pull request #2515 from rust-lang/tshepang-patch-1
tshepang Jul 21, 2025
6c96e7a
Update josh sync documentation
Kobzol Jul 23, 2025
de93fb1
Add `ignore-backends` annotations in failing GCC backend ui tests
GuillaumeGomez Jul 23, 2025
910ee2d
Fix `compiletest` bad handling of `ignore-backends`
GuillaumeGomez Jul 23, 2025
f75595d
add codegen test for variadics (also replacing some existing does-thi…
RalfJung Jul 23, 2025
78fc7c3
Suggest unwrapping when private method name is available in inner type
estebank Jul 23, 2025
732097e
disable cfg.has_reliable_f128 on amdgcn
ZuseZ4 Jul 23, 2025
1115345
Prepare for merging from rust-lang/rust
invalid-email-address Jul 24, 2025
e5b1e7d
Merge ref 'efd420c770bb' from rust-lang/rust
invalid-email-address Jul 24, 2025
963cd8a
test using multiple c-variadic ABIs in the same program
folkertdev Jul 23, 2025
1ecb68d
Merge pull request #2517 from Kobzol/josh-sync
Kobzol Jul 24, 2025
a9a34e8
Stop compilation if macro expansion failed
GuillaumeGomez Jul 24, 2025
82bf67c
Add missing `NOTE` annotations in `tests/ui/macros/trace-macro.rs`
GuillaumeGomez Jul 24, 2025
b8d628c
Use LocalKey<Cell> methods more
camsteffen Jul 22, 2025
a2b3d81
Call `is_parsed_attribute` rather than keeping track of a list of par…
JonathanBrouwer Jul 24, 2025
1de927c
library/windows_targets: Fix macro expansion error in 'link' macro
itf Jul 24, 2025
97676e6
Allow setting `release-blog-post` label with rustbot
BoxyUwU Jul 24, 2025
546885c
tests: aarch64-outline-atomics: Remove hardcoded target
Gelbpunkt Jul 25, 2025
e69303f
Merge pull request #2518 from rust-lang/rustc-pull
tshepang Jul 25, 2025
faa28f9
Update ui tests with new macro early erroring
GuillaumeGomez Jul 24, 2025
73e534b
Revert "Move `shared_helpers` test to a dedicated module"
jieyouxu Jul 25, 2025
430f4f5
Check `./x check bootstrap` in `pr-check-1`
jieyouxu Jul 25, 2025
2771b07
Rollup merge of #144356 - GuillaumeGomez:gcc-ignore-tests, r=jieyouxu
GuillaumeGomez Jul 25, 2025
ef5676b
Rollup merge of #144359 - RalfJung:vararg-codegen, r=compiler-errors
GuillaumeGomez Jul 25, 2025
8326fc8
Rollup merge of #144376 - estebank:issue-143795, r=lcnr
GuillaumeGomez Jul 25, 2025
65bd9cd
Rollup merge of #144379 - folkertdev:c-variadic-same-program-multiple…
GuillaumeGomez Jul 25, 2025
ceb3974
Rollup merge of #144383 - ZuseZ4:disable-f128-on-amdgcn, r=oli-obk
GuillaumeGomez Jul 25, 2025
ad76ced
Rollup merge of #144409 - GuillaumeGomez:macro-expansion-early-abort,…
GuillaumeGomez Jul 25, 2025
d21e925
Rollup merge of #144412 - camsteffen:localkey-cell-refactors, r=petro…
GuillaumeGomez Jul 25, 2025
d51cb59
Rollup merge of #144421 - JonathanBrouwer:cleanup-malformed-list, r=o…
GuillaumeGomez Jul 25, 2025
d98c3d3
Rollup merge of #144422 - itf:itf-patch-2-1, r=ChrisDenton
GuillaumeGomez Jul 25, 2025
15ce8d7
Rollup merge of #144424 - BoxyUwU:release_blog_post_unauthorized_user…
GuillaumeGomez Jul 25, 2025
be1685c
Rollup merge of #144430 - Gelbpunkt:aarch64-outline-atomics-target, r…
GuillaumeGomez Jul 25, 2025
badd8bd
Rollup merge of #144435 - tshepang:rdg-sync, r=jieyouxu
GuillaumeGomez Jul 25, 2025
a3ab44f
Rollup merge of #144445 - jieyouxu:revert-shared_helpers_tests, r=Kobzol
GuillaumeGomez Jul 25, 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
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4255,6 +4255,7 @@ dependencies = [
"rustc-literal-escaper",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr_parsing",
"rustc_data_structures",
"rustc_errors",
"rustc_feature",
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
("mips64" | "mips64r6", _) => false,
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>
("nvptx64", _) => false,
// Unsupported https://github.com/llvm/llvm-project/issues/121122
("amdgpu", _) => false,
// ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
// list at <https://github.com/rust-lang/rust/issues/116909>)
("powerpc" | "powerpc64", _) => false,
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_errors/src/markdown/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ thread_local! {
pub(crate) fn entrypoint(stream: &MdStream<'_>, buf: &mut Buffer) -> io::Result<()> {
#[cfg(not(test))]
if let Some((w, _)) = termize::dimensions() {
WIDTH.with(|c| c.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH)));
WIDTH.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH));
}
write_stream(stream, buf, None, 0)?;
buf.write_all(b"\n")
Expand Down Expand Up @@ -84,7 +84,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()>
reset_cursor();
}
MdTree::HorizontalRule => {
(0..WIDTH.with(Cell::get)).for_each(|_| buf.write_all(b"-").unwrap());
(0..WIDTH.get()).for_each(|_| buf.write_all(b"-").unwrap());
reset_cursor();
}
MdTree::Heading(n, stream) => {
Expand Down Expand Up @@ -121,7 +121,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()>

/// End of that block, just wrap the line
fn reset_cursor() {
CURSOR.with(|cur| cur.set(0));
CURSOR.set(0);
}

/// Change to be generic on Write for testing. If we have a link URL, we don't
Expand All @@ -144,7 +144,7 @@ fn write_wrapping<B: io::Write>(
buf.write_all(ind_ws)?;
cur.set(indent);
}
let ch_count = WIDTH.with(Cell::get) - cur.get();
let ch_count = WIDTH.get() - cur.get();
let mut iter = to_write.char_indices();
let Some((end_idx, _ch)) = iter.nth(ch_count) else {
// Write entire line
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ pub struct ExtCtxt<'a> {
pub(super) expanded_inert_attrs: MarkedAttrs,
/// `-Zmacro-stats` data.
pub macro_stats: FxHashMap<(Symbol, MacroKind), MacroStat>,
pub nb_macro_errors: usize,
}

impl<'a> ExtCtxt<'a> {
Expand Down Expand Up @@ -1254,6 +1255,7 @@ impl<'a> ExtCtxt<'a> {
expanded_inert_attrs: MarkedAttrs::new(),
buffered_early_lint: vec![],
macro_stats: Default::default(),
nb_macro_errors: 0,
}
}

Expand Down Expand Up @@ -1315,6 +1317,12 @@ impl<'a> ExtCtxt<'a> {
self.current_expansion.id.expansion_cause()
}

/// This method increases the internal macro errors count and then call `trace_macros_diag`.
pub fn macro_error_and_trace_macros_diag(&mut self) {
self.nb_macro_errors += 1;
self.trace_macros_diag();
}

pub fn trace_macros_diag(&mut self) {
for (span, notes) in self.expansions.iter() {
let mut db = self.dcx().create_note(errors::TraceMacro { span: *span });
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
crate_name: self.cx.ecfg.crate_name,
});

self.cx.trace_macros_diag();
self.cx.macro_error_and_trace_macros_diag();
guar
}

Expand All @@ -707,7 +707,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
) -> ErrorGuaranteed {
let guar =
self.cx.dcx().emit_err(WrongFragmentKind { span, kind: kind.name(), name: &mac.path });
self.cx.trace_macros_diag();
self.cx.macro_error_and_trace_macros_diag();
guar
}

Expand Down Expand Up @@ -1048,7 +1048,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
}
annotate_err_with_kind(&mut err, kind, span);
let guar = err.emit();
self.cx.trace_macros_diag();
self.cx.macro_error_and_trace_macros_diag();
kind.dummy(span, guar)
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_expand/src/mbe/macro_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ enum EofMatcherPositions {
}

/// Represents the possible results of an attempted parse.
#[derive(Debug)]
pub(crate) enum ParseResult<T, F> {
/// Parsed successfully.
Success(T),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/mbe/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn expand_macro<'cx>(
// Retry and emit a better error.
let (span, guar) =
diagnostics::failed_to_match_macro(cx.psess(), sp, def_span, name, arg, rules);
cx.trace_macros_diag();
cx.macro_error_and_trace_macros_diag();
DummyResult::any(span, guar)
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir_typeck/src/method/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
err.span_label(within_macro_span, "due to this macro variable");
}
self.suggest_valid_traits(&mut err, item_name, out_of_scope_traits, true);
self.suggest_unwrapping_inner_self(&mut err, source, rcvr_ty, item_name);
err.emit()
}

Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ fn configure_and_expand(
let mut ecx = ExtCtxt::new(sess, cfg, resolver, Some(&lint_store));
ecx.num_standard_library_imports = num_standard_library_imports;
// Expand macros now!
let krate = sess.time("expand_crate", || ecx.monotonic_expander().expand_crate(krate));
let (krate, nb_macro_errors) = sess.time("expand_crate", || {
let mut expander = ecx.monotonic_expander();
let krate = expander.expand_crate(krate);
(krate, ecx.nb_macro_errors)
});

if nb_macro_errors > 0 {
sess.dcx().abort_if_errors();
}

// The rest is error reporting and stats

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ macro_rules! define_helper {

impl $helper {
pub fn new() -> $helper {
$helper($tl.with(|c| c.replace(true)))
$helper($tl.replace(true))
}
}

Expand All @@ -100,12 +100,12 @@ macro_rules! define_helper {

impl Drop for $helper {
fn drop(&mut self) {
$tl.with(|c| c.set(self.0))
$tl.set(self.0)
}
}

pub fn $name() -> bool {
$tl.with(|c| c.get())
$tl.get()
}
)+
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_parse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bitflags = "2.4.1"
rustc-literal-escaper = "0.0.5"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_feature = { path = "../rustc_feature" }
Expand Down
65 changes: 4 additions & 61 deletions compiler/rustc_parse/src/validate_attr.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//! Meta-syntax validation logic of attributes for post-expansion.

use std::slice;

use rustc_ast::token::Delimiter;
use rustc_ast::tokenstream::DelimSpan;
use rustc_ast::{
self as ast, AttrArgs, Attribute, DelimArgs, MetaItem, MetaItemInner, MetaItemKind, NodeId,
Path, Safety,
};
use rustc_attr_parsing::{AttributeParser, Late};
use rustc_errors::{Applicability, DiagCtxtHandle, FatalError, PResult};
use rustc_feature::{AttributeSafety, AttributeTemplate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
use rustc_session::errors::report_lit_error;
Expand Down Expand Up @@ -266,67 +269,7 @@ pub fn check_builtin_meta_item(
) {
if !is_attr_template_compatible(&template, &meta.kind) {
// attrs with new parsers are locally validated so excluded here
if matches!(
name,
sym::inline
| sym::export_stable
| sym::ffi_const
| sym::ffi_pure
| sym::rustc_std_internal_symbol
| sym::may_dangle
| sym::rustc_as_ptr
| sym::rustc_pub_transparent
| sym::rustc_const_stable_indirect
| sym::rustc_force_inline
| sym::rustc_confusables
| sym::rustc_skip_during_method_dispatch
| sym::rustc_pass_by_value
| sym::rustc_deny_explicit_impl
| sym::rustc_do_not_implement_via_object
| sym::rustc_coinductive
| sym::const_trait
| sym::stable
| sym::unstable
| sym::rustc_allowed_through_unstable_modules
| sym::rustc_specialization_trait
| sym::rustc_unsafe_specialization_marker
| sym::rustc_allow_incoherent_impl
| sym::rustc_coherence_is_core
| sym::marker
| sym::fundamental
| sym::rustc_paren_sugar
| sym::type_const
| sym::repr
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres
// ambiguity
| sym::rustc_align
| sym::deprecated
| sym::optimize
| sym::pointee
| sym::cold
| sym::target_feature
| sym::rustc_allow_const_fn_unstable
| sym::macro_use
| sym::macro_escape
| sym::naked
| sym::no_mangle
| sym::non_exhaustive
| sym::omit_gdb_pretty_printer_section
| sym::path
| sym::ignore
| sym::must_use
| sym::track_caller
| sym::link_name
| sym::link_ordinal
| sym::export_name
| sym::rustc_macro_transparency
| sym::link_section
| sym::rustc_layout_scalar_valid_range_start
| sym::rustc_layout_scalar_valid_range_end
| sym::no_implicit_prelude
| sym::automatically_derived
| sym::coverage
) {
if AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(&name)) {
return;
}
emit_malformed_attribute(psess, style, meta.span, name, template);
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_query_system/src/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ fn incremental_verify_ich_failed<Tcx>(
static INSIDE_VERIFY_PANIC: Cell<bool> = const { Cell::new(false) };
};

let old_in_panic = INSIDE_VERIFY_PANIC.with(|in_panic| in_panic.replace(true));
let old_in_panic = INSIDE_VERIFY_PANIC.replace(true);

if old_in_panic {
tcx.sess().dcx().emit_err(crate::error::Reentrant);
Expand All @@ -739,7 +739,7 @@ fn incremental_verify_ich_failed<Tcx>(
panic!("Found unstable fingerprints for {dep_node:?}: {}", result());
}

INSIDE_VERIFY_PANIC.with(|in_panic| in_panic.set(old_in_panic));
INSIDE_VERIFY_PANIC.set(old_in_panic);
}

/// Ensure that either this query has all green inputs or been executed.
Expand Down
16 changes: 3 additions & 13 deletions library/windows_targets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,12 @@ pub macro link_dylib {

#[cfg(feature = "windows_raw_dylib")]
pub macro link($($tt:tt)*) {
$crate::link_raw_dylib!($($tt)*)
$crate::link_raw_dylib!($($tt)*);
}

#[cfg(not(feature = "windows_raw_dylib"))]
pub macro link {
($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (
// Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't
// have in this repo. So instead we always link kernel32.lib and add the rest of the import
// libraries below by using an empty extern block. This works because extern blocks are not
// connected to the library given in the #[link] attribute.
#[link(name = "kernel32")]
unsafe extern $abi {
$(#[link_name=$link_name])?
pub fn $($function)*;
}
)
pub macro link($($tt:tt)*) {
$crate::link_dylib!($($tt)*);
}

#[cfg(not(feature = "windows_raw_dylib"))]
Expand Down
22 changes: 11 additions & 11 deletions src/bootstrap/src/utils/shared_helpers.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
//! This module serves two purposes:
//! 1. It is part of the `utils` module and used in other parts of bootstrap.
//! 2. It is embedded inside bootstrap shims to avoid a dependency on the bootstrap library.
//! Therefore, this module should never use any other bootstrap module. This reduces binary
//! size and improves compilation time by minimizing linking time.
//!
//! 1. It is part of the `utils` module and used in other parts of bootstrap.
//! 2. It is embedded inside bootstrap shims to avoid a dependency on the bootstrap library.
//! Therefore, this module should never use any other bootstrap module. This reduces binary size
//! and improves compilation time by minimizing linking time.
// # Note on tests
//
// If we were to declare a tests submodule here, the shim binaries that include this module via
// `#[path]` would fail to find it, which breaks `./x check bootstrap`. So instead the unit tests
// for this module are in `super::tests::shared_helpers_tests`.

#![allow(dead_code)]

#[cfg(test)]
mod tests;

use std::env;
use std::ffi::OsString;
use std::fs::OpenOptions;
use std::io::Write;
use std::process::Command;
use std::str::FromStr;

// If we were to declare a tests submodule here, the shim binaries that include this
// module via `#[path]` would fail to find it, which breaks `./x check bootstrap`.
// So instead the unit tests for this module are in `super::tests::shared_helpers_tests`.

/// Returns the environment variable which the dynamic library lookup path
/// resides in for this platform.
pub fn dylib_path_var() -> &'static str {
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/src/utils/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ use crate::{Build, Config, Flags, t};

pub mod git;

// Note: tests for `shared_helpers` is separate here, as otherwise shim binaries that include the
// `shared_helpers` via `#[path]` would fail to find it, breaking `./x check bootstrap`.
mod shared_helpers_tests;

/// Holds temporary state of a bootstrap test.
/// Right now it is only used to redirect the build directory of the bootstrap
/// invocation, in the future it would be great if we could actually execute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//! The `shared_helpers` module can't have its own tests submodule, because that would cause
//! problems for the shim binaries that include it via `#[path]`, so instead those unit tests live
//! here.
//!
//! To prevent tidy from complaining about this file not being named `tests.rs`, it lives inside a
//! submodule directory named `tests`.
use crate::utils::shared_helpers::parse_value_from_args;

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/pr-check-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ COPY host-x86_64/pr-check-1/validate-toolstate.sh /scripts/
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.
ENV SCRIPT \
python3 ../x.py check bootstrap && \
/scripts/check-default-config-profiles.sh && \
python3 ../x.py build src/tools/build-manifest && \
python3 ../x.py test --stage 0 src/tools/compiletest && \
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
460259d14de0274b97b8801e08cb2fe5f16fdac5
efd420c770bb179537c01063e98cb6990c439654
Loading