Repository navigation
[beta] backports - #165162
Merged
Merged
[beta] backports#165162
Conversation
This will allow e.g. `&[!]` to satisfy `&[T] where T: AsRef<str>`. It follows the recommendation from the never documentation: > When writing your own traits, `!` should have an `impl` whenever > there is an obvious `impl` which doesn’t `panic!`. -- <https://doc.rust-lang.org/1.97.1/std/primitive.never.html#-and-traits> A class of use case for these impls is: * some code is generic over `T: AsRef<SomeOtherType>`, * and is still useful in the case where there are no `T`s, because it takes `Option<T>` or `&[T]` or any other input that can be empty or never-called, yet still do things with other inputs, in which case providing `T = !` is slightly better than the alternative of providing an inhabited placeholder type, because it ensures that the generic code is compiled with knowledge of the fact that that there will never be any `T`s, even if the specific code that cares about whether there are any `T`s doesn’t get inlined into the call site that doesn’t provide any `T`s. The test tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs had to be updated because it depended on this impl not existing. I’ve confirmed that the modified test still functions as a regression test by compiling it in nightly-2022-08-28 and seeing it ICE. (cherry picked from commit d016eb1)
(cherry picked from commit 604a21c)
We already have a fallback when the linker doesn't support `-static-pie` to use plain `-static` instead. However, it is also possible that the linker understands that option, but the C library doesn't have the necessary CRT objects. For example, `gcc` has known this option for a long time, but `glibc` doesn't support it for `powerpc` targets at all. We can detect this case in the link output for `-static` fallback too. (cherry picked from commit 4332bd9)
(cherry picked from commit 8ee14d7)
(cherry picked from commit c4da87c)
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
@bors r+ rollup=never |
Contributor
Member
|
@bors try jobs=apple |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 31, 2026
[beta] backports try-job: *apple*
This comment has been minimized.
This comment has been minimized.
Contributor
|
💔 Test for e5a73a1 failed: CI. Failed jobs:
|
Member
|
@bors r- |
Contributor
|
This pull request was unapproved. |
Member
|
@bors try jobs=apple |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 1, 2026
[beta] backports try-job: *apple*
This comment has been minimized.
This comment has been minimized.
Member
|
I'll see tomorrow what we need to do to get this merged, I have a few experimental PRs open that seem promising, we should land these backports sooner rather than later... |
Contributor
|
💔 Test for 08ad627 failed: CI. Failed jobs:
|
Done because of issues with github ci, see rust-lang#165241
JonathanBrouwer
force-pushed
the
beta-next
branch
from
November 2, 2026 08:18
6821a3c to
769fa5d
Compare
Member
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 2, 2026
[beta] backports try-job: *apple*
Member
|
@bors r+ force |
Contributor
This comment has been minimized.
This comment has been minimized.
Contributor
Contributor
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.
View all comments
AsMut<T>andAsRef<T>for!. ImplementAsMut<T>andAsRef<T>for!. #161253BoxandVecDocument zero-sized allocations properly forBoxandVec#163230-static-piemissing CRT objects Add a fallback for-static-piemissing CRT objects #164451aarch64-apple769fa5dr? me