Skip to content

Rollup of 8 pull requests #138185

New issue

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

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

Already on GitHub? # to your account

Closed

Conversation

compiler-errors
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Curtis D'Alves and others added 22 commits February 20, 2025 14:31
This will help stabilization of lld.
While it shares more than zero code with the SysV x86-32 ABI impl,
there is no particular reason to organize wildly different ABIs
using if-else in the same function.
For the tests that make use of internal implementation details, we
include the module to test using #[path] in alloctests now.
…=cuviper

Put the alloc unit tests in a separate alloctests package

Same rationale as rust-lang#135937. This PR has some extra complexity though as a decent amount of tests are testing internal implementation details rather than the public api. As such I opted to include the modules containing the types under test using `#[path]` into the alloctests package. This means that those modules still need `#[cfg(test)]`, but the rest of liballoc no longer need it.
Add verbatim linker to AIXLinker

This adds support for the "verbatim" native link modifier on AIX, will successfully pass the `native-link-modifier-verbatim-linker test case`
…pl, r=jieyouxu

compiler: factor Windows x86-32 ABI impl into its own file

While it shares more than zero code with the SysV x86-32 ABI impl, there is no particular reason to organize wildly different ABIs using if-else in the same function.
self-contained linker: conservatively default to `-znostart-stop-gc` on x64 linux

To help stabilization, this PR disables an LLD optimization on  x64 linux with respect to `--gc-sections` and encapsulation symbols: it will reduce the number of crates needing to opt-out of lld due to this bfd / lld difference. For example, all the people using [linkme](https://github.com/dtolnay/linkme), which [doesn't work with lld](dtolnay/linkme#63) or on nightly, need to disable lld.

More information about all this, and the historical differences, can be found in:
- https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
- https://lld.llvm.org/ELF/start-stop-gc

This optimization has [no visible impact](rust-lang#137685 (comment)) on our benchmarks, so we can use it by default and have a safer/more conservative starting point to remove friction during migration. We can them emit an FCW for the cases where lld detects reliance on encapsulation symbols without `-znostart-stop-gc`, and then revert back to lld's default after a while. No one compiling on nightly relies on this difference, obviously, so doing an FCW is not necessary until after lld is used on stable.

I've tested that this correctly links on `linkme` examples. I've also quickly tried to crate an rmake test but the setup with encapsulation symbols is annoying to reproduce: a few link section/name attributes is not enough, we also need to collect symbols between the encapsulation symbols, without referencing them in code, for `-znostart-stop-gc` to only impact this... It should of course be doable though, maybe ```@Kobzol``` will look into it if they have time.

r? ```@petrochenkov```
atomic: clarify that failing conditional RMW operations are not 'writes'

Fixes rust-lang#136669

r? `@Amanieu`
Cc `@rust-lang/opsem` `@chorman0773` `@gnzlbg` `@briansmith`
…tty, r=jdonszelmann

Improve `-Zunpretty=hir` for parsed attrs

0. Rename `print_something` to `should_render` to make it distinct from `print_attribute` in that it doesn't print anything, it's just a way to probe if a type renders anything.
1. Fixes a few bugs in the `PrintAttribute` derive. Namely, the `__printed_anything` variable was entangled with the `should_render` call, leading us to always render field names but never render commas.
2. Remove the outermost `""` from the attr.
3. Debug print `Symbol`s. I know that this is redundant for some parsed attributes, but there's no good way to distinguish symbols that are ident-like and symbols which are cooked string literals. We could perhaps *conditionally* to fall back to a debug printing if the symbol doesn't match an ident? But seems like overkill.

Based on rust-lang#138060, only review the commits not in that one.
setTargetTriple now accepts Triple rather than string

llvm/llvm-project#129868 updated `setTargetTriple`
…e-impl, r=oli-obk

Delay bug for negative auto trait rather than ICEing

Fixes rust-lang#138149

r? oli-obk
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Mar 7, 2025
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Collaborator

bors commented Mar 7, 2025

📌 Commit 92e7038 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 7, 2025
@bors
Copy link
Collaborator

bors commented Mar 7, 2025

⌛ Testing commit 92e7038 with merge f8dca5c...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 7, 2025
…mpiler-errors

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136642 (Put the alloc unit tests in a separate alloctests package)
 - rust-lang#137337 (Add verbatim linker to AIXLinker)
 - rust-lang#137363 (compiler: factor Windows x86-32 ABI impl into its own file)
 - rust-lang#137685 (self-contained linker: conservatively default to `-znostart-stop-gc` on x64 linux)
 - rust-lang#138000 (atomic: clarify that failing conditional RMW operations are not 'writes')
 - rust-lang#138063 (Improve `-Zunpretty=hir` for parsed attrs)
 - rust-lang#138137 (setTargetTriple now accepts Triple rather than string)
 - rust-lang#138173 (Delay bug for negative auto trait rather than ICEing)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18-3 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [pretty] tests/pretty/fn-types.rs ... ok
test [pretty] tests/pretty/format-args-str-escape.rs ... ok
test [pretty] tests/pretty/fn-variadic.rs ... ok
test [pretty] tests/pretty/gat-bounds.rs ... ok
2025-03-08T00:20:20.312181Z ERROR compiletest::runtest: fatal error, panic: "pretty-printed source does not match expected source\nexpected:\n------------------------------------------\n#[prelude_import]\nuse ::std::prelude::rust_2015::*;\n#[macro_use]\nextern crate std;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-pretty-attr.pp\n\n#[attr=\"Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])\")]\nstruct Example {\n}\n\n------------------------------------------\nactual:\n------------------------------------------\n#[prelude_import]\nuse ::std::prelude::rust_2015::*;\n#[macro_use]\nextern crate std;\n//@ pretty-compare-only\n//@ pretty-mode:hir\n//@ pp-exact:hir-pretty-attr.pp\n\n#[attr = Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])]\nstruct Example {\n}\n\n------------------------------------------\ndiff:\n------------------------------------------\n6\t//@ pretty-mode:hir\n7\t//@ pp-exact:hir-pretty-attr.pp\n8\t\n-\t#[attr=\"Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])\")]\n+\t#[attr = Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])]\n10\tstruct Example {\n11\t}\n12\t\n\n\n"
test [pretty] tests/pretty/hir-pretty-attr.rs ... FAILED
test [pretty] tests/pretty/for-comment.rs ... ok
test [pretty] tests/pretty/hir-pretty-loop.rs ... ok
test [pretty] tests/pretty/issue-12590-a.rs ... ok
---
------------------------------------------
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-pretty-attr.pp

#[attr="Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])")]
}

------------------------------------------
actual:
actual:
------------------------------------------
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-pretty-attr.pp

#[attr = Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])]
}

------------------------------------------
diff:
diff:
------------------------------------------
6 //@ pretty-mode:hir
7 //@ pp-exact:hir-pretty-attr.pp
8 
- #[attr="Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])")]
+ #[attr = Repr([ReprC, ReprPacked(Align(4 bytes)), ReprTransparent])]
11 }
12 


@bors
Copy link
Collaborator

bors commented Mar 8, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 8, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants