Skip to content

Rollup of 7 pull requests - #165929

Closed
WaffleLapkin wants to merge 20 commits into
rust-lang:mainfrom
WaffleLapkin:rollup-g0eQ3sY
Closed

WaffleLapkin wants to merge 20 commits into
rust-lang:mainfrom
WaffleLapkin:rollup-g0eQ3sY

Conversation

@WaffleLapkin

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Gelbpunkt and others added 20 commits November 9, 2026 14:05
We also forward the existing `std::vec::from_elem_global` and
`std::vec::from_elem_in` to these new associated methods on `Vec`. The
module-level methods could potentially be removed in a follow-up.
This will allow marking EIIs without default impls as not-incomplete and
possibly even stabilize them before we get EIIs with default impls fully
working across all targets. EIIs without default impls can be
implemented (and will be in another PR of mine) in a way that is
guaranteed to work on all targets that rustc supports at all. EIIs with
default impls afaik however depend on either weak symbols (which are
broken on several targets), global constructors writing to a static or
having rustc drive the linker (which several projects using Rust don't
do).
alloc: Unstably add `Vec::repeat` and `Vec::repeat_in`

Tracking issue: rust-lang#164215

We also forward the existing `std::vec::from_elem_global` to `Vec::repeat`. The old module-level method `std::vec::from_elem_in` was unstable and unused, so I've removed it as per reviewer's request.

[Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Custom.20allocators.20with.20vec.21.20and.20fallible.20allocations/with/630260935)

r? @clarfonthey
… r=JonathanBrouwer

Add a separate feature gate for EIIs with default impls

This will allow marking EIIs without default impls as not-incomplete and possibly even stabilize them before we get EIIs with default impls fully working across all targets. EIIs without default impls can be implemented (and will be in another PR of mine) in a way that is guaranteed to work on all targets that rustc supports at all. EIIs with default impls afaik however depend on either weak symbols (which are broken on several targets), global constructors writing to a static or having rustc drive the linker (which several projects using Rust don't do).

cc @jdonszelmann
…ustive, r=fmease

Emit note for `non_exhaustive` within defining crate for `unreachable_patterns`

Original issue: rust-lang#159713

Previous PR: rust-lang#160918

This PR adds a note to the `unreachable_patterns` lint explaining that `#[non_exhaustive]` does not affect exhaustiveness checking within the defining crate when the type is a local enum with the attr `#[non_exhaustive]`.
…r=fmease

Small changes to dyn compatibility

 - Remove unused field
 - Short-circuit RPITIT check if there aren't any aliases in the return type, to maybe save a little perf.
…=JonathanBrouwer

Add `#[rustc_test_entrypoint_marker]` back !

Re-add the unstable and internal `#[rustc_test_entrypoint_marker]` (first sighted in rust-lang#158854)! This is helpful for tools like [Charon](https://github.com/AeneasVerif/charon) to translate test entry points, since once test generation is done there is no simple way of finding these: otherwise one needs to look for statics with `#[rustc_test_marker]`, visit their body, and look for a path to a function inside that body (ugly!)

now that synthetic attributes exist doing this is simple and shouldnt cause any regressions :3 (fingers crossed)

r? jdonszelmann
…ce, r=panstromek

Fix borrowck ICE when a borrow outlives a local in a const block

Fixes rust-lang#165684

When borrowck reports a borrow that outlives a local, it adds a label like "...dropped here, when the enclosing closure returns". The code building that label only knew about closures and coroutines and just hit `bug!` for anything else, so a const block made it ICE.

I swapped the match for `TyCtxt::def_descr`, which already knows every kind of body. Const blocks are just `AnonConst` though, so `def_descr` calls them "constant expression", which reads weird. So for const blocks (checked via `hir::Node::ConstBlock`) the label now says "when the enclosing const block ends" instead. Coroutines get a bit more specific too, for example "enclosing async block" or "enclosing async fn" instead of just "enclosing coroutine".

Added a UI test for the const block case (it ICEs without the fix), and one for the closure / async fn / async block wording.
Use `trim_prefix` in bootstrap

The release notes for 1.100 reminded me that we can replace `a.strip_prefix(p).unwrap_or(a)` with `a.trim_prefix(p)`, for both strings and paths.

There should be no change in bootstrap behaviour.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 13, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-bootstrap-stamp Area: bootstrap stamp logic A-slice-vec Area: `[T]` and `Vec<T>` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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 Nov 13, 2026
@WaffleLapkin

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

@rust-bors

rust-bors Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 55c2cec has been approved by WaffleLapkin

It is now in the queue for this repository.

@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 Nov 13, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Trying commit 55c2cec with merge 8864b64…

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/43469416919

rust-bors Bot pushed a commit that referenced this pull request Nov 13, 2026
Rollup of 7 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
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
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-apple-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs stdout ----
Saved the actual stderr to `/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/feature-gates/feature-gate-extern-item-default-impls/feature-gate-extern-item-default-impls.stderr`
diff of stderr:

8    = help: add `#![feature(extern_item_default_impls)]` to the crate attributes to enable
9    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10 
- error[E0658]: eii with default impl is unstable
-   --> $DIR/feature-gate-extern-item-default-impls.rs:12:1
+ error: `#[eii]` cannot be used on statics with a value on Apple targets
+   --> $DIR/feature-gate-extern-item-default-impls.rs:13:21
13    |
- LL | #[eii(hello2)]
-    | ^^^^^^^^^^^^^^
+ LL | static HELLO: u64 = 1;
+    |                     ^
16    |
-    = note: see issue #125418 <https://github.com/rust-lang/rust/issues/125418> for more information
-    = help: add `#![feature(extern_item_default_impls)]` to the crate attributes to enable
-    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+    = note: see issue #157649 <https://github.com/rust-lang/rust/issues/157649> for more information
20 
- error: aborting due to 2 previous errors
+ error: cannot find attribute `hello2` in this scope
+   --> $DIR/feature-gate-extern-item-default-impls.rs:15:3
+    |
+ LL | #[hello2]
+    |   ^^^^^^
+    |
+ note: similarly named attribute macro `hello` defined here
+   --> $DIR/feature-gate-extern-item-default-impls.rs:4:1
+    |
+ LL | #[eii]
+    | ^^^^^^
+ help: an attribute macro with a similar name exists
+    |
+ LL - #[hello2]
+ LL + #[hello]
+    |
+ 
+ error: aborting due to 3 previous errors
22 
23 For more information about this error, try `rustc --explain E0658`.
24 

Note: some mismatched output was normalized before being compared
-   --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:13:21
-   --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:15:3
-   --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:4:1
- LL | #[eii] //~ ERROR eii with default impl is unstable
+ error: `#[eii]` cannot be used on statics with a value on Apple targets
+   --> $DIR/feature-gate-extern-item-default-impls.rs:13:21
+ LL | static HELLO: u64 = 1;
+    |                     ^
+    = note: see issue #157649 <https://github.com/rust-lang/rust/issues/157649> for more information
+ error: cannot find attribute `hello2` in this scope
+   --> $DIR/feature-gate-extern-item-default-impls.rs:15:3
+    |
+ LL | #[hello2]
+    |   ^^^^^^
+    |
+ note: similarly named attribute macro `hello` defined here
+   --> $DIR/feature-gate-extern-item-default-impls.rs:4:1
+    |
+ LL | #[eii]
+    | ^^^^^^
+ help: an attribute macro with a similar name exists
+    |
+ LL - #[hello2]
+ LL + #[hello]
+    |
+ 
+ error: aborting due to 3 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args feature-gates/feature-gate-extern-item-default-impls.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/feature-gates/feature-gate-extern-item-default-impls" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0658]: eii with default impl is unstable
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:4:1
   |
LL | #[eii] //~ ERROR eii with default impl is unstable
   | ^^^^^^
   |
   = note: see issue #125418 <https://github.com/rust-lang/rust/issues/125418> for more information
   = help: add `#![feature(extern_item_default_impls)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: `#[eii]` cannot be used on statics with a value on Apple targets
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:13:21
   |
LL | static HELLO: u64 = 1;
---
   |
note: similarly named attribute macro `hello` defined here
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/feature-gate-extern-item-default-impls.rs:4:1
   |
LL | #[eii] //~ ERROR eii with default impl is unstable
   | ^^^^^^
help: an attribute macro with a similar name exists
   |
LL - #[hello2]
LL + #[hello]
   |

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.

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

rust-bors Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

PR #165882, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-bootstrap-stamp Area: bootstrap stamp logic A-slice-vec Area: `[T]` and `Vec<T>` rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.