-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Rollup of 9 pull requests #147782
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 9 pull requests #147782
Conversation
As part of work to add stdlib support for Motor OS.
Motor OS was added as a no-std Tier-3 target in rust-lang#146848 as x86_64-unknown-motor. This patch/PR adds the std library for Motor OS. While the patch may seem large, all it does is proxy std pal calls to moto-rt. When there is some non-trivial code (e.g. thread::spawn), it is quite similar, and often identical, to what other platforms do.
Refactor contract HIR lowering to ensure no contract code is executed when contract-checks are disabled. The call to contract_checks is moved to inside the lowered fn body, and contract closures are built conditionally, ensuring no side-effects present in contracts occur when those are disabled.
This allows the optimiser to properly eliminate contract code when runtime contract checks are disabled. It comes at the cost of having to recompile upstream crates (e.g. std) to enable contracts in them. However, this trade off is acceptable if it means disabled runtime contract checks do not affect the runtime performance of the functions they annotate. With the proper elimination of contract code, which this change introduces, the runtime performance of annotated functions should be the same as the original unannotated function.
The contract_checks compiler flag is now used to determine if runtime contract checks should be enabled, as opposed to the compiler intrinsic as previously.
The compiler complained about uncecessary parenthesis on contract clauses, which were insterted by the contract macros. This commit changes the macro to use braces as the delimiter instead, fixing the issue.
These tests capture the behaviour that the decision to include/exclude runtime contract assertions is determined on a per-crate basis, i.e. by the flags used to compile each crate.
use check_nondet helper in a few more places
native-lib: support all types with Scalar layout
This updates the rust-version file to 235a4c0.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 235a4c0 Filtered ref: 548dcbbeab7592100a0ba9f2338ddc8ad1003824 Upstream diff: rust-lang/rust@36e4f5d...235a4c0 This merge was created using https://github.com/rust-lang/josh-sync.
Automatic Rustup
don't debug-print an Any
native-lib: bump libffi
This updates the rust-version file to 28d0a4a.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 28d0a4a Filtered ref: 310e49750b70768361f78966c10be9716a300784 Upstream diff: rust-lang/rust@235a4c0...28d0a4a This merge was created using https://github.com/rust-lang/josh-sync.
A grep for `const_usize.*align` found the same code copied to rustc_codegen_gcc but I don't see other cases where we get this wrong.
It's a synonym for `u64` and there are a couple of places where we use `u64` where we should use `Word`, which this commit fixes. I found this when I tried changing `Word` to `u128` (which made performance worse).
…ss35 std: Add Motor OS std library port Motor OS was added as a no-std Tier-3 target in [PR 146848](rust-lang#146848) as x86_64-unknown-motor. This PR adds the std library for Motor OS. While the PR may seem large, all it does is proxy std pal calls to [moto-rt](https://crates.io/crates/moto-rt). Where there is some non-trivial code (e.g. thread::spawn), it is quite similar, often identical, to what other platforms do.
…nnethercote,RalfJung Fix ICE on offsetted ZST pointer I'm not sure this is the *right* fix, but it's simple enough and does roughly what I'd expect. Like with the previous optimization to codegen usize rather than a zero-sized static, there's no guarantee that we continue returning a particular value from the offsetting. A grep for `const_usize.*align` found the same code copied to rustc_codegen_gcc and cranelift but a quick skim didn't find other cases of similar 'optimization'. That said, I'm not convinced I caught everything, it's not trivial to search for this. Closes rust-lang#147516
remove duplicate inline macro
Don't highlight `let` expressions as having type `bool` in let-chain error messages Fixes rust-lang#147665.
miri subtree update Subtree update of `miri` to rust-lang/miri@50ba3a7. Created using https://github.com/rust-lang/josh-sync. r? ``````@ghost``````
Use `bit_set::Word` in a couple more places. It's a synonym for `u64` and there are a couple of places where we use `u64` where we should use `Word`, which this commit fixes. I found this when I tried changing `Word` to `u128` (which made performance worse). r? `````@Zalathar`````
…kang style-guide: fix typo for empty struct advice the advice appears to apply to empty structs with braces (parens/blocks), and a unit struct in the comment does not make sense. Fix the typo.
…ratrieb `is_ascii` on an empty string or slice returns true Update the description of the [`is_ascii`](https://doc.rust-lang.org/std/primitive.str.html#method.is_ascii) functions - an empty string or slice also returns `true`. This follows the pattern of [`all()`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.all). Clippy currently suggests to change `string.chars().all(|c| c.is_ascii())` into `string.is_ascii()`. This suggestion therefore seems fitting. I've already questioned the behavior for this multiple times. I've always had to check the internals to conclude how it works. That's why I'm opening this PR to add it directly in the documentation.
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 779e19d8ba In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 779e19d (parent) -> 53a741f (this PR) Test differencesShow 514 test diffsStage 1
Stage 2
Additionally, 492 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 53a741fc4b8cf2d8e7b1b2336ed8edf889db84f4 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (53a741f): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary 3.0%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 474.369s -> 475.105s (0.16%) |
Successful merges:
contract_checks
#144438 (Guard HIR lowered contracts withcontract_checks
)let
expressions as having typebool
in let-chain error messages #147738 (Don't highlightlet
expressions as having typebool
in let-chain error messages)bit_set::Word
in a couple more places. #147751 (Usebit_set::Word
in a couple more places.)is_ascii
on an empty string or slice returns true #147773 (is_ascii
on an empty string or slice returns true)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup