Commit Graph

319861 Commits

Author SHA1 Message Date
Weihang Lo 1b95471493 [beta-1.95] Update cargo submodule 2026-03-06 21:45:02 -08:00
Josh Stone f96caa95f1 update stage0 to 1.94.0 2026-03-05 15:14:40 -08:00
bors ad726b5063 Auto merge of #153314 - cuviper:beta-next, r=cuviper
[beta] prepare Rust 1.95.0-beta

Ref: https://forge.rust-lang.org/release/process.html#beta-pr

- Replace version placeholders with 1.95.0
- Bump to beta release
- library/test: always enable unstable features for miri rust-lang/rust#153369 

r? cuviper
2026-03-05 05:16:37 +00:00
Josh Stone 752b6637ce library/test: always enable unstable features for miri
The unstable features of the `test` crate used to be default-enabled,
and manually disabled when building the beta and stable channels. Commit
dae8ea92a7 flipped that to default-disabled, only enabled for nightly
and dev channels.

However, this broke miri testing on the beta/stable channels, because it
also uses unstable features -- which should be fine to enable just for
its own sysroot build. Now the `test` build script makes that happen by
noticing the `MIRI_CALLED_FROM_SETUP` environment variable.

(cherry picked from commit 30d7ed4c47)
2026-03-04 13:48:26 -08:00
Josh Stone 23b953f802 Bump to beta release 2026-03-02 15:01:23 -08:00
Josh Stone bad24ccbec Replace version placeholders with 1.95.0 2026-03-02 15:00:53 -08:00
bors 67aec36df7 Auto merge of #153183 - JonathanBrouwer:rollup-APFHc2s, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#151143 (explicit tail calls: support indirect arguments)
 - rust-lang/rust#153012 (Stop using `LinkedGraph` in `lexical_region_resolve`)
 - rust-lang/rust#153175 (Clarify a confusing green-path function)
 - rust-lang/rust#153179 (Force a CI LLVM stamp bump)
 - rust-lang/rust#150828 (Improved security section in rustdoc for `current_exe`)
 - rust-lang/rust#152673 (rustc_public: rewrite `bridge_impl` to reduce boilerplate)
 - rust-lang/rust#152674 (rustc_public: remove the `CrateDefItems` trait)
 - rust-lang/rust#153073 (Fix mem::conjure_zst panic message to use any::type_name instead)
 - rust-lang/rust#153117 (Remove mutation from macro path URL construction)
 - rust-lang/rust#153128 (Recover feature lang_items for emscripten)
 - rust-lang/rust#153138 (Print path root when printing path)
 - rust-lang/rust#153159 (Work around a false `err.emit();` type error in rust-analyzer)
2026-02-27 22:04:20 +00:00
Jonathan Brouwer 70da804451 Rollup merge of #153159 - Zalathar:emit-workaround, r=nnethercote
Work around a false `err.emit();` type error in rust-analyzer

For whatever reason, rust-analyzer doesn't see that these calls to `err.emit();` are diverging, so the trailing semicolon makes r-a complain about a type mismatch between `()` and some other type.

Removing the trailing semicolon makes no functional difference (because the emit still unwinds the stack), but seems to be enough to allow rust-analyzer to see that emitting an error returns `!` in these cases, which silences the false error.
2026-02-27 14:05:38 +01:00
Jonathan Brouwer f433c13b48 Rollup merge of #153138 - mu001999-contrib:print-path-root, r=petrochenkov
Print path root when printing path

Extracted from https://github.com/rust-lang/rust/pull/152996.

r? petrochenkov
2026-02-27 14:05:37 +01:00
Jonathan Brouwer 5bb3260b37 Rollup merge of #153128 - mu001999-contrib:fix/features, r=joboet
Recover feature lang_items for emscripten

Fixes https://github.com/rust-lang/rust/pull/152469#discussion_r2858304043
2026-02-27 14:05:36 +01:00
Jonathan Brouwer 57fe4c06de Rollup merge of #153117 - arferreira:cleanup-macro-path-iter, r=GuillaumeGomez
Remove mutation from macro path URL construction

Resolves the `FIXME` in `generate_macro_def_id_path`.
The old code mutated `path` to build the URL — popping the macro name, pushing an interned filename, then restoring the original at the end. None of that was necessary. A slice pattern gives us `module_path` and `last` without touching the original, and `push_fmt(format_args!(...))` writes the filename directly into the URL builder, same as `make_href` already does.
Also tightened the error guards: the original `path.len() < 2` is now two distinct checks with messages that describe the actual failure (empty path vs. single-element path missing the crate prefix).

r? @GuillaumeGomez
2026-02-27 14:05:36 +01:00
Jonathan Brouwer f5383a3353 Rollup merge of #153073 - mehdiakiki:fix/conjure-zst-panic-message, r=RalfJung
Fix mem::conjure_zst panic message to use any::type_name instead

Use `crate::any::type_name::<T>()` instead of `stringify!(T)` in the
runtime panic message of `conjure_zst` , so the actual type name (e.g.
`i32`) is shown rather than the literal string `[T]`.
2026-02-27 14:05:35 +01:00
Jonathan Brouwer b2099acea5 Rollup merge of #152674 - makai410:rpub/sus-trait, r=celinval
rustc_public: remove the `CrateDefItems` trait

This trait feels sus since its documentation says it's for 'retrieving all items from a definition' however it only provides an `associated_items` method (??), which I believe should only be valid for `impl`s and `trait`s.
2026-02-27 14:05:34 +01:00
Jonathan Brouwer 3186ae21a1 Rollup merge of #152673 - makai410:rpub/bridge-impl, r=celinval
rustc_public: rewrite `bridge_impl` to reduce boilerplate

It looks better.
2026-02-27 14:05:33 +01:00
Jonathan Brouwer b16d243cac Rollup merge of #150828 - sourcefrog:doc-exe-security, r=cuviper
Improved security section in rustdoc for `current_exe`

A few improvements to the security section of the docs about `current_exe`

0. The explanatory link <https://vulners.com/securityvulns/SECURITYVULNS:DOC:22183> is ~~broken~~ not directly very helpful in understanding the risk.
1. It basically previously says to never trust the result, which is IMO too pessimistic to be helpful. It's worth understanding the behavior but if you have a use case to re-exec the current program, which is not uncommon, this is a reasonable way to do it.
2. The particular risk is about setuid/setgid processes that shouldn't fully trust the user that spawned them.
3. IMO the most important risk with this function is that the invoker can control argv and PATH, so I made this more explicit. (Many unixes, including Linux, don't rely on them in the implementation, but some do.)
4. The previous text about TOCTOU and races is IMO not really coherent: if an attacker can write to the location where you're going to re-exec, they can fundamentally control what program is executed. They don't need to race with your execution of current_exe, and there is no up-front check.
5. Briefly explain the pattern of CVE-2009-1894: on Linux, depending on system configuration, an attacker who can create hardlinks to the executable can potentially control `/proc/self/exe`. On modern Linux this should normally require permission to write to the executable.

I did some web research for "argv0 vulnerability" and similar terms and didn't find anything else we should be documenting here. (There are issues about argc=0 but those should be prevented by memory safety in Rust.)

I found what the link seemed to be pointing to in <https://vulners.com/cve/CVE-2009-1894>, which talks about confusing a setuid program by creating a hardlink to its exe. I think this is in very particular circumstances something people should still be concerned about: a setuid program on a machine with `fs.protected_hardlinks = 0`. I don't think this justifies warning people not to use the function at all.

cc @mgeisler
2026-02-27 14:05:33 +01:00
Jonathan Brouwer 5a8a757292 Rollup merge of #153179 - jieyouxu:force-ci-llvm-stamp, r=madsmtm
Force a CI LLVM stamp bump

To see if this helps with rust-lang/rust#153127.
2026-02-27 14:05:32 +01:00
Jonathan Brouwer e95cbb6da6 Rollup merge of #153175 - Zalathar:load-green, r=petrochenkov
Clarify a confusing green-path function

The current name of this function, `try_load_from_disk_and_cache_in_memory`, is confusing on a number of levels:

- Trying to mark the node green is load-bearing even for queries that never cache to disk.
- It will only return None if it fails to mark the query green; the subsequent parts always return Some.
- If it cannot load a value from disk, it will obtain a value by invoking the query provider.
- It is not actually responsible for storing values in the in-memory cache; that is handled by an outer layer.

This PR therefore:
- Hoists the try-mark-green out of that function, making the function always return a value.
- Renames the function to `load_from_disk_or_invoke_provider_green `.
- Renames a few other local variables in passing.

There should be no change to compiler behaviour.
2026-02-27 14:05:32 +01:00
Jonathan Brouwer 383ef53b9a Rollup merge of #153012 - Zalathar:lexical, r=petrochenkov
Stop using `LinkedGraph` in `lexical_region_resolve`

There are only two users of the older `LinkedGraph` data structure, and this is one.

It turns out that this diagnostic-related code doesn't need any non-trivial graph operations (since it does its own graph traversal); it just needs the ability to get a list of in-edges or out-edges (constraints) for any particular node. That's easy enough to do with a simple custom data structure.

Inspired by https://github.com/rust-lang/rust/pull/152621, which wants to make changes to `LinkedGraph` that wouldn't make sense for this use-site.
2026-02-27 14:05:31 +01:00
Jonathan Brouwer 1b897d4f18 Rollup merge of #151143 - folkertdev:tail-call-indirect, r=WaffleLapkin
explicit tail calls: support indirect arguments

tracking issue: https://github.com/rust-lang/rust/issues/112788

After discussion in https://github.com/rust-lang/rust/issues/144855, I was wrong and it is actually possible to support tail calls with `PassMode::Indirect { on_stack: false, .. }` arguments.

Normally an indirect argument with `on_stack: false` would be passed as a pointer into the caller's stack frame. For tail calls, that would be unsound, because the caller's stack frame is overwritten by the callee's stack frame.

Therefore we store the argument for the callee in the corresponding caller's slot. Because guaranteed tail calls demand that the caller's signature matches the callee's, the corresponding slot has the correct type.

To handle cases like the one below, the tail call arguments must first be copied to a temporary, and can only then be copied to the caller's argument slots.

```rust
// A struct big enough that it is not passed via registers.
pub struct Big([u64; 4]);

fn swapper(a: Big, b: Big) -> (Big, Big) {
    become swapper_helper(b, a);
}
```

---

I'm not really familiar with MIR and what tricks/helpers we have, so I'm just cobbling this together. Hopefully we can arrive at something more elegant.
2026-02-27 14:05:30 +01:00
bors 3a70d0349f Auto merge of #152702 - oli-obk:nonnulltransmute, r=scottmcm
Prepare NonNull for pattern types



Pull out the changes that affect some tests, but do not require pattern types.

See https://github.com/rust-lang/rust/pull/136006#discussion_r2806740338 for what triggered this PR

r? @scottmcm
2026-02-27 13:04:46 +00:00
Zalathar c6d028c30a Clarify a confusing green-path function 2026-02-27 22:53:26 +11:00
Jieyou Xu ec7c117cda bootstrap: force a CI LLVM stamp bump
To see if this helps with
<https://github.com/rust-lang/rust/issues/153127>.
2026-02-27 19:24:21 +08:00
Folkert de Vries e6cf5a22e7 test u128 passing on linux and windows 2026-02-27 10:51:55 +01:00
Folkert de Vries 31ae3d2be8 guaranteed tail calls: support indirect arguments 2026-02-27 10:24:39 +01:00
bors 6f54d591c3 Auto merge of #151247 - chenyukang:yukang-fix-const-recover-151149, r=estebank
Try to recover from over-parsing in const item with missing semicolon

Fixes rust-lang/rust#151149

r? @estebank
2026-02-27 09:09:21 +00:00
bors 0ee5907d59 Auto merge of #153145 - ytmimi:rustfmt-subtree-update, r=ytmimi
rustfmt subtree update

r? @ghost
2026-02-27 03:08:01 +00:00
Zalathar 882ae150e9 Work around a false err.emit(); type error in rust-analyzer 2026-02-27 13:06:14 +11:00
randomicon00 9092262255 fix: mem::conjure_zst panic message to use any::type_name instead of stringify! 2026-02-26 20:35:57 -05:00
bors 6a979b3e32 Auto merge of #153108 - alexcrichton:revert, r=joboet
Revert "Simplify internals of `{Rc,Arc}::default`"

This reverts rust-lang/rust#152591 following a [perf run being done](https://github.com/rust-lang/rust/pull/152591#issuecomment-3960081137). I'm not really positioned at this time to dive in further and understand the performance regressions, so I'll back away from `Rc`/`Arc` and leave them as-is.
2026-02-26 19:51:40 +00:00
Yacin Tmimi 02a497826f update Cargo.lock 2026-02-26 12:43:21 -05:00
Yacin Tmimi e9cf384a91 Merge commit 'cebab3e99259be82ff069e5ae89e91855d79e534' into rustfmt-subtree-update 2026-02-26 11:57:15 -05:00
bors 25396cf549 Auto merge of #153139 - JonathanBrouwer:rollup-QZ4yuaa, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153055 ( Revert "Also duplicate `#[expect]` attribute in `#[derive]`-ed code")
 - rust-lang/rust#153095 (Revert "rustc_expand: improve diagnostics for non-repeatable metavars")
2026-02-26 16:39:20 +00:00
Jonathan Brouwer 3e1566da05 Rollup merge of #153095 - JonathanBrouwer:revert, r=lqd
Revert "rustc_expand: improve diagnostics for non-repeatable metavars"

Revert because of a perf regression in https://github.com/rust-lang/rust/pull/152679
Clean revert

r? @ghost
2026-02-26 16:44:42 +01:00
Jonathan Brouwer fd2950b691 Rollup merge of #153055 - Urgau:revert-152289, r=jdonszelmann
Revert "Also duplicate `#[expect]` attribute in `#[derive]`-ed code"

Turns out rust-lang/rust#152289 doesn't work, not because cloning an attribute doesn't keep the same attribute id, but because `#[cfg]` and `#[cfg_attr]` [re-parse items from scratch](https://github.com/rust-lang/rust/blob/859951e3c7c9d0322c39bad49221937455bdffcd/compiler/rustc_builtin_macros/src/cfg_eval.rs#L100-L109) bypassing any cloning on AST and forcing the creation of new attribute IDs. 😕

Fixes rust-lang/rust#153036
Fixes rust-lang/rust#152401
Reopens rust-lang/rust#150553
2026-02-26 16:44:42 +01:00
mu001999 dfd18b7e89 Print path root when printing path 2026-02-26 23:34:41 +08:00
Yacin Tmimi cebab3e992 chore: prep v1.9.0 release 2026-02-26 10:14:48 -05:00
Yacin Tmimi 65a91e6ead Update CHANGELOG for v1.9.0 release (#6811) 2026-02-26 09:37:52 -05:00
bors bb779a9156 Auto merge of #153124 - JonathanBrouwer:rollup-3OajkjU, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#153079 (Revert "Move aarch64-apple dist builder to dynamic llvm linking")
 - rust-lang/rust#152651 (Avoid duplicate `requirement` diag args in `RegionOriginNote`)
 - rust-lang/rust#152978 (Port `#[rustc_autodiff]` to the attribute parser infrastructure)
 - rust-lang/rust#153091 (Migration of `LintDiagnostic` - part 4)
 - rust-lang/rust#153112 (Query key cleanups)
 - rust-lang/rust#153118 (mailmap: add redddy)
 - rust-lang/rust#153120 (Clean up some code related to `QueryVTable::execute_query_fn`)
2026-02-26 12:20:45 +00:00
mu001999 d79efc5d00 Recover feature lang_items for emscripten 2026-02-26 19:29:31 +08:00
Jonathan Brouwer 3eafea8d3a Rollup merge of #153120 - Zalathar:execute, r=nnethercote
Clean up some code related to `QueryVTable::execute_query_fn`

This PR is an assortment of small cleanups to code that interacts with `execute_query_fn` in the query vtable.

I also experimented with trying to replace the macro-generated `__rust_end_short_backtrace` functions with a single shared generic function, but I couldn't manage to avoid breaking short backtraces, so I left a note behind to document my attempt.

r? nnethercote (or compiler)
2026-02-26 09:57:06 +01:00
Jonathan Brouwer 272d523b57 Rollup merge of #153118 - reddevilmidzy:mailmap, r=jieyouxu
mailmap: add redddy

I changed the email address used for git.
2026-02-26 09:57:06 +01:00
Jonathan Brouwer 8386f94903 Rollup merge of #153112 - nnethercote:query-key-stuff, r=nnethercote
Query key cleanups

The first three commits are simple. The last two are a bit more opinionated, see what you think.

r? @Zalathar
2026-02-26 09:57:05 +01:00
Jonathan Brouwer c902bc1c7c Rollup merge of #153091 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Migration of `LintDiagnostic` - part 4

Follow-up of:
* https://github.com/rust-lang/rust/pull/152933
* https://github.com/rust-lang/rust/pull/153016
* rust-lang/rust#153051

More `LintDiagnostic` items being migrated to `Diagnostic`. Since there is no remaining `emit_node_span_lint` calls, I replaced the method with the code of `emit_diag_node_span_lint`.

r? @JonathanBrouwer
2026-02-26 09:57:04 +01:00
Jonathan Brouwer 51492d0d59 Rollup merge of #152978 - JonathanBrouwer:autodiff_attrs, r=jdonszelmann
Port `#[rustc_autodiff]` to the attribute parser infrastructure

For https://github.com/rust-lang/rust/issues/131229

r? @jdonszelmann
cc @ZuseZ4

`autodiff_forward` and `autodiff_reverse` can be ported in a seperate PR, but these are expanded in the AST and don't exist anymore in the HIR so this is a bit more of a challenge.
2026-02-26 09:57:04 +01:00
Jonathan Brouwer 81aa532b7f Rollup merge of #152651 - TaKO8Ki:fix-143872-compare-impl-item-diag-args, r=jdonszelmann
Avoid duplicate `requirement` diag args in `RegionOriginNote`

Fixes rust-lang/rust#143872

`RegionOriginNote::WithRequirement` can be emitted multiple times for one
  diagnostic. I fixed the ICE by scoping per note fluent args in `RegionOriginNote::WithRequirement` with `store_args` and `restore_args`.
2026-02-26 09:57:03 +01:00
Jonathan Brouwer 7aa4f04b64 Rollup merge of #153079 - RalfJung:revert-macos-dyn, r=jieyouxu
Revert "Move aarch64-apple dist builder to dynamic llvm linking"

Reverts c033de932e (part of https://github.com/rust-lang/rust/pull/152768) in order to fix  https://github.com/rust-lang/rust/issues/153077.
2026-02-26 09:57:02 +01:00
Jonathan Brouwer d5b6474607 Remove attributes from check_attr that were already parsed 2026-02-26 09:50:36 +01:00
Jonathan Brouwer 5cd5b90a38 Port rustc_autodiff to the attribute parsers 2026-02-26 09:50:36 +01:00
Guillaume Gomez f9b70f0ef2 Migrate rustc_lint::EqInternalMethodImplemented to Diagnostic 2026-02-26 09:47:06 +01:00
Jonathan Brouwer 90c93ab7c1 Move rustc_ast::AutoDiffAttrs to rustc_hir::RustcAutodiff 2026-02-26 09:41:21 +01:00