Rollup of 9 pull requests - #163467
Closed
tgross35 wants to merge 29 commits into
Closed
Rollup of 9 pull requests#163467tgross35 wants to merge 29 commits into
tgross35 wants to merge 29 commits into
Conversation
`funnel_shl` and `funnel_shr` have been around for close to a year, the
unchecked versions for a number of months. These are reasonably small
and uncontroversial, and it can be tricky to get similar performance
with a fallback; stabilize them here.
Newly stable API:
impl {u8, u16, u32, u64, u128, usize} {
pub const fn funnel_shl(self, right: Self, shift: u32) -> Self;
pub const fn funnel_shr(self, right: Self, shift: u32) -> Self;
pub const unsafe fn unchecked_funnel_shl(self, right: Self, shift: u32) -> Self;
pub const unsafe fn unchecked_funnel_shr(self, right: Self, shift: u32) -> Self;
}
The tracking issue also mentions a `wrapping_` version but it has not
been implemented.
Tracking issue: RUST-145686
For production use, we should only link in the ubsan_minimal runtime, instead of the complete ubsan runtime. This adds support for both cfi-recover and cfi-diag to use the minimal runtime when `-Zsanitizer-cfi-minimal-runtime` is specified. This also includes tests, to ensure the flag can only be used if either cfi-recover or cfi-diag is enabled, it doesn't disrupt the original behavior, and links in the correct runtime when specified. Co-Authored-By: Bastian Kersting <bkersting@google.com>
Co-Authored-By: Bastian Kersting <bkersting@google.com>
Only check `SanitizerCfiMinimalRuntimeRequiresCfiRecoverOrDiag` if CFI is actually enabled. Use `is_sanitizer_cfi_minimal_runtime_enabled()` helper within `link.rs`.
Tracking issue: rust-lang#61695
…r=nia-e
Stabilize `funnel_shifts` (including `const`)
`funnel_shl` and `funnel_shr` have been around for close to a year, the unchecked versions for a number of months. These are reasonably small and uncontroversial, and it can be tricky to get similar performance with a fallback; stabilize them here.
Newly stable API:
```rust
impl {u8, u16, u32, u64, u128, usize} {
pub const fn funnel_shl(self, right: Self, shift: u32) -> Self;
pub const fn funnel_shr(self, right: Self, shift: u32) -> Self;
pub const unsafe fn unchecked_funnel_shl(self, right: Self, shift: u32) -> Self;
pub const unsafe fn unchecked_funnel_shr(self, right: Self, shift: u32) -> Self;
}
```
The tracking issue also mentions a `wrapping_` version but it has not been implemented.
Closes: rust-lang#145686 (tracking issue, wrapping versions will need a new issue)
Stabilize `Result::into_{ok,err}`
Tracking issue: rust-lang#61695
---
As evidence of the demand of this API, here are some instances of people having written functions for this functionality:
* https://github.com/meteroid-oss/meteroid/blob/6cc14c4a444c6ae4889c603f5cb275ea626d7507/crates/common-utils/src/misc.rs#L7
* https://github.com/mokeyish/smartdns-rs/blob/788e83fa72477ebcf1c6a7f4482359353d29c480/src/server/http.rs#L93
* https://github.com/nostrdevkit/nostr/blob/ea38c0e3b2fc2717a4a55d019560a5574baf8cd0/nostr/src/util/mod.rs#L120
* https://github.com/ngrok/ngrok-rust/blob/3d5131559948ba9932dd0a450474fd1d19d206eb/ngrok/examples/tls.rs#L92
* https://github.com/octopii-rs/octopii/blob/b54c112d7db7ed1195dd4f600b4b786df85c8e7e/openraft/openraft/src/error/into_ok.rs#L10
* https://github.com/TeXitoi/keyseebee/blob/30956f62e618ed754c15af66f8ade70269fef89a/firmware/src/main.rs#L54
---
API being stabilized:
```rust
impl<T, E> Result<T, E> {
pub fn into_ok(self) -> T
where
E: Into<!>
{ .... }
pub fn into_err(self) -> E
where
T: Into<!>,
{ .... }
}
```
---
Implementation history: (I'm including only ones that touches the public API being stabilized, and not documentation or constification)
* rust-lang/rfcs#2799
* rust-lang#66045
* rust-lang#83421
* rust-lang#92444
…=rcvalle Add support for -Zsanitizer-cfi-minimal-runtime For production use, we should only link in the ubsan_minimal runtime, instead of the complete ubsan runtime. This adds support for both cfi-recover and cfi-diag to use the minimal runtime when `-Zsanitizer-cfi-minimal-runtime` is specified. This also includes tests, to ensure the flag can only be used if either cfi-recover or cfi-diag is enabled, it doesn't disrupt the original behavior, and links in the correct runtime when specified. cc @1c3t3a ?r rcvalle
implement #![feature(gca_adts)] Tracking issue: rust-lang#163420 r? @BoxyUwU
…ed-attribute-documentation, r=clarfonthey add `automatically_derived` attribute documentation Documents the `automatically_derived` built-in attribute in `core` via `#[doc(attribute = "automatically_derived")]` Part of rust-lang#157604
…r=petrochenkov do not complain about unstable target features on nightly This was brought up in rust-lang#162235 (comment): we currently print a warning on nightly saying that using an unstable target feature will become a hard error. That's a mistake. We could either remove the part of the warning that talks about it becoming a hard error, or we could just hide the warning entirely for unstable features on nighty. I went for the latter -- nightly is meant for experimentation with those features so having un-silenceable warnings is not great. Cc @workingjubilee
… r=jieyouxu Add `stable_rustc` helper in `run-make-support` To help with rust-lang#162848 and https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/626329887. For rust-lang#162848, I need to avoid passing `-Zthreads` when the compiler is supposed to act like `stable`. This refactoring makes that simpler; I will only add that flag to `Rustc::new` and not `Rustc::stable`. r? jieyouxu
…ata, r=petrochenkov Allow using different index types when reading and writing to tables Make tables of metadata two-sided: one can write with one index type and read with another, as long as both those types are indexes. That will be used in rust-lang#163321 when we will have `LocalDefIndex` or similar type. r? @petrochenkov
…, r=hanna-kruppe Stabilize vec_try_remove Closes rust-lang#146954 , which is has [completed its FCP with disposition to merge](rust-lang#146954 (comment)). Hello, this is my first contribution to Rust! I was programming for fun this weekend and I was surprised that this wasn't stabilized, so I thought I would try to contribute. Disclosure: I am making this PR in my capacity as a Canonical employee. No LLMs were harmed in the making of this pull request.
Member
Author
|
Duplicate or #163465 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
funnel_shifts(includingconst) #161015 (Stabilizefunnel_shifts(includingconst))Result::into_{ok,err}#161712 (StabilizeResult::into_{ok,err})automatically_derivedattribute documentation #163390 (addautomatically_derivedattribute documentation)stable_bare_rustchelper inrun-make-support#163444 (Addstable_rustchelper inrun-make-support)r? @ghost
Create a similar rollup