Commit graph

308340 commits

Author SHA1 Message Date
Camille Gillot
973ddd8bc7 Do not invalidate CFG caches in CtfeLimit. 2025-10-08 15:03:43 +00:00
Folkert de Vries
bd5f908152
cmse: simplify input/output check control flow 2025-10-08 16:36:49 +02:00
Folkert de Vries
760ea07840
cmse: more accurate span for generic arguments 2025-10-08 16:36:45 +02:00
Folkert de Vries
98d3864310
cmse: rephrase error message when signature uses generics 2025-10-08 16:36:45 +02:00
Folkert de Vries
b47de64cdb
cmse: rephrase error message when types don't fit 2025-10-08 16:36:18 +02:00
Folkert de Vries
f4d8bd3b47
cmse: more accurate spans for excess parameters
Use the span of the types that don't fit, rather than the span of the
whole signature.
2025-10-08 16:21:50 +02:00
Matthias Krüger
359bfa901b
Rollup merge of #147472 - AMS21:remove_llvm_rust_atomics, r=nikic
refactor: replace `LLVMRustAtomicLoad/Store` with LLVM built-in functions

This simplifies the code and reduces the burden of maintaining our own wrappers.

Work towards https://github.com/rust-lang/rust/issues/46437
2025-10-08 15:39:28 +02:00
Matthias Krüger
f6caa5f68f
Rollup merge of #147469 - Jamesbarford:fix/crate-error-message, r=GuillaumeGomez
Add rustdoc crate name in error

Fixes https://github.com/rust-lang/rust/issues/147458

I'm not entirely sure if what I am doing with the span is correct
2025-10-08 15:39:28 +02:00
Matthias Krüger
795bbaa37b
Rollup merge of #147464 - RalfJung:repeat, r=saethlin
prefer repeat_n() over repeat().take()
2025-10-08 15:39:27 +02:00
Matthias Krüger
94ed5c77b4
Rollup merge of #147412 - yaahc:macro-res-assertions, r=petrochenkov
Convert impossible cases in macro resolution into assertions

associated discussion with `@petrochenkov:` [#t-compiler/help > understanding early name resolution of imports @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/understanding.20early.20name.20resolution.20of.20imports/near/542936677)
2025-10-08 15:39:27 +02:00
Matthias Krüger
5c1302249d
Rollup merge of #147386 - cyrgani:proc-macro-cleanup-2, r=petrochenkov
some more `proc_macro` cleanups

Several smaller cleanups to `proc_macro`. Commits 1 and 3 seem pretty trivial to me, commit 2 might be worth it or not.

Followup to rust-lang/rust#147166.
2025-10-08 15:39:26 +02:00
Matthias Krüger
193a28d9b4
Rollup merge of #144006 - dianne:match-ergonomics-jargon, r=Nadrieril
clarify wording of match ergonomics diagnostics (`rust_2024_incompatible_pat` lint and error)

Partially addresses rust-lang/rust#143557:
- Uses different wording than the Edition Guide chapter, to hopefully stand alone a bit better. Instead of referring to the "default binding mode", it now talks about what can't be written "within elided reference patterns". I ended up going with "elided" instead of "implicit" in hope that it reads bit less like it should behave the same as an explicit reference pattern, but I'm not totally happy with that wording.
- The explanatory note still points to where the default binding mode was introduced, but only refers to its effect, not what we call it. How that relates to the rest of the diagnostic may still be a bit of a puzzle, but hopefully it isn't too much of one? It also doesn't make sense anymore for the case of `&` written under a by-ref binding mode, so I've left the note out in that case (but kept the label). It's more cramped, but talking about binding modes would feel like a non-sequitur for the error about `&` patterns without further explanation.
- Links to the stable version of the Edition Guide instead of the nightly version. It looks like almost every link to the Edition Guide in diagnostics is to the nightly version, presumably for the same reason as here: the diagnostics were added before the new Edition was stabilized, then never updated. I'll make a separate PR to clean up the others.

This only changes the diagnostic messages, not the code suggestion or the Edition Guide.

r? `@Nadrieril` or reassign
2025-10-08 15:39:25 +02:00
Chayim Refael Friedman
0580059e43
Merge pull request #20785 from ChayimFriedman2/drop-glue
internal: Migrate drop glue handling to new solver
2025-10-08 13:24:17 +00:00
Chayim Refael Friedman
0553ec9752 Migrate drop glue handling to new solver
And:
 - Remove it from being a query (it is only used for hover, where no caching is needed, and MIR evaluation of `needs_drop()`, which is rare).
 - Fix handling of `PhantomData`.
2025-10-08 16:14:22 +03:00
dianne
444eb4cc12 assert that non-extended temporaries have scopes 2025-10-08 06:12:09 -07:00
bors
910617d84d Auto merge of #147443 - krtab:dosreplaceonlywhenneeded, r=GuillaumeGomez
[rustdoc] a small performance improvement: only allocate new string if there are DOS backlines in highlight.rs

r? `@GuillaumeGomez`
2025-10-08 12:54:27 +00:00
Jynn Nelson
fa9162d06f Allow printing a fully-qualified path in def_path_str
Previously, the local crate would always be printed as a leading `crate::`.
Allow resolving it to the crate name instead.

This allows printing a fully qualified path with:
```rust
let qualified_name = with_no_visible_paths!(with_resolve_crate_name!(
    with_no_trimmed_paths!(tcx.def_path_str(def_id))
));
```

I found this useful for an out-of-tree rustc-driver. I do not currently
have a usecase in mind upstream; I'm ok if you don't want this PR for
that reason.

This does not currently have tests. I am not aware of an easy way to
test def-id printing, since it requires having access to a TyCtxt.
2025-10-08 08:38:25 -04:00
Camille Gillot
5da52f57c5 Evaluate constants lazily in GVN. 2025-10-08 12:23:31 +00:00
AMS21
1aed495ed7
refactor: replace LLVMRustAtomicLoad/Store with LLVM built-in functions 2025-10-08 13:53:09 +02:00
Folkert de Vries
f62be66e94
cmse: additional impl Trait tests 2025-10-08 13:25:12 +02:00
Scott Gerring
8ef90574a2
chore: update manual_assert span suggestions 2025-10-08 11:58:50 +01:00
James Barford-Evans
2c1e796ed0 Improve missing create level error message 2025-10-08 11:35:20 +01:00
Zalathar
a282336c5c Extract most code from define_feedable! 2025-10-08 20:58:09 +11:00
Zalathar
cb0c092c78 Prepare define_feedable! for code extraction 2025-10-08 20:58:09 +11:00
Zalathar
b97bdcb0a0 Extract query-method inner functions to query::inner 2025-10-08 20:58:04 +11:00
bors
82224f6891 Auto merge of #147466 - jdonszelmann:rollup-swfblpr, r=jdonszelmann
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146385 (rustdoc-search: redesign throbber to be less distracting)
 - rust-lang/rust#147390 (Use globals instead of metadata for std::autodiff)
 - rust-lang/rust#147445 (sort attribute targets for more consistent error messages)
 - rust-lang/rust#147448 (collect-license-metadata: update submodules before running)
 - rust-lang/rust#147451 (fix panic with extra-const-ub-checks)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-08 09:37:26 +00:00
Julien Cretin
594f9c6c4f Clarify how to remediate the panic_immediate_abort error
Users who build `core` for the sole purpose of enabling `panic_immediate_abort` might expect
"`panic_immediate_abort` is now a real panic strategy" to mean that setting `panic =
"immediate-abort"` in `Cargo.toml` or `-Cpanic=immediate-abort` in `RUSTFLAGS` to be sufficient for
migration. But this is not the case, `core` still needs to be built for those changes to take
effect.

See https://github.com/rust-lang/rust/issues/146974 for additional context.
2025-10-08 11:35:39 +02:00
Ralf Jung
8066cbc07a readme: document how to directly invoke the driver 2025-10-08 11:31:28 +02:00
dianne
ec99e3eca2 clarify wording of match ergonomics diagnostics 2025-10-08 02:12:24 -07:00
A4-Tacks
e8d57e9672
Add self param completions for trait assoc fn
Example
---
```rust
trait A {
    fn foo(file_id: usize) {}
    fn new($0) {}
}
```

**Before this PR**:

```text
bn file_id: usize
kw mut
kw ref
```

**After this PR**:

```text
bn &mut self
bn &self
bn file_id: usize
bn mut self
bn self
kw mut
kw ref
```
2025-10-08 16:20:10 +08:00
Jana Dönszelmann
cf63f1578c
Rollup merge of #147451 - RalfJung:extra-const-ice, r=chenyukang
fix panic with extra-const-ub-checks

Fixes https://github.com/rust-lang/rust/issues/147306
2025-10-08 10:06:58 +02:00
Jana Dönszelmann
8356f6b18a
Rollup merge of #147448 - jyn514:reuse-submodules, r=kobzol
collect-license-metadata: update submodules before running

Previously, this could cause incorrect failures like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..b1291c00b94 100644
--- a/license-metadata.json
+++ b/license-metadata.json
`@@` -244,19 +172,6 `@@`
             },
             "name": "src/doc/rustc-dev-guide/mermaid.min.js",
             "type": "file"
-          },
-          {
-            "children": [],
-            "license": {
-              "copyright": [
-                "2003-2019 University of Illinois at Urbana-Champaign",
-                "2003-2019 by the contributors listed in CREDITS.TXT (7738295178/llvm/CREDITS.TXT)",
-                "2010 Apple Inc"
-              ],
-              "spdx": "Apache-2.0 WITH LLVM-exception AND NCSA"
-            },
-            "name": "src/llvm-project",
-            "type": "directory"
```

Additionally, this prints a warning if there were untracked files, which could cause a failure like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..ebf1c478282 100644
--- a/license-metadata.json
+++ b/license-metadata.json
`@@` -155,6 +155,22 `@@`
             "name": "src/librustdoc/html/static/fonts",
             "type": "directory"
           },
+          {
+            "directories": [],
+            "files": [
+              "2015-edition.txt",
+              "diagnostics.json",
+              "license.diff",
+              "test.fixed.rs"
+            ],
+            "license": {
+              "copyright": [
+                "NONE"
+              ],
+              "spdx": "NONE"
+            },
+            "type": "group"
+          },
           {
             "license": {
               "copyright": [
```

r? `@Kobzol` cc rust-lang/rust#147422
2025-10-08 10:06:57 +02:00
Jana Dönszelmann
4f24b61c33
Rollup merge of #147445 - jdonszelmann:sort-targets, r=JonathanBrouwer
sort attribute targets for more consistent error messages

In this PR I noticed that we don't sort attribute targets, so a rather trivial change to the source changed the ordering in an error message even though its meaning stayed the same.

See: https://github.com/rust-lang/rust/pull/147418#discussion_r2410852750

I think sorting might be a good thing to do in general. I also prefer it when reading error messages. Quite a few tests changed, but not in meaning, only sorting order obviously.

r? `@jieyouxu`
2025-10-08 10:06:56 +02:00
Jana Dönszelmann
27b3881df8
Rollup merge of #147390 - ZuseZ4:autodiff-dbg, r=jieyouxu
Use globals instead of metadata for std::autodiff

LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions.
Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests.

r? compiler
2025-10-08 10:06:55 +02:00
Jana Dönszelmann
291e12937b
Rollup merge of #146385 - notriddle:no-anim, r=GuillaumeGomez
rustdoc-search: redesign throbber to be less distracting

Preview: https://notriddle.com/rustdoc-html-demo-12/throbber/std/index.html

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/da838ee0-3f7a-4b10-ba92-f9ac52e9f723" />

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/b5a59fc0-5d07-4981-b1dd-0b60556a0dd5" />

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/bb587660-7b6c-40e1-a7ae-2270d530dcd4" />

Complaints about it being distracting, and causing people to wait until all of the results are loaded instead of using the incremental results as they come in, make me think it was a bad idea to put it in the tab.

Part of https://github.com/rust-lang/rust/issues/146048
2025-10-08 10:06:54 +02:00
Ralf Jung
70a357a4c6 prefer repeat_n() over repeat().take() 2025-10-08 09:04:22 +02:00
Zalathar
c33b667e8b Hoist stranded use declarations 2025-10-08 17:59:22 +11:00
Jana Dönszelmann
1dbe831e47
sort attribute targets for more consistent error messages 2025-10-08 08:32:03 +02:00
bors
5767910cbc Auto merge of #147423 - nnethercote:DepNodeColor-tweaks, r=cjgillot
`DepNodeColor` tweaks

A follow-up to rust-lang/rust#147293, where I attempted and mostly failed to make things faster again, but I found a few cleanups worth doing.

r? `@saethlin`
2025-10-08 06:27:59 +00:00
Ralf Jung
14212c59b7
Merge pull request #4619 from rust-lang/rustup-2025-10-08
Automatic Rustup
2025-10-08 06:22:54 +00:00
The Miri Cronjob Bot
f59d761bc4 Merge ref '4fd3181552' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 4fd3181552
Filtered ref: ee72bb093dfd84655bc02a8ee4b65327b14cecb3
Upstream diff: 3b8665c5ab...4fd3181552

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-08 05:00:44 +00:00
The Miri Cronjob Bot
5446a0ae0a Prepare for merging from rust-lang/rust
This updates the rust-version file to 4fd3181552.
2025-10-08 04:52:55 +00:00
Manuel Drehwald
218fa60795 update ui test since the new frontend is a bit more lenient 2025-10-07 20:13:59 -04:00
Manuel Drehwald
52e7917586 Use globals instead of metadata, since metadata isn't emitted in debug builds 2025-10-07 20:13:59 -04:00
Manuel Drehwald
dcc36a8642 add incremental/debug test for autodiff 2025-10-07 20:13:56 -04:00
bors
4fd3181552 Auto merge of #147111 - BoxyUwU:rename_obligation_processing_apis, r=lcnr
rename `select_where_possible` and `select_all_or_error`

r? `@lcnr`

I find that people get confused by what these methods do. The verb "select" is not really that helpful and is just a reference to somewhat of an implementation detail of the trait solvers that doesn't even apply to most obligation kinds.

I went with `try_evaluate_obligations` and  `evaluate_obligations_error_on_ambiguity`. This maintains consistency with the new solvers `evalute_goal` entry point. it's unfortunate that we say obligations rather than goals but this maintains consistency with `register_obligation` functions which I think is a good thing. In the long term possibly we rename `Obligation` or `Goal` 🤷‍♀️
2025-10-07 23:57:38 +00:00
vishruth-thimmaiah
27afeb0085
feat: add support for libc::memset
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
2025-10-08 03:43:35 +05:30
Boxy Uwu
f6336bc8e4 rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
Boxy Uwu
8e9b0c4ca9 rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
Jane Losare-Lusby
6920a8e8fc Convert impossible cases in macro resolution into assertions 2025-10-07 14:48:28 -07:00