Skip to content
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

Merged
merged 14 commits into from
Jan 5, 2022
Merged

Rollup of 7 pull requests #92587

merged 14 commits into from
Jan 5, 2022

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

saethlin and others added 14 commits December 18, 2021 20:02
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`
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 5, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Jan 5, 2022

📌 Commit 439a125 has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 5, 2022
@bors
Copy link
Contributor

bors commented Jan 5, 2022

⌛ Testing commit 439a125 with merge f1ce0e6...

@bors
Copy link
Contributor

bors commented Jan 5, 2022

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing f1ce0e6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 5, 2022
@bors bors merged commit f1ce0e6 into rust-lang:master Jan 5, 2022
@rustbot rustbot added this to the 1.59.0 milestone Jan 5, 2022
@rust-timer
Copy link
Collaborator

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

@matthiaskrgr matthiaskrgr deleted the rollup-qnwa8qx branch February 13, 2022 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.