-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 7 pull requests #92587
Rollup of 7 pull requests #92587
Conversation
The src pointers in CopyOnDrop and InsertionHole used to be *mut T, and were derived via automatic conversion from &mut T. According to Stacked Borrows 2.1, this means that those pointers become invalidated by interior mutation in the comparison function. But there's no need for mutability in this code path. Thus, we can change the drop guards to use *const and derive those from &T.
Add comment about why `LocalDefId` should not be `Ord` Also fix some formatting in the doc comment.
Update library/core/src/hint.rs Co-authored-by: Amanieu d'Antras <amanieu@gmail.com> Remove redundant config gate
This makes it more uniform with other expanded nodes
…elhenrymantilla Drop guards in slice sorting derive src pointers from &mut T, which is invalidated by interior mutation in comparison I tried to run https://github.com/rust-lang/miri-test-libstd on `alloc` with `-Zmiri-track-raw-pointers`, and got a failure on the test `slice::panic_safe`. The test failure has nothing to do with panic safety, it's from how the test tests for panic safety. I minimized the test failure into this very silly program: ```rust use std::cell::Cell; use std::cmp::Ordering; #[derive(Clone)] struct Evil(Cell<usize>); fn main() { let mut input = vec![Evil(Cell::new(0)); 3]; // Hits the bug pattern via CopyOnDrop in core input.sort_unstable_by(|a, _b| { a.0.set(0); Ordering::Less }); // Hits the bug pattern via InsertionHole in alloc input.sort_by(|_a, b| { b.0.set(0); Ordering::Less }); } ``` To fix this, I'm just removing the mutability/uniqueness where it wasn't required.
Fix a minor mistake in `String::try_reserve_exact` examples The examples of `String::try_reserve_exact` didn't actually use `try_reserve_exact`, which was probably a minor mistake, and this PR fixed it.
…n1011 Add negative `impl` for `Ord`, `PartialOrd` on `LocalDefId` Suggested in rust-lang#92233 (comment). This also fixes some formatting in the doc comment. r? `@cjgillot`
Stabilize `result_cloned` and `result_copied` Tracking issue: rust-lang#63168 The FCP is now completed.
…manieu Add RISC-V detection macro and more architecture instructions This pull request includes: - Update `stdarch` dependency to include ratified RISC-V supervisor and hypervisor instruction intrinsics which is useful in Rust kernel development - Add macro `is_riscv_feature_detected!` - Modify impl of `core::hint::spin_loop` to comply with latest version of `core::arch` After this update, users may now develop RISC-V kernels and user applications more freely. r? `@Amanieu`
ast: Always keep a `NodeId` in `ast::Crate` This makes it more uniform with other expanded nodes. It makes generic code in rust-lang#92573 simpler in particular. This is another follow-up to rust-lang#91313. r? `@Aaron1011`
…=lnicola ⬆️ rust-analyzer r? `@ghost`
@bors r+ rollup=never p=7 |
📌 Commit 439a125 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f1ce0e6): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Successful merges:
String::try_reserve_exact
examples #92388 (Fix a minor mistake inString::try_reserve_exact
examples)impl
forOrd
,PartialOrd
onLocalDefId
#92442 (Add negativeimpl
forOrd
,PartialOrd
onLocalDefId
)result_cloned
andresult_copied
#92483 (Stabilizeresult_cloned
andresult_copied
)NodeId
inast::Crate
#92575 (ast: Always keep aNodeId
inast::Crate
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup