Rollup of 12 pull requests#155851
Conversation
Targets that set `requires_lto = true` were not actually using lto when compiling with cargo by default. They needed an extra `lto = true` in `Cargo.toml` to work. Fix this by letting lto take precedence over the `embed_bitcode` flag when lto is required by a target. If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user.
- Follow UEFI Shell search flow to search for programs while launching. - Tested using OVMF on QEMU. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Commit cb37ee2 ("make field representing types invariant over the base type") made the auto-trait impl work even if `T: !Send` or `T: !Sync` thus we can remove these explicit unsafe impls while FRTs still implement `Send` and `Sync`.
Using the reflection experiment, we can print the actual names of the field that an FRT is referring to. In case this breaks, there is an alternative implementation in the note comment.
Eliminate `cursor` and `ibuf` as named variables, as their presence makes things more confusing.
`mk_place_elem` appends a single `PlaceElem` to an existing (interned) projection. The current implementation copies the projection into a fresh `Vec`, pushes the new element, and re-interns the slice, which allocates on the heap on every call. Feed the elements through `mk_place_elems_from_iter` so that `CollectAndApply`'s hand-unrolled stack fast path (up to 9 elements, in `rustc_type_ir::interner`) kicks in for the common case of short projections and the `Vec` allocation is skipped entirely. The behavior is identical for longer projections (the fast path falls back to a `Vec` internally).
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
* Fix heap overflow in slice join via inconsistent Borrow * Update library/alloc/src/str.rs Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Fix requires_lto targets needing lto set in cargo Targets that set `requires_lto = true` were not actually using lto when compiling with cargo by default. They needed an extra `lto = true` in `Cargo.toml` to work. Fix this by letting lto take precedence over the `embed_bitcode` flag when lto is required by a target. If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user. Fixes rust-lang#148514 Tracking issue: rust-lang#135024
…lacrum `std::io::Take`: Clarify & optimize `BorrowedBuf::set_init` usage. Don't initialize `buf` if it was already initialized. Clarify safety comments. Move the `buf.advance()` call to make the initialization more like calling `buf.ensure_init()`, then clarify how the code here is an optimized variant of `ensure_init`.
…crum Make Rcs and Arcs use pointer comparison for unsized types `Rc` and `Arc`s have an `Eq` implementation that first attempt to compare the pointers as an optimization. This, however, was not extended to DSTs, which is what this PR fixes. Fixes rust-lang#154998.
…ulacrum Implement more traits for FRTs From rust-lang#154927 (comment). FRTs now implement the following traits: `Sized + Freeze + RefUnwindSafe + Send + Sync + Unpin + UnsafeUnpin + UnwindSafe + Copy + Debug + Default + Eq + Hash + Ord`. Let me know if there is any trait missing. I also removed the explicit `Send` and `Sync` impls, since commit cb37ee2 ("make field representing types invariant over the base type") made the auto-trait impl work even if `T: !Send` or `T: !Sync`. Very happy to see unsafe impls get dropped :) Note that I used the reflection feature (cc @oli-obk) to print the actual field names in the debug implementation. I think this is a cool way to use it, but if it isn't ready for that, I'm happy to change it to the alternative implementation I gave in the note comment (it's essentially Mark's suggestion but printing `T`'s name instead of `Self`'s). Since this is a library change, I'll give this to Mark; feel free to also take a look/leave comments, Oli :) r? @Mark-Simulacrum
…ulacrum Fix heap overflow in slice::join caused by misbehaving Borrow This code allocates a buffer using lengths calculated by calling `.borrow()` on some slices, and then copies them over after again calling `.borrow()`. There is no safety-reliable guarantee that these will return the same slices. While this code calls `.borrow()` three times, only one of them is problematic: the others already use checked indexing. I made the test a normal library test, but let me know if it should go elsewhere. Bug discovered by Rust Foundation Security using AI. I'm just helping with the patch as a member of wg-security-response. We do not believe this bug needs embargo, it is a soundness fix for hard-to-trigger unsoundness.
…id-vec-alloc, r=cjgillot,JohnTitor Avoid Vec allocation in TyCtxt::mk_place_elem `mk_place_elem` appends a single `PlaceElem` to an existing (interned) projection. The current implementation copies the projection into a fresh `Vec`, pushes the new element, and re-interns the slice, which allocates on every call. Feed the elements through `mk_place_elems_from_iter` so that `CollectAndApply`'s hand-unrolled stack fast path (up to 9 elements, in `rustc_type_ir::interner`) kicks in for the common case of short projections and the `Vec` allocation is skipped entirely. The behavior is identical for longer projections (the fast path falls back to a `Vec` internally).
…,nicholasbishop std: sys: process: uefi: Add program searching - Follow UEFI Shell search flow to search for programs while launching. - Tested using OVMF on QEMU. @rustbot label +O-UEFI
Add boxing suggestions for `impl Trait` return type mismatches A sort of a follow up pr to this -> rust-lang#155546
…re-return-note, r=wesleywiser Avoid misleading closure return type note Fixes rust-lang#155670
…=mejrs Convert attribute `FinalizeFn` to fn pointer
rustc_attr_parsing: use a `try {}` in `or_malformed`
… r=wesleywiser couple of `crate_name` cleanups Split out from rust-lang#153924; these changes should be uncontroversial.
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
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 ca9a134 (parent) -> 4933094 (this PR) Test differencesShow 117 test diffsStage 1
Stage 2
Additionally, 98 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 4933094f25ba1edf2de0a203665976832fc85bc9 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
📌 Perf builds for each rolled up PR:
previous master: ca9a134e09 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (4933094): comparison URL. Overall result: ❌ regressions - 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)Results (primary 0.5%, secondary -1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 5.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 488.117s -> 488.817s (0.14%) |
Successful merges:
std::io::Take: Clarify & optimizeBorrowedBuf::set_initusage. #155317 (std::io::Take: Clarify & optimizeBorrowedBuf::set_initusage.)impl Traitreturn type mismatches #155682 (Add boxing suggestions forimpl Traitreturn type mismatches)FinalizeFnto fn pointer #155818 (Convert attributeFinalizeFnto fn pointer)try {}inor_malformed#155829 (rustc_attr_parsing: use atry {}inor_malformed)crate_namecleanups #155835 (couple ofcrate_namecleanups)r? @ghost
Create a similar rollup