Commit Graph

25704 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe) 76d07a61f3 Rollup merge of #156531 - Zalathar:no-pass-override, r=jieyouxu
compiletest: Rename `//@ ignore-pass` to `//@ no-pass-override`

By convention, compiletest directives starting with `ignore-*` normally cause the test itself to be skipped under certain conditions.

The `//@ ignore-pass` directive was the only exception to that convention. The new name should hopefully do a better job of communicating its effect, which is to cause the `--pass` flag to not override the test's `build-pass` or `run-pass` directive.

The `//@ no-pass-override` directive is mainly useful for tests that expect warnings produced during codegen.

---
r? jieyouxu
2026-05-14 13:24:34 +08:00
许杰友 Jieyou Xu (Joe) 772f42b5b7 Rollup merge of #156450 - Zalathar:colon-or-not, r=jieyouxu
compiletest: Enforce that directives are consistently used with or without a colon

With the notable exception of `//@ pp-exact`, all directives expect to either always be used *with* a colon, or always be used *without* a colon. For example:

- `//@ uses-colon: value`
- `//@ no-colon` or `//@ no-colon (remark)`

Currently we just silently discard directives that use the wrong syntax, which is not great.

This PR therefore makes `parse_name_directive` and `parse_name_value_directive` panic if the wrong syntax is encountered.

The parser for `pp-exact` has been adjusted to check for the colon before deciding which parse method to call.

r? jieyouxu
2026-05-14 13:24:33 +08:00
Jonathan Brouwer 0f950ce670 Rollup merge of #156413 - fmease:rustdoc-ltd-improvs, r=GuillaumeGomez
rustdoc: Correctness & perf improvements to link-to-definition

Rewrite the way we resolve type-dependent paths (incl. method calls) in `SpanMapVisitor`. Instead of trying to (re)find the enclosing body owner each time we encounter such a node, potentially calling `typeck_body` several times per body, keep track of the "active" `BodyId` in the visitor and cache the corresponding `TypeckResults`. The "active" `BodyId` is updated in `visit_nested_body` (add) and in `visit_item` (remove).

This fixes a class of ICEs where we tried to look up the definition of type-relative paths located in non-body items nested in bodies, in the overarching body which is never correct. rustdoc@main has a hack to fix this issue for paths specifically found in assoc types in impls.

Fixes rust-lang/rust#147882. Fixes rust-lang/rust#147057. Fixes rust-lang/rust#155327. Fixes rust-lang/rust#149089. Fixes rust-lang/rust#150153. Fixes rust-lang/rust#156418.
Supersedes rust-lang/rust#147911.

---

`--generate-link-to-definition` is not enabled by default, so we can't perf this as is. Instead, I'm benching them against PR rust-lang/rust#156348 in PR https://github.com/rust-lang/rust/pull/156355 using the same parent commit for the try-builds. For context, LTD is *extremely* costly as the perf run for the baseline PR shows: https://github.com/rust-lang/rust/pull/156348#issuecomment-4411427326.

"Absolute results": https://github.com/rust-lang/rust/pull/156355#issuecomment-4421922342.
"Relative results": [https://perf.rust-lang.org/compare.html?...](https://perf.rust-lang.org/compare.html?start=68c2bff6cb08a87e59246064a6a9f37098e22c3f&end=78d15de5525370011388c8f63847e873c4de14ed&stat=instructions%3Au).

Excerpt of the relative results:

Primary:

Benchmark | Profile | Scenario | Backend | Target | % Change | Significance Threshold | Significance Factor
---|---|---|---|---|---|---|---
nalgebra-0.33.0 | doc | full | llvm | x64 | -5.82% | 0.20% | 29.09x
diesel-2.2.10 | doc | full | llvm | x64 | -3.41% | 0.20% | 17.05x
image-0.25.6 | doc | full | llvm | x64 | -2.03% | 0.20% | 10.16x
regex-automata-0.4.8 | doc | full | llvm | x64 | -1.94% | 0.20% | 9.71x
cargo-0.87.1 | doc | full | llvm | x64 | -1.64% | 0.20% | 8.21x
clap_derive-4.5.32 | doc | full | llvm | x64 | -1.63% | 0.20% | 8.14x
cranelift-codegen-0.119.0 | doc | full | llvm | x64 | -1.48% | 0.20% | 7.41x
syn-2.0.101 | doc | full | llvm | x64 | -1.07% | 0.20% | 5.35x
ripgrep-14.1.1 | doc | full | llvm | x64 | -0.96% | 0.20% | 4.78x
stm32f4-0.15.1 | doc | full | llvm | x64 | -0.80% | 0.20% | 4.01x
serde-1.0.219 | doc | full | llvm | x64 | -0.67% | 0.20% | 3.33x
hyper-1.6.0 | doc | full | llvm | x64 | -0.66% | 0.20% | 3.30x
eza-0.21.2 | doc | full | llvm | x64 | -0.55% | 0.20% | 2.74x
unicode-normalization-0.1.24 | doc | full | llvm | x64 | -0.49% | 0.20% | 2.45x
serde_derive-1.0.219 | doc | full | llvm | x64 | -0.45% | 0.20% | 2.26x
typenum-1.18.0 | doc | full | llvm | x64 | -0.42% | 0.20% | 2.08x
bitmaps-3.2.1 | doc | full | llvm | x64 | -0.32% | 0.20% | 1.61x

Secondary:

Benchmark | Profile | Scenario | Backend | Target | % Change | Significance Threshold | Significance Factor
---|---|---|---|---|---|---|---
deep-vector | doc | full | llvm | x64 | -23.96% | 0.20% | 119.78x
large-workspace | doc | full | llvm | x64 | -2.16% | 0.20% | 10.81x
deeply-nested-multi | doc | full | llvm | x64 | -1.35% | 0.20% | 6.75x
serde-1.0.219-threads4 | doc | full | llvm | x64 | -0.67% | 0.20% | 3.33x
wg-grammar | doc | full | llvm | x64 | -0.32% | 0.20% | 1.62x
tt-muncher | opt | full | llvm | x64 | -0.31% | 0.20% | 1.56x

nalgebra-0.33.0:

Query/Function | Time (%) | Time (s) | Time delta | Executions | Executions delta | Hits | Hits delta
---|---|---|---|---|---|---|---
Totals | 109.57% | 2.185 | -0.138 (-5.9%) | 1614146 | -5602 (-0.3%) | 16983840 | -1436455 (-7.8%)
typeck_root | 15.75% | 0.344 | -0.105 (-23.4%) | 1704 | -954 (-35.9%) | 393 | -6758 (-94.5%)
...|...|...|...|...|...|...|...
2026-05-14 00:35:38 +02:00
Jonathan Brouwer 5d63c29471 Rollup merge of #156260 - ZequanWu:fix-ld-warn, r=JohnTitor
test: suppress deprecation warning

The newer mac os ld linker emits a deprecation warning:
```
 warning: linker stderr: ld: -ld_classic is deprecated and will be removed in a future release
    |
    = note: `#[warn(linker_messages)]` on by default
```
2026-05-14 00:35:37 +02:00
Jonathan Brouwer f24b05a9d2 Rollup merge of #156344 - estebank:issue-156326, r=petrochenkov
Do not index past end of buffer when checking heuristic in error index syntax highlighter

When checking whether the current token is a function indentifier by inspecting the syntax, do not attempt to access past the end of the code buffer.

Fix rust-lang/rust#156326.
2026-05-14 00:35:36 +02:00
Esteban Küber 530c69bbc2 Do not index past end of buffer when checking heuristic in error index syntax highlighter
When checking whether the current token is a function indentifier by inspecting the syntax, do not attempt to access past the end of the code buffer.
2026-05-13 17:52:04 +00:00
Jonathan Brouwer aeae08587c Rollup merge of #156425 - chenyukang:yukang-fix-156416-unused-assignments-diverging, r=oli-obk
Fix unused assignments in diverging branches

Fixes rust-lang/rust#156416

Add `location` and use `is_predecessor_of` to check in the control flow graph.

r? @ghost
I'd like to see whether there is performence regression.
2026-05-13 15:16:18 +02:00
Jonathan Brouwer 0705b602f0 Rollup merge of #155815 - djc:swift-cc, r=jieyouxu
Add Swift function call ABI

Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature gate, mapping to LLVM's `swiftcc` calling convention. This is only allowed (a) for `is_darwin_like` targets, since the [ABI is only stable for those platforms](https://www.swift.org/blog/abi-stability-and-more/) and (b) with the LLVM backend, since the other backends don't support it.

Current approaches to interoperability with Swift lower to Objective-C (or require a Swift stub exposing a C ABI), but that is an optional mapping on the Swift side that some newer Apple frameworks omit. It would be great to be able to more directly/natively be able to call into Swift code directly via its stable API (on Apple platforms at least).

Reimplements rust-lang/rust#64582 on top of current main. The main objection to the previous PR seemed to be that it needed an RFC, but there was pushback (which seems sensible to me) that an RFC could be deferred until stabilization.

I think this needs a tracking issue? Would be happy to write one up if/when there is a consensus that this will be merged.
2026-05-13 15:16:17 +02:00
Jonathan Brouwer f6faa05477 Rollup merge of #156325 - cijiugechu:generics-transmutefrom, r=BoxyUwU
Don't treat const param default as projection

Avoid treating const param default as associated const projection.

Closes rust-lang/rust#156293
2026-05-13 11:46:41 +02:00
Zalathar cda9a68248 Rename //@ ignore-pass to //@ no-pass-override
By convention, compiletest directives starting with `ignore-*` normally cause
the test itself to be skipped under certain conditions.

The `//@ ignore-pass` directive was the only exception to that convention. The
new name should hopefully do a better job of communicating its effect, which is
to cause the `--pass` flag to not override the test's `build-pass` or
`run-pass` directive.

The `//@ no-pass-override` directive is mainly useful for tests that expect
warnings produced during codegen.
2026-05-13 17:24:59 +10:00
Zalathar 0a5216b52a Remove some //@ ignore-pass directives that do nothing
The compiletest `--pass` flag only affects tests with a `*-pass` directive,
i.e. `check-pass`, `build-pass`, or `run-pass`.

It has no effect in `*-fail` tests, or in auxiliary crates.
2026-05-13 17:15:51 +10:00
Zalathar 38d2c11584 Enforce that directives are consistently used with or without a colon 2026-05-13 15:52:33 +10:00
Zalathar 58f8739d55 Migrate mir-opt tests from PreCodegen to runtime-optimized
MIR dumped before/after the dummy `PreCodegen` pass should be identical to MIR
dumped after the phase transition to `runtime-optimized`.
2026-05-13 15:40:23 +10:00
León Orell Valerian Liehr e205784d77 Don't try to resolve type-dependent paths in anon consts 2026-05-13 03:56:00 +02:00
León Orell Valerian Liehr 2493ef1503 rustdoc: SpanMapVisitor: Cache TypeckResults 2026-05-13 03:51:44 +02:00
bors c8c4c83d57 Auto merge of #156224 - khyperia:unnormalized-migration, r=BoxyUwU
Unnormalized migration: assert_fully_normalized, struct_tail, and `field.ty`



tracking issue: https://github.com/rust-lang/rust/issues/155345 (first checkbox, and partial second checkbox, of that issue)

I'm going a bit slower than expected (less free time than I'd hope, lots of GCA work that I'm doing instead), and figured I'd just submit what I have now rather than building up a big batch of changes. Slow and steady!

r? @lcnr
2026-05-13 00:16:00 +00:00
lcnr 44c49506bd update tests 2026-05-12 23:28:32 +02:00
Jonathan Brouwer 63322d00e9 Rollup merge of #156284 - petrochenkov:kvak2, r=mu001999
resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets

Fixes https://github.com/rust-lang/rust/issues/156264.
2026-05-12 18:53:39 +02:00
Jonathan Brouwer f3e57a2264 Rollup merge of #156145 - danieljofficial:move-tests-cast, r=jieyouxu
Move tests cast

Hi, I have moved some type casting tests into the correct directory. Please find time to review
2026-05-12 18:53:38 +02:00
Dirkjan Ochtman f49e45101c Add Swift function call ABI
Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature
gate, mapping to LLVM's `swiftcc` calling convention. Cranelift and
GCC backends fall back to the platform default since they have no
equivalent.
2026-05-12 17:09:19 +02:00
danieljofficial 7a876ac418 add helpful comments to tests 2026-05-12 10:12:43 +01:00
danieljofficial 32a3612a2b add issue links and bless 2026-05-12 08:39:45 +01:00
Jonathan Brouwer e383845f33 Rollup merge of #154918 - fmease:fix-enum-var-lt, r=jackh726
Fix elided lifetime resolution & trait object lifetime defaulting for enum variant paths

Context: https://github.com/rust-lang/rust/pull/129543#discussion_r3035614838.
Fixes rust-lang/rust#108224.

I consider this to be a minor bug fix that doesn't demand a (T-types) FCP.

r? @lcnr or reassign
2026-05-12 07:03:56 +02:00
bors 29b7590130 Auto merge of #155887 - BoxyUwU:higher_ranked_assumptions_v2, r=lcnr
-Zassumptions-on-binders



r? lcnr

cc https://rust-lang.github.io/rust-project-goals/2026/assumptions_on_binders.html I would cc a tracking issue but the project goals haven't been finalized yet ^^'

Implements `-Zassumptions-on-binders`. This has a few main components:
1. We introduce a new form of region constraints for use by the trait solver which supports ORs
2. When entering binders universally inside of the trait solver we walk the bound thing and compute a list of region assumptions. We then track in the `InferCtxt` all the region outlives and type outlives mentioning a placeholder from the binder for use when handling constraints involving placeholders
3. Ideally when exiting a binder, but currently actually when computing a response inside the solver, we look through all of region constraints involving placeholders and eagerly handle these region constraints instead of returning them to the caller

This is very much a first-draft impl (though it is vaguely functional), there's a lot we need to change going forwards:
- We should really be using this new form of region constraint everywhere/more generally we shouldnt have two kinds of region constraints
- We shouldn't be computing implied bounds when entering binders, instead they should be explicit everywhere and actually checked when instantiating binders. As-is `-Zassumptions-on-binders` probably widens existing soundness holes around implied bounds due to having significantly more implied bounds
- We should be eagerly handling placeholders *everywhere* not just inside of the trait solver. Right now there will still be missing assumptions for placeholders when we do higher ranked type relations during type checking outside of the trait solver.
- I'm not normalizing our assumptions or our constraints and we should be doing both 
- Handling of alias outlives' involving placeholders is incomplete in a number of ways
- We should handle placeholders when leaving binders not when computing responses IMO
- Actually support OR region constraints in borrow checking and region checking  right now all our OR constraints are converted into normal ANDed region constraints in root contexts.
- Right now diagnostics just point to the whole item which the unsatisfied constraints came from. this is suboptimal! fix this!
- Move universe information into InferCtxtInner so it can be rolled back by probes
- we should make some kind of test suite helper so we can directly write universal/existential quantifiers and assumptions rather than having to go through rust syntax :')

How do we actually eagerly handle constraints?

The general idea is that we have some function (`eagerly_handle_placeholders_in_universe`) which takes:
- A set of region constraints
- The universe which we want to eagerly handle constraints in
- A set of outlives assumptions associated with that universe/binder

This function will rewrite all of the region constraints which involve placeholders from the passed in universe to be in terms of variables from smaller universes (or drop the constraints if we know them to be satisfied). For example:
```rust
for<'a> where('a: 'b) {
    prove ('a: 'c)
}
```
when exiting `for<'a>` we want to handle the `'!a: 'c` constraint *somehow* and we can do that by requiring that *any* of the lifetimes which `'!a` outlives, themselves outlive `'c`. In this case we can require `Or('b: 'c)` and instead of `'!a: 'c` which gives us a constraint that makes sense after exiting the forall.

some more examples:
```rust
for<'a> where('a: 'b, 'a: 'c) {
    prove('a: 'd)
}
// rewritten to Or('b: 'd, 'c: 'd)

for<'a> where('b: 'a) {
    prove(T: 'a)
}
// rewritten to Or(T: 'b)
```

The tricky thing here is that we want/need to avoid the trait solver knowing about *all* type outlives/region outlives assumptions. So this algorithm is implemented with only knowing about the assumptions coming from the binder that is being exited.

We want to avoid passing all outlives assumptions through the trait solver for two main reasons. The first is just perf, augmenting the `ParamEnv` with significant amounts of outlives assumptions could easily mess up caching. 

The second is that it's Not Possible™️ to implement. Type checking requires trait solving inside of a closure which still has an uninferred signature, this means that there are some set of implied bounds that we just don't know about yet because we only know some inference variable is well formed and nothing else.

---

Long term we should be able to wholly rip out placeholder handling from borrow checking and we won't ever encounter placeholders outside of the binders they were produced from.
2026-05-12 01:40:56 +00:00
cijiugechu b11537fa0e remove transmutability feature 2026-05-12 09:16:16 +08:00
Jonathan Brouwer 311605c713 Rollup merge of #156462 - TimNN:flit, r=nikic
LLVM 23: Accept float (instead of hex) literals in codegen tests

https://github.com/llvm/llvm-project/pull/190649 changes how float constants are printed in LLVM IR.

@rustbot label llvm-main
2026-05-11 23:03:09 +02:00
Jonathan Brouwer 647cf45d72 Rollup merge of #156461 - TimNN:retty, r=nikic
LLVM 23: Specify `returnaddress` intrinsic return type

https://github.com/llvm/llvm-project/pull/188464 made the return type of the intrinsic generic to support different pointer address spaces.

@rustbot label llvm-main
2026-05-11 23:03:09 +02:00
Jonathan Brouwer cc434529cb Rollup merge of #156022 - tonywu6:main, r=lolbinarycat
rustdoc: Fix cosmetic issues when reporting unresolved paths in `broken_intra_doc_links`

Fix some minor issues with how the `rustdoc::broken_intra_doc_links` lint labels unresolved items:

- [`a469a4a`] For unresolved "extern prelude" links like `::unresolved::item`
  - Previously: ```no item named `` in scope```
  - Now: ```no item named `unresolved` in scope```
- [`eeb96fa`] Some malformed paths are now accounted for, for example:
  - `std:::path`
    - Previously: ```no item named `std:` in scope```
    - Now: `has invalid path separator`
  - `std::::path`
    - Previously: ```no item named `` in scope```
    - Now: `has invalid path separator`

This PR is broken down into a few commits with their own descriptions, which I hope makes reviewing easier!

Fixes rust-lang/rust#141095

[`a469a4a`]: https://github.com/rust-lang/rust/commit/a469a4ae638200c264c553e72204335e20d661a1
[`eeb96fa`]: https://github.com/rust-lang/rust/commit/eeb96fab7c7882dca4c48aa8b5817e4acbf0d7d2
2026-05-11 23:03:07 +02:00
Jonathan Brouwer aeffd1585a Rollup merge of #155184 - scottmcm:intercept-array-drop-shim, r=WaffleLapkin
Have arrays' `drop_glue` just unsize and call the slice version

It's silly to emit two loops (because of the drop ladder -- just one in panic=abort) for every array length that's dropped when we can just polymorphize to the slice version.

Built atop rust-lang/rust#154327 to avoid conflicts later, so draft for now.

r? @WaffleLapkin
2026-05-11 23:03:06 +02:00
Jonathan Brouwer f433b6d38d Rollup merge of #147672 - kjetilkjeka:llbc-linker-nvptx-strip-less-debug, r=ZuseZ4
LLBC-linker: Do not strip debug symbols for the nvptx target anymore

With LLVM >= 20 and PTX ISA version >= 7.0 the problems described in rust-lang/rust#99248 with debug symbols seems to be fixed 🎉

Since PTX isa versions < 7.0 is unsupported on the main branch and the upcoming beta release it's possible to finally remove the hack we had where we stripped debug symbols unconditionally for the nvptx64-nvidia-cuda target.

closes: https://github.com/rust-lang/rust/issues/99248
2026-05-11 23:03:05 +02:00
Jonathan Brouwer f91de350ee Rollup merge of #156429 - scottmcm:raw-eq-transmute, r=oli-obk
Simplify `intrinsic::raw_eq` in MIR when possible

After https://github.com/rust-lang/rust/pull/150945 things can inline enough to have this end up specific enough that we can remove it, for example changing `raw_eq::<[u8; 4]>(a, b)` → `Transmute(a) == Transmute(b)`.

The LLVM backend can also do this (and in more cases too) but we might as well do it in MIR instead when we can so it applies to all backends and other MIR optimizations can apply afterwards.
2026-05-11 23:03:04 +02:00
Jonathan Brouwer 1db77ea560 Rollup merge of #155023 - TaKO8Ki:move-expr-1, r=nikomatsakis
Introduce move expressions (`move($expr)`)

This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: https://github.com/rust-lang/rust/issues/155050
Project goal:
- https://github.com/rust-lang/rust-project-goals/issues/107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
2026-05-11 23:03:03 +02:00
Boxy ae6b75e395 new stuff 2026-05-11 20:48:08 +02:00
yukang 64e93266ce Fix unused assignments in diverging branches 2026-05-12 02:11:07 +08:00
Tim Neumann 8bd0b7a7a2 LLVM 23: Specify returnaddress intrinsic return type 2026-05-11 18:33:11 +02:00
Tim Neumann fdcbe90f3d LLVM 23: Accept float (instead of hex) literals in codegen tests 2026-05-11 17:42:43 +02:00
Takayuki Maeda cb384bfd1e reject move expressions in async closures 2026-05-11 16:21:46 +09:00
Takayuki Maeda 632db42aff extend nested closure move expression tests 2026-05-11 16:21:14 +09:00
Takayuki Maeda ae79767b92 split nested move expression coverage 2026-05-11 16:20:19 +09:00
Scott McMurray c468ee3386 Simplify raw_eq to Transmute+Eq for sizes with primitives 2026-05-10 19:28:57 -07:00
Tony Wu 1892ccf428 rustdoc: change lint message to "invalid path separator" for consistency 2026-05-11 09:54:47 +08:00
Scott McMurray 52ecad938e Add a mir-opt test for == on arrays 2026-05-10 16:53:48 -07:00
bors 4b0c9d76ae Auto merge of #156405 - JonathanBrouwer:rollup-yJcad1j, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#156394 (miri subtree update)
 - rust-lang/rust#154972 (Implement `core::arch::return_address` and tests)
 - rust-lang/rust#155679 (rustdoc: Reify emission types)
 - rust-lang/rust#155982 (Fix closure HIR span context mismatch)
 - rust-lang/rust#156323 (Handle --print=backend-has-mnemonic in cg_clif)
 - rust-lang/rust#156387 (std fs tests: avoid matching on OS-provided error string)
 - rust-lang/rust#156129 (compiletest: Migrate from `PassMode`/`FailMode` to `PassFailMode`)
 - rust-lang/rust#156192 (core: Replace `ptr::slice_from_raw_parts` with `slice::from_raw_parts`)
 - rust-lang/rust#156365 (stream_send_recv_stress tests: wait for threads to finish)
 - rust-lang/rust#156368 (Fix invalid unreachable in is_known_valid_scrutinee for Reborrow)
2026-05-10 19:58:51 +00:00
Jonathan Brouwer cfd0d4c150 Rollup merge of #156368 - aapoalas:reborrow-in-match-statement, r=Nadrieril
Fix invalid unreachable in is_known_valid_scrutinee for Reborrow

Fixes rust-lang/rust#156304

Part of the Reborrow traits experiment rust-lang/rust#145612
2026-05-10 19:05:48 +02:00
Jonathan Brouwer 29961709f1 Rollup merge of #155982 - cijiugechu:gio-ice-repro, r=chenyukang
Fix closure HIR span context mismatch

Ensure span has the closure expression's SyntaxContext.

Closes rust-lang/rust#155724
2026-05-10 19:05:44 +02:00
Jonathan Brouwer 63e70d5583 Rollup merge of #155679 - fmease:rustdoc-reify-emission-types, r=notriddle
rustdoc: Reify emission types

Implements https://github.com/rust-lang/rust/pull/155374#discussion_r3124208232:

Instead of maintaining the hidden assumption or invariant that `opts.emit.is_empty()` actually means "emit default artifacts" (i.e., `[HtmlStaticFiles, HtmlNonStaticFiles]` under output format `html`; "`[???]`" under output format `json`), actually *reify* the list of emission types so the rest of the code doesn't need to keep this in mind.

I'm not sure if you like this. It's a tinge overengineered, maybe, but it's more robust I claim.

This PR also rejects `--emit` when `--output-format doctest -Zunstable-options` is passed since the latter doesn't honor emission types at all (yet).
2026-05-10 19:05:43 +02:00
Jonathan Brouwer 30ec142b97 Rollup merge of #154972 - chorman0773:return_address, r=Mark-Simulacrum
Implement `core::arch::return_address` and tests

Tracking issue: rust-lang/rust#154966

Implements libs-team#768
2026-05-10 19:05:42 +02:00
bors e8f92f5769 Auto merge of #144537 - frank-king:feature/pin-drop, r=petrochenkov
Add `Drop::pin_drop` for pinned drops





This PR is part of the `pin_ergonomics` experiment (the tracking issue is rust-lang/rust#130494). It allows implementing `Drop` with a pinned `self` receiver, which is required for safe pin-projection.

Implementations:
- [x] At least and at most one of `drop` and `pin_drop` should be implemented.
- [x] No direct call of `drop` or `pin_drop`. They should only be called by the drop glue.
- [x] `pin_drop` must and must only be used with types that support pin-projection (i.e. types with `#[pin_v2]`).
- [ ] Allows writing `fn drop(&pin mut self)` and desugars to `fn pin_drop(&pin mut self)`. (Will be in the next PRs)
2026-05-10 16:43:01 +00:00
Aapo Alasuutari 5c0718be11 fix(reborrow): invalid unreachable in is_known_valid_scrutinee 2026-05-10 11:07:30 +03:00
bors d1961bebe0 Auto merge of #156378 - matthiaskrgr:rollup-NO89xfV, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149362 (Add Command::get_resolved_envs)
 - rust-lang/rust#155705 (Add `str::word_to_titlecase()` to `alloc`)
 - rust-lang/rust#155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.)
 - rust-lang/rust#156006 (Update a bunch of bootstrap dependencies to remove windows-target)
 - rust-lang/rust#156169 (Change `SwitchInt` handling in dataflow analysis.)
 - rust-lang/rust#155188 (Add regression test for issue 144329)
 - rust-lang/rust#155515 (error on empty `export_name`)
 - rust-lang/rust#155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
 - rust-lang/rust#156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation))
 - rust-lang/rust#156133 (mark some panicking methods around Duration as track_caller)
 - rust-lang/rust#156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
2026-05-10 06:05:52 +00:00