Skip to content

[beta] backports - #165162

Merged
rust-bors[bot] merged 6 commits into
rust-lang:betafrom
cuviper:beta-next
Nov 2, 2026
Merged

rust-bors[bot] merged 6 commits into
rust-lang:betafrom
cuviper:beta-next

Conversation

@cuviper

@cuviper cuviper commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

View all comments

r? me

kpreid and others added 5 commits October 28, 2026 16:08
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)
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)
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 29, 2026
@rustbot

This comment was marked as resolved.

@cuviper

This comment was marked as resolved.

@rust-bors

This comment was marked as resolved.

@cuviper

cuviper commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never

@rust-bors

rust-bors Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 75d8ddb has been tentatively approved by cuviper

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 29, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=apple

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
[beta] backports


try-job: *apple*
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 31, 2026
@rust-bors

rust-bors Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e5a73a1 failed: CI. Failed jobs:

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r-
This is not going to work, we probably also need to disable aarch64-apple-*-2 on beta

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 1, 2026
@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=apple

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 1, 2026
[beta] backports


try-job: *apple*
@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
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...

@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 08ad627 failed: CI. Failed jobs:

@JonathanBrouwer JonathanBrouwer self-assigned this Nov 2, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Nov 2, 2026
Done because of issues with github ci, see rust-lang#165241
@JonathanBrouwer

Copy link
Copy Markdown
Member

Disabled cargo tests on aarch64-apple to work around #165241
As discussed on zulip, we think the benefit of getting the beta back ports merged earlier outweighs the disadvantage of lost test coverage.
@bors r+ p=10
@bors try jobs=apple

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 769fa5d has been tentatively approved by JonathanBrouwer

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
[beta] backports


try-job: *apple*
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r+ force

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 769fa5d has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a013d98 (a013d980304e0f511a95bca0a57d9b27ed79a153)
Base parent: fd8e211 (fd8e211ae301c84a86d13cf52a6d3ce08c589e2e)

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 2, 2026
@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 7m 12s
Pushing 146a145 to beta...

@rust-bors
rust-bors Bot merged commit 146a145 into rust-lang:beta Nov 2, 2026
15 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants