Rollup of 12 pull requests - #163456
Closed
JonathanBrouwer wants to merge 28 commits into
Closed
Rollup of 12 pull requests#163456JonathanBrouwer wants to merge 28 commits into
JonathanBrouwer wants to merge 28 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
Tracking issue: rust-lang#61695
…Source::Path` Use the `DefPath` to determine whether an `extern crate` item is globally nameable. `extern crate` items nested inside value namespaces cannot be referred to by a stable path outside their enclosing scope. Record them as `ExternCrateSource::Path` instead of `ExternCrateSource::Extern` so later path resolution does not reconstruct unnameable paths.
…temporarily to keep file history
…inner and outer doc comment
…adjusted never type
…sage Use same wording as cargo does when `package.edition` is unspecified. Do not suggest `--edition=future` on stable.
…=nia-e Additional NonZero conversions ACP: rust-lang/libs-team#145 Requires FCP due to insta-stable APIs added: ```rust // can't be done generically; compiler can't infer that ZeroablePrimitive is sealed for coherence reasons impl From<&NonZero<uN>> for &uN; impl From<&NonZero<iN>> for &iN; impl From<&NonZero<usize>> for &usize; impl From<&NonZero<isize>> for &isize; impl From<&NonZero<char>> for &char; // excluded due to typechecking bug, but left commented out in code // impl<T> From<&[NonZero<T>]> for &[T] where T: ZeroablePrimitive; // rest are generic impl<T, const N: usize> From<[NonZero<T>; N]> for [T; N] where T: ZeroablePrimitive; impl<T> TryFrom<&T> for &NonZero<T> where T: ZeroablePrimitive; impl<T> TryFrom<&[T]> for &[NonZero<T>] where T: ZeroablePrimitive; impl<T, const N: usize> TryFrom<[T; N]> for [NonZero<T>; N] where T: ZeroablePrimitive; ``` Note that the `Error` for the `TryFrom` implementations is `TryFromIntError` to match the similar impls. r? rust-lang/libs-api
…henkov Avoid recording unnameable `extern crate` aliases in diagnostic metadata the root cause was that block scoped `extern crate` aliases were still being recorded as `ExternCrateSource::Extern(def_id)`. later, diagnostics reused that metadata and attempted to print paths through those aliases, producing unnameable paths such as `crate::_::_my_crate`. this change detects `extern crate` items whose `DefPath` passes through a value namespace (for example inside functions or `const` blocks) and records them as `ExternCrateSource::Path` instead. diagnostics then fall back to the crate name rather than an unnameable alias. Closes rust-lang#153459
…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
…=lcnr next solver: prefer to select impl candidates over global where-clause candidates Fixes rust-lang#162331 Ideally we'd use a more appropriate typing environment when doing const-eval for const-to-pat, which would also fix that (since the problem clauses wouldn't be present to begin with). Being able to do that seems kind of far off, though, so here's a quick fix that (mostly) matches what the old solver does.
…lution, r=petrochenkov Fix intra doc link resolution when a doc comment is composed of both inner and outer doc comment Fixes rust-lang#78591 Fixes rust-lang#119965 Fixes rust-lang#134904 This PR handles the case where doc is composed of both inner and outer doc comments. Which is generally not an issue... except for modules. So to fix this issue, I split the doc comments in two parts: outer on one side and inner on the other. To make it work, I changed some APIs to now receive an iterator of attributes rather than a slice of attributes. r? @Urgau
…-obk make `RustaceansAreAwesome` satisfy trait bounds We use `RustaceansAreAwesome` in place of `dyn Trait` when checking whether `Trait`'s methods' receivers are dyn-dispatchable. `Trait`'s where-bounds should hold for it. Fixes rust-lang#161621
…=tgross35 Move `Arc` and `Rc` into `rcs` mod See <rust-lang#141348 (comment)>.
implement #![feature(gca_adts)] Tracking issue: rust-lang#163420 r? @BoxyUwU
…ieyouxu When compiling without a specified `--edition`, emit a message Implement rust-lang/compiler-team#1019.
…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
Force the correct type variable to never for method resolution on an adjusted never type Fixes the problem described in https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/method.20call.20on.20diverging.20infer.20doesn.27t.20constrain.20to.20never/near/627440568 The reason that the old code didn't work, as far as I understand, is that the subtype constraint `root_ty <: ty` is only evaluated after `ty` is unioned with `&_`, causing a `mismatched type` error when `&_` is then given the subtype constraint. This is fixed by demanding `ty`, rather than `root_ty` to be equal to never. I asked lcnr whether they think there's a way to reproduce this on the old trait solver, they were unsure and I also am. I think to be safe we should backport this to 1.100, since the never type stabilization is in 1.100 and there might be a way to break this code then. r? @lcnr cc @WaffleLapkin
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 28, 2026
Rollup of 12 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-gnu-llvm-21-3 try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #158102, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
Contributor
|
💔 Test for 452efa8 failed: CI. Failed jobs:
|
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:
extern cratealiases in diagnostic metadata #158997 (Avoid recording unnameableextern cratealiases in diagnostic metadata)funnel_shifts(includingconst) #161015 (Stabilizefunnel_shifts(includingconst))Result::into_{ok,err}#161712 (StabilizeResult::into_{ok,err})RustaceansAreAwesomesatisfy trait bounds #163200 (makeRustaceansAreAwesomesatisfy trait bounds)ArcandRcintorcsmod #163331 (MoveArcandRcintorcsmod)--edition, emit a message #158102 (When compiling without a specified--edition, emit a message)Failed merges:
stable_rustchelper inrun-make-support#163444 (Addstable_rustchelper inrun-make-support)r? @ghost
Create a similar rollup