Skip to content
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

Rollup of 12 pull requests #138202

Merged
merged 31 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
917d2eb
add verbatim linker to AIXLinker
Feb 20, 2025
d6bb98e
span: add a "future" edition
davidtwco Feb 12, 2025
b5562c0
Remove i586-pc-windows-msvc
Noratrieb Mar 3, 2025
1a5a453
atomic: clarify that failing conditional RMW operations are not 'writes'
RalfJung Mar 4, 2025
e07d9a8
rustdoc: Add attribute-related tests for rustdoc JSON.
obi1kenobi Mar 5, 2025
9d8ce72
compiler: factor Windows x86-32 ABI impl into its own file
workingjubilee Feb 21, 2025
4e4bed8
setTargetTriple now accepts Triple rather than string
ZequanWu Mar 7, 2025
8814679
rename Triple to Target
ZequanWu Mar 7, 2025
d5da6b7
Add post-merge analysis CI workflow
Kobzol Mar 4, 2025
ec3cde2
Apply `--cfg windows_raw_dylib` for bootstrap tools too
jieyouxu Mar 7, 2025
bd884d8
Prevent `rmake.rs` from using any nightly/unstable features
jieyouxu Feb 24, 2025
da57f14
Fix `issue-107495-archive-permissions` to not rely on `rustc_private`
jieyouxu Feb 24, 2025
9befcfd
Fix `cross-lang-lto` to not use `path_file_prefix`
jieyouxu Feb 24, 2025
d47e5a3
Temporarily depend on `os_pipe` in `run-make-support` and re-export it
jieyouxu Feb 24, 2025
224f287
Fix `broken-pipe-no-ice` to not depend on unstable `anonymous_pipe` f…
jieyouxu Feb 24, 2025
c9c572c
Document that `rmake.rs`/`run-make-support` may not use unstable feat…
jieyouxu Feb 24, 2025
bbc80a8
Delay bug for negative auto trait rather than ICEing
compiler-errors Mar 7, 2025
06eecca
Allow anyone to relabel CI-spurious-*
thaliaarchi Mar 7, 2025
e0c2636
remove clones
matthiaskrgr Mar 7, 2025
19b6743
Rollup merge of #137337 - dalvescb:master, r=petrochenkov
jhpratt Mar 8, 2025
3b595aa
Rollup merge of #137363 - workingjubilee:untangle-x86-abi-impl, r=jie…
jhpratt Mar 8, 2025
9c82eaf
Rollup merge of #137537 - jieyouxu:daily-rmake, r=Kobzol
jhpratt Mar 8, 2025
4ec8407
Rollup merge of #137606 - davidtwco:next-edition, r=traviscross,ehuss
jhpratt Mar 8, 2025
8cac259
Rollup merge of #137957 - Noratrieb:no, r=wesleywiser
jhpratt Mar 8, 2025
8cf86cd
Rollup merge of #138000 - RalfJung:atomic-rmw, r=Amanieu
jhpratt Mar 8, 2025
f1051ed
Rollup merge of #138013 - Kobzol:ci-post-merge-analysis, r=marcoieni
jhpratt Mar 8, 2025
a29e3af
Rollup merge of #138033 - obi1kenobi:pg/json-attrs-tests, r=aDotInThe…
jhpratt Mar 8, 2025
b160477
Rollup merge of #138137 - ZequanWu:fix-triple, r=cuviper
jhpratt Mar 8, 2025
9aac24d
Rollup merge of #138173 - compiler-errors:incoherent-negative-impl, r…
jhpratt Mar 8, 2025
4306309
Rollup merge of #138184 - thaliaarchi:unauthenticated-ci-spurious, r=…
jhpratt Mar 8, 2025
dad4c8b
Rollup merge of #138187 - matthiaskrgr:rmclone, r=cjgillot
jhpratt Mar 8, 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
36 changes: 36 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow that runs after a merge to master, analyses changes in test executions
# and posts the result to the merged PR.

name: Post merge analysis

on:
push:
branches:
- master

jobs:
analysis:
runs-on: ubuntu-24.04
if: github.repository == 'rust-lang/rust'
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Perform analysis and send PR
run: |
# Get closest bors merge commit
PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`

# Find PR for the current commit
HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`

echo "Parent: ${PARENT_COMMIT}"
echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"

cd src/ci/citool

echo "Post-merge analysis result" > output.log
cargo run --release post-merge-analysis ${PARENT_COMMIT} ${{ github.sha }} >> output.log
cat output.log

gh pr comment ${HEAD_PR} -F output.log
11 changes: 11 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"

[[package]]
name = "os_pipe"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982"
dependencies = [
"libc",
"windows-sys 0.59.0",
]

[[package]]
name = "overload"
version = "0.1.1"
Expand Down Expand Up @@ -3050,6 +3060,7 @@ dependencies = [
"gimli 0.31.1",
"libc",
"object 0.36.7",
"os_pipe",
"regex",
"serde_json",
"similar",
Expand Down
29 changes: 10 additions & 19 deletions compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ mod llvm_enzyme {
let orig_annotatable: Annotatable = match item {
Annotatable::Item(ref mut iitem) => {
if !iitem.attrs.iter().any(|a| a.id == attr.id) {
iitem.attrs.push(attr.clone());
iitem.attrs.push(attr);
}
if !iitem.attrs.iter().any(|a| a.id == inline_never.id) {
iitem.attrs.push(inline_never.clone());
Expand All @@ -295,7 +295,7 @@ mod llvm_enzyme {
}
Annotatable::AssocItem(ref mut assoc_item, i @ Impl) => {
if !assoc_item.attrs.iter().any(|a| a.id == attr.id) {
assoc_item.attrs.push(attr.clone());
assoc_item.attrs.push(attr);
}
if !assoc_item.attrs.iter().any(|a| a.id == inline_never.id) {
assoc_item.attrs.push(inline_never.clone());
Expand All @@ -322,7 +322,7 @@ mod llvm_enzyme {
let d_annotatable = if is_impl {
let assoc_item: AssocItemKind = ast::AssocItemKind::Fn(asdf);
let d_fn = P(ast::AssocItem {
attrs: thin_vec![d_attr.clone(), inline_never],
attrs: thin_vec![d_attr, inline_never],
id: ast::DUMMY_NODE_ID,
span,
vis,
Expand All @@ -332,12 +332,8 @@ mod llvm_enzyme {
});
Annotatable::AssocItem(d_fn, Impl)
} else {
let mut d_fn = ecx.item(
span,
d_ident,
thin_vec![d_attr.clone(), inline_never],
ItemKind::Fn(asdf),
);
let mut d_fn =
ecx.item(span, d_ident, thin_vec![d_attr, inline_never], ItemKind::Fn(asdf));
d_fn.vis = vis;
Annotatable::Item(d_fn)
};
Expand Down Expand Up @@ -446,7 +442,7 @@ mod llvm_enzyme {

if primal_ret && n_active == 0 && x.mode.is_rev() {
// We only have the primal ret.
body.stmts.push(ecx.stmt_expr(black_box_primal_call.clone()));
body.stmts.push(ecx.stmt_expr(black_box_primal_call));
return body;
}

Expand All @@ -471,7 +467,7 @@ mod llvm_enzyme {
if primal_ret {
// We have both primal ret and active floats.
// primal ret is first, by construction.
exprs.push(primal_call.clone());
exprs.push(primal_call);
}

// Now construct default placeholder for each active float.
Expand Down Expand Up @@ -538,16 +534,11 @@ mod llvm_enzyme {
return body;
}
[arg] => {
ret = ecx.expr_call(
new_decl_span,
blackbox_call_expr.clone(),
thin_vec![arg.clone()],
);
ret = ecx.expr_call(new_decl_span, blackbox_call_expr, thin_vec![arg.clone()]);
}
args => {
let ret_tuple: P<ast::Expr> = ecx.expr_tuple(span, args.into());
ret =
ecx.expr_call(new_decl_span, blackbox_call_expr.clone(), thin_vec![ret_tuple]);
ret = ecx.expr_call(new_decl_span, blackbox_call_expr, thin_vec![ret_tuple]);
}
}
assert!(has_ret(&d_sig.decl.output));
Expand All @@ -567,7 +558,7 @@ mod llvm_enzyme {
let args: ThinVec<_> =
idents[1..].iter().map(|arg| ecx.expr_path(ecx.path_ident(span, *arg))).collect();
let self_expr = ecx.expr_self(span);
ecx.expr_method_call(span, self_expr, primal, args.clone())
ecx.expr_method_call(span, self_expr, primal, args)
} else {
let args: ThinVec<_> =
idents.iter().map(|arg| ecx.expr_path(ecx.path_ident(span, *arg))).collect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub fn inject(
Edition2018 => sym::rust_2018,
Edition2021 => sym::rust_2021,
Edition2024 => sym::rust_2024,
EditionFuture => sym::rust_future,
}])
.map(|&symbol| Ident::new(symbol, span))
.collect();
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,9 +1655,9 @@ impl<'a> Linker for AixLinker<'a> {
}
}

fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) {
fn link_dylib_by_name(&mut self, name: &str, verbatim: bool, _as_needed: bool) {
self.hint_dynamic();
self.link_or_cc_arg(format!("-l{name}"));
self.link_or_cc_arg(if verbatim { String::from(name) } else { format!("-l{name}") });
}

fn link_dylib_by_path(&mut self, path: &Path, _as_needed: bool) {
Expand All @@ -1668,7 +1668,7 @@ impl<'a> Linker for AixLinker<'a> {
fn link_staticlib_by_name(&mut self, name: &str, verbatim: bool, whole_archive: bool) {
self.hint_static();
if !whole_archive {
self.link_or_cc_arg(format!("-l{name}"));
self.link_or_cc_arg(if verbatim { String::from(name) } else { format!("-l{name}") });
} else {
let mut arg = OsString::from("-bkeepfile:");
arg.push(find_native_static_library(name, verbatim, self.sess));
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_hir_analysis/src/check/always_applicable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ pub(crate) fn check_negative_auto_trait_impl<'tcx>(
// be implemented here to handle non-ADT rigid types.
Ok(())
} else {
span_bug!(tcx.def_span(impl_def_id), "incoherent impl of negative auto trait");
Err(tcx.dcx().span_delayed_bug(
tcx.def_span(impl_def_id),
"incoherent impl of negative auto trait",
))
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) {
}

extern "C" void LLVMRustSetNormalizedTarget(LLVMModuleRef M,
const char *Triple) {
unwrap(M)->setTargetTriple(Triple::normalize(Triple));
const char *Target) {
#if LLVM_VERSION_GE(21, 0)
unwrap(M)->setTargetTriple(Triple(Triple::normalize(Target)));
#else
unwrap(M)->setTargetTriple(Triple::normalize(Target));
#endif
}

extern "C" void LLVMRustPrintPassTimings(RustStringRef OutBuf) {
Expand Down
29 changes: 27 additions & 2 deletions compiler/rustc_span/src/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,27 @@ pub enum Edition {
Edition2021,
/// The 2024 edition
Edition2024,
/// The future edition - this variant will always exist and features associated with this
/// edition can be moved to the next 20XX edition when it is established and it is confirmed
/// that those features will be part of that edition.
///
/// This variant allows edition changes to be implemented before being assigned to a concrete
/// edition - primarily when there are two different unstable behaviours that need tested across
/// an edition boundary.
///
/// This edition will be permanently unstable and any features associated with this edition
/// must also be behind a feature gate.
EditionFuture,
}

// Must be in order from oldest to newest.
pub const ALL_EDITIONS: &[Edition] =
&[Edition::Edition2015, Edition::Edition2018, Edition::Edition2021, Edition::Edition2024];
pub const ALL_EDITIONS: &[Edition] = &[
Edition::Edition2015,
Edition::Edition2018,
Edition::Edition2021,
Edition::Edition2024,
Edition::EditionFuture,
];

pub const EDITION_NAME_LIST: &str = "2015|2018|2021|2024";

Expand All @@ -42,6 +58,7 @@ impl fmt::Display for Edition {
Edition::Edition2018 => "2018",
Edition::Edition2021 => "2021",
Edition::Edition2024 => "2024",
Edition::EditionFuture => "future",
};
write!(f, "{s}")
}
Expand All @@ -54,6 +71,7 @@ impl Edition {
Edition::Edition2018 => "rust_2018_compatibility",
Edition::Edition2021 => "rust_2021_compatibility",
Edition::Edition2024 => "rust_2024_compatibility",
Edition::EditionFuture => "edition_future_compatibility",
}
}

Expand All @@ -63,6 +81,7 @@ impl Edition {
Edition::Edition2018 => true,
Edition::Edition2021 => true,
Edition::Edition2024 => true,
Edition::EditionFuture => false,
}
}

Expand All @@ -85,6 +104,11 @@ impl Edition {
pub fn at_least_rust_2024(self) -> bool {
self >= Edition::Edition2024
}

/// Are we allowed to use features from the future edition?
pub fn at_least_edition_future(self) -> bool {
self >= Edition::EditionFuture
}
}

impl FromStr for Edition {
Expand All @@ -95,6 +119,7 @@ impl FromStr for Edition {
"2018" => Ok(Edition::Edition2018),
"2021" => Ok(Edition::Edition2021),
"2024" => Ok(Edition::Edition2024),
"future" => Ok(Edition::EditionFuture),
_ => Err(()),
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,7 @@ symbols! {
rust_cold_cc,
rust_eh_catch_typeinfo,
rust_eh_personality,
rust_future,
rust_logo,
rust_out,
rustc,
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_target/src/callconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ mod sparc64;
mod wasm;
mod x86;
mod x86_64;
mod x86_win32;
mod x86_win64;
mod xtensa;

Expand Down Expand Up @@ -649,7 +650,11 @@ impl<'a, Ty> FnAbi<'a, Ty> {
};
let reg_struct_return = cx.x86_abi_opt().reg_struct_return;
let opts = x86::X86Options { flavor, regparm, reg_struct_return };
x86::compute_abi_info(cx, self, opts);
if spec.is_like_msvc {
x86_win32::compute_abi_info(cx, self, opts);
} else {
x86::compute_abi_info(cx, self, opts);
}
}
"x86_64" => match abi {
ExternAbi::SysV64 { .. } => x86_64::compute_abi_info(cx, self),
Expand Down
24 changes: 2 additions & 22 deletions compiler/rustc_target/src/callconv/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where
if t.abi_return_struct_as_int || opts.reg_struct_return {
// According to Clang, everyone but MSVC returns single-element
// float aggregates directly in a floating-point register.
if !t.is_like_msvc && fn_abi.ret.layout.is_single_fp_element(cx) {
if fn_abi.ret.layout.is_single_fp_element(cx) {
match fn_abi.ret.layout.size.bytes() {
4 => fn_abi.ret.cast_to(Reg::f32()),
8 => fn_abi.ret.cast_to(Reg::f64()),
Expand Down Expand Up @@ -64,31 +64,11 @@ where
continue;
}

// FIXME: MSVC 2015+ will pass the first 3 vector arguments in [XYZ]MM0-2
// See https://reviews.llvm.org/D72114 for Clang behavior

let t = cx.target_spec();
let align_4 = Align::from_bytes(4).unwrap();
let align_16 = Align::from_bytes(16).unwrap();

if t.is_like_msvc
&& arg.layout.is_adt()
&& let Some(max_repr_align) = arg.layout.max_repr_align
&& max_repr_align > align_4
{
// MSVC has special rules for overaligned arguments: https://reviews.llvm.org/D72114.
// Summarized here:
// - Arguments with _requested_ alignment > 4 are passed indirectly.
// - For backwards compatibility, arguments with natural alignment > 4 are still passed
// on stack (via `byval`). For example, this includes `double`, `int64_t`,
// and structs containing them, provided they lack an explicit alignment attribute.
assert!(
arg.layout.align.abi >= max_repr_align,
"abi alignment {:?} less than requested alignment {max_repr_align:?}",
arg.layout.align.abi,
);
arg.make_indirect();
} else if arg.layout.is_aggregate() {
if arg.layout.is_aggregate() {
// We need to compute the alignment of the `byval` argument. The rules can be found in
// `X86_32ABIInfo::getTypeStackAlignInBytes` in Clang's `TargetInfo.cpp`. Summarized
// here, they are:
Expand Down
Loading
Loading