-
Notifications
You must be signed in to change notification settings - Fork 14k
Rollup of 8 pull requests #149011
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
base: main
Are you sure you want to change the base?
Rollup of 8 pull requests #149011
Conversation
…imulacrum use funnel shift as fallback impl for rotating shifts That lets us remove this gnarly implementation from Miri and const-eval. However, `rotate_left`/`rotate_right` are stable as const fn, so to do this we have to `rustc_allow_const_fn_unstable` a bunch of const trait stuff. Is that a bad idea? Cc `@oli-obk` `@fee1-dead`
add larger test for `proc_macro` `FromStr` implementations Currently, there are only few tests that check the output of `TokenStream::from_str` and `Literal::from_str` (which is somewhat understandable as the rustc implementation just delegates these calls to the parser). In preparation for both the standalone backend (rust-lang#130856) which will probably need to reimplement this logic as well as for removing panics from these functions (rust-lang#58736), this PR adds a test which shows the various messy ways of how these functions report errors and the return values for successful parses. Followup PRs such as rust-lang#147859 will change more and more of these "diagnostic + error"s into `LexErrors`. The test structure with the extra module is used to allow reusing it later easily for the standalone backend.
…r=scottmcm Constify `ManuallyDrop::take` Feature: `const_manually_drop_take` Tracking issue: rust-lang#148773 This PR constifies `ManuallyDrop::take`.
Constify `mem::take` Feature: `const_default` (rust-lang#143894)
Error if an autodiff user does not set lto=fat Based on your feedback, I started to provide a nice error message for a lack of `lto=fat`, instead of us forcing it. In a next step, we should replace `RUSTFLAGS="-Zautodiff=Enable"` with another Cargo.toml setting, as discussed here: rust-lang#147487 (comment) As another improvement, we should also figure out why rlib builds do not properly obey the fat=lto setting. ````@bjorn3````
add note to `lines` docs about empty str behavior This pull request adds a short note to the documentation for `str::lines` that describes the behavior of the resulting iterator when called on an empty string. I tripped over this a few days ago because I thought (incorrectly) that the iterator would return a single line with an empty string. I don't doubt that the actual behavior (return no lines) is the correct behavior, but in the absence of explicit documentation describing it, I came to the wrong conclusion about it and maybe others will too. If this is so obvious as to be not worth including, I'm happy to withdraw the pull request! Thanks for taking a look.
… r=jieyouxu compiletest: Avoid race condition in file deletion Fixes rust-lang#149003 There is a TOCTOU when multiple threads attempt to delete the same file. Instead of pre-checking if the file exists, we can simply ignore `NotFound` errors.
…ouxu triagebot: remove jsha from notifications for rustdoc HTML See rust-lang/team#2083 - I'm moving to alumni status for rustdoc and no longer need these notifications.
|
Error: Label rollup can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This is a rollup PR that merges 8 separate pull requests into the main Rust repository, covering various improvements and fixes across testing, intrinsics, documentation, and the autodiff feature.
- Implements funnel shift as fallback for rotation operations
- Adds comprehensive test coverage for
proc_macroFromStrimplementations - Makes
ManuallyDrop::takeandmem::takeconst functions - Enforces LTO=fat requirement for autodiff usage with proper error messages
- Improves documentation for
str::linesand rotation methods - Fixes race condition in compiletest file deletion
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| triagebot.toml | Removes @jsha from HTML/CSS/JS change notifications |
| tests/ui/proc-macro/* | Adds new comprehensive test files for proc_macro parsing behavior |
| tests/ui/autodiff/no_lto_flag.rs | Adds test to verify autodiff requires lto=fat configuration |
| tests/ui/autodiff/no_lto_flag.no_lto.stderr | Expected error output for autodiff without fat LTO |
| tests/codegen-llvm/intrinsics/rotate_left.rs | Updates test expectations with noundef and optimization flags |
| src/tools/compiletest/src/runtest.rs | Fixes race condition by handling NotFound errors in file deletion |
| library/core/src/str/mod.rs | Adds documentation clarifying empty string behavior for lines() |
| library/core/src/num/uint_macros.rs | Adds rotation documentation and rustc attributes for const trait impl |
| library/core/src/num/int_macros.rs | Adds rotation documentation for signed integers |
| library/core/src/mem/mod.rs | Makes mem::take const with const Default trait bound |
| library/core/src/mem/manually_drop.rs | Makes ManuallyDrop::take const |
| library/core/src/intrinsics/mod.rs | Implements rotate_left/right using funnel shift fallback |
| compiler/rustc_session/src/session.rs | Removes automatic fat-lto setting for autodiff |
| compiler/rustc_const_eval/src/interpret/intrinsics.rs | Removes rotate_left/right interpreter implementation (now uses fallback) |
| compiler/rustc_codegen_llvm/src/intrinsic.rs | Adds LTO check for autodiff and simplifies funnel shift handling |
| compiler/rustc_codegen_llvm/src/errors.rs | Adds AutoDiffWithoutLto error struct |
| compiler/rustc_codegen_llvm/messages.ftl | Adds error message for autodiff without LTO |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successful merges:
proc_macroFromStrimplementations #148505 (add larger test forproc_macroFromStrimplementations)ManuallyDrop::take#148752 (ConstifyManuallyDrop::take)mem::take#148757 (Constifymem::take)linesdocs about empty str behavior #148912 (add note tolinesdocs about empty str behavior)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup