Commit Graph

167156 Commits

Author SHA1 Message Date
Shoyu Vanilla (Flint) 986bb35e75 Merge pull request #20526 from A4-Tacks/postfix-let-in-let-chain
Fix .let completion not work for let-chain
2025-10-10 10:07:31 +00:00
vishruth-thimmaiah afea346b35 feat: add failing test for zero-sized memset
Signed-off-by: vishruth-thimmaiah <vishruththimmaiah@gmail.com>
2025-10-10 14:55:09 +05:30
Shoyu Vanilla (Flint) 65920fefee Merge pull request #20801 from ChayimFriedman2/fix-insert-use
minor: Small fixes for import insertion
2025-10-10 08:28:42 +00:00
Shoyu Vanilla (Flint) 31ffd29024 Merge pull request #20816 from A4-Tacks/add-ret-ty-adjusted
Fix closure coerced return type for add_return_type
2025-10-10 08:25:25 +00:00
Shoyu Vanilla (Flint) d8b67b0fb6 Merge pull request #20817 from A4-Tacks/explicit-ty-param-in-let
Fix not applicable on param in let-stmt for add_explicit_type
2025-10-10 08:18:32 +00:00
A4-Tacks 45ca9b5a4c Fix empty closure completion analysis
Example
---
```rust
fn foo() {
    bar(|| $0);
}
fn bar(f: impl FnOnce() -> u32) {}
```

**Before this PR**:

```
ty: impl FnOnce() -> u32, name: ?
```

**After this PR**:

```
ty: u32, name: ?
```
2025-10-10 12:53:32 +08:00
Jakub Beránek da86710c30 Rename default linker linux field 2025-10-09 17:19:23 +02:00
Young-Flash 56cf2f21cd minor: correct typos 2025-10-09 20:07:24 +08:00
Young-Flash c0d82ccbe9 minor: update typos checker version 2025-10-09 20:04:39 +08:00
Zalathar f3f83857d9 Use the same directive lines for EarlyProps and ignore/only/needs 2025-10-09 23:00:51 +11:00
bors 4b57d8154a Auto merge of #147519 - Zalathar:rollup-o5f16uo, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#147446 (PassWrapper: use non-deprecated lookupTarget method)
 - rust-lang/rust#147473 (Do `x check` on various bootstrap tools in CI)
 - rust-lang/rust#147509 (remove intrinsic wrapper functions from LLVM bindings)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-09 10:54:43 +00:00
dianqk d4edd67f71 Update LLVM to 21.1.3 2025-10-09 18:23:56 +08:00
Zalathar 0be0a0a8d2 Do x check on various bootstrap tools in CI 2025-10-09 20:00:30 +11:00
Zalathar 7374789331 Support x check rustdoc-gui-test
This is useful for ensuring that changes to compiletest haven't broken
rustdoc-gui-test.
2025-10-09 19:58:52 +11:00
Stuart Cook 76d4f37c40 Rollup merge of #147506 - Zalathar:isolate, r=jieyouxu
compiletest: Isolate public APIs and minimize public surface area

As part of my ongoing efforts to improve directive parsing, I would like to be able to make internal changes without worrying about whether they're going to break the rustdoc-gui-test tool. That tool currently uses compiletest as a dependency to help with directive parsing.

This PR therefore isolates all of compiletest's public APIs into two dedicated modules, one used by rustdoc-gui-test, and one used by the compiletest binary in `compiletest/src/bin/main.rs`.

All other modules (and crate-root items) are then made non-`pub` to achieve the API isolation. Doing so reveals some unused items, which have been removed.

(To reduce the amount of immediate textual churn, this PR does not comprehensively replace `pub` with `pub(crate)` throughout the whole crate; that could be done in a follow-up PR.)

---

Ideally, rustdoc-gui-test would not depend on compiletest at all, but properly fixing that is out of scope for this PR.
- rust-lang/rust#143827

r? jieyouxu
2025-10-09 18:43:27 +11:00
Stuart Cook 68f9b3b5e9 Rollup merge of #147419 - cuviper:bootstrap-rustc-libs, r=Zalathar,jieyouxu
bootstrap: add `Builder::rustc_cmd` that includes the lib path

When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.
2025-10-09 18:43:21 +11:00
Stuart Cook fd6546d514 Rollup merge of #146568 - sayantn:simd-shuffle, r=RalfJung
Port the implemention of SIMD intrinsics from Miri to const-eval

Ported the implementation of most SIMD intrinsics from Miri to rustc_const_eval. Remaining are

 - Math functions (as per `@RalfJung's` suggestions)
 - FMA (non-deterministic)
 - Funnel Shifts (not implemented in Miri yet)
 - Unordered reduction intrinsics (not implemented in Miri yet)
2025-10-09 18:43:20 +11:00
A4-Tacks 9a64aebd61 Fix not applicable on param in let-stmt for add_explicit_type
Example
---
```rust
fn f() {
    let f: fn(i32) = |y$0| {};
}
```

**Before this PR**:

Assist not applicable

**After this PR**:

```rust
fn f() {
    let f: fn(i32) = |y: i32| {};
}
```
2025-10-09 13:23:14 +08:00
A4-Tacks cd77365714 Fix closure coerced return type for add_return_type
Example
---
```rust
fn foo() {
    let f = ||$0 {loop {}};
    let _: fn() -> i8 = f;
}
```

**Before this PR**:

```rust
fn foo() {
    let f = || -> ! {loop {}};
    let _: fn() -> i8 = f;
}
```

mismatched types error on line 3

**After this PR**:

```rust
fn foo() {
    let f = || -> i8 {loop {}};
    let _: fn() -> i8 = f;
}
```
2025-10-09 11:43:29 +08:00
Zalathar ce4699deff compiletest: Make all other modules non-public
All APIs used from outside the compiletest library crate have been isolated to
the `cli` and `rustdoc_gui_test` modules, so no other items need to be publicly
exported.
2025-10-09 14:34:01 +11:00
Zalathar b4f64fda4f compiletest: Isolate APIs used by bin/main.rs 2025-10-09 14:34:01 +11:00
Zalathar 8f0815602c compiletest: Isolate APIs used by rustdoc-gui-test 2025-10-09 14:34:01 +11:00
Chayim Refael Friedman c7921c6115 Merge pull request #20805 from A4-Tacks/improve-static-const-parse-error
Improve parsing error for `static` and `const`
2025-10-09 03:09:29 +00:00
bors bd3487101f Auto merge of #143227 - tshepang:asm-label-operand, r=Amanieu
add multi-arch asm! label operand test

Added this since the other label operand tests are only for x86
2025-10-09 02:23:38 +00:00
A4-Tacks fae6cdf0db Allow generic_param_list for static items 2025-10-09 09:45:42 +08:00
Chayim Refael Friedman ad1b9cb19a Merge pull request #20804 from itsjunetime/run_correct_pgo_r-a
Build rust-analyzer with `--target` for install/pgo xtask
2025-10-08 23:40:31 +00:00
Chayim Refael Friedman 633b1690c5 Merge pull request #20812 from A4-Tacks/comp-trait-self-param
Add self param completions for trait assoc fn
2025-10-08 23:28:22 +00:00
Alex Crichton 4b6bc9a66b Update wasm-component-ld to 0.5.18
Keeping it up-to-date with upstream for the latest bug fixes and such
related to wasm-tools-implemented internals.
2025-10-08 13:20:42 -07:00
bors 7a52736039 Auto merge of #147475 - matthiaskrgr:rollup-iyrkv0g, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#144006 (clarify wording of match ergonomics diagnostics (`rust_2024_incompatible_pat` lint and error))
 - rust-lang/rust#147386 (some more `proc_macro` cleanups)
 - rust-lang/rust#147412 (Convert impossible cases in macro resolution into assertions)
 - rust-lang/rust#147464 (prefer repeat_n() over repeat().take())
 - rust-lang/rust#147469 (Add rustdoc crate name in error)
 - rust-lang/rust#147472 (refactor: replace `LLVMRustAtomicLoad/Store` with LLVM built-in functions)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-08 16:07:07 +00:00
U. Lasiotus 8fad3a17ca tidy: allow stdlib to depend on moto-rt
As part of work to add stdlib support for Motor OS.
2025-10-08 08:57:58 -07:00
sayantn 45ca537746 Port the Miri implementations of SIMD intrinsics to rustc_const_eval 2025-10-08 21:05:19 +05:30
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
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
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
James Barford-Evans 2c1e796ed0 Improve missing create level error message 2025-10-08 11:35:20 +01:00
Ralf Jung 8066cbc07a readme: document how to directly invoke the driver 2025-10-08 11:31:28 +02: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 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 (https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/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 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
The Miri Cronjob Bot f59d761bc4 Merge ref '4fd31815524b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 4fd3181552
Filtered ref: ee72bb093dfd84655bc02a8ee4b65327b14cecb3
Upstream diff: https://github.com/rust-lang/rust/compare/3b8665c5ab3aeced9b01672404c3764583e722ca...4fd31815524baba0bf368f151f757101f432e3de

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
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 8e9b0c4ca9 rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
bors f6aa851dba Auto merge of #147453 - matthiaskrgr:rollup-z3db8zi, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#146865 (kcfi: only reify trait methods when dyn-compatible)
 - rust-lang/rust#147205 (Add a new `wasm32-wasip3` target to Rust)
 - rust-lang/rust#147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`)
 - rust-lang/rust#147398 (Fix; correct placement of type inference error for method calls)
 - rust-lang/rust#147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels)
 - rust-lang/rust#147422 (collect-license-metadata: Print a diff of the expected output)
 - rust-lang/rust#147431 (compiletest: Read the whole test file before parsing directives)
 - rust-lang/rust#147433 (Fix doc comment)

Failed merges:

 - rust-lang/rust#147390 (Use globals instead of metadata for std::autodiff)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-07 20:47:13 +00:00
Michael Howell 6d4b4d9ef0 rustdoc-search: keep hourglass in searchbar 2025-10-07 11:51:50 -07:00
Matthias Krüger 7b2e9fb442 Rollup merge of #147431 - Zalathar:directive, r=jieyouxu
compiletest: Read the whole test file before parsing directives

Few tests are larger than a handful of kilobytes, and nowadays we scan the whole file for directives anyway, so there's little reason not to just read the whole thing up-front.

This avoids having to deal with I/O within `iter_directives`, which should make it easier to overhaul directive processing.

r? jieyouxu
2025-10-07 19:39:10 +02:00
Matthias Krüger 68656b7579 Rollup merge of #147422 - jyn514:license-diff, r=Kobzol
collect-license-metadata: Print a diff of the expected output

Previously, `x test collect-license-metadata` gave the following message on errors:
```
gathering license information from REUSE (this might take a minute...)
finished gathering the license information from REUSE in 78.69s
loading existing license information
The existing /home/runner/work/ferrocene/ferrocene/license-metadata.json
file is out of date.
Run ./x run collect-license-metadata to update it.
Error: The existing
/home/runner/work/ferrocene/ferrocene/license-metadata.json file doesn't
match what REUSE reports.
Bootstrap failed while executing `test collect-license-metadata`
```

Notable, this doesn't actually say what went wrong. Print a diff in addition so it's more clear what broke:
```
...
                "license": {
                   "copyright": [
+                    "2010 The Rust Project Developers",
                     "2016, 2017, 2018, 2019, 2020, 2021 AXE Consultants. All Rights",
+                    "License. Subject to the terms and conditions of this",
                     "Notice",
-                    "The Ferrocene Developers"
+                    "The Ferrocene Developers",
+                    "[yyyy] [name of copyright owner]"
                   ],
...
```

Currently, this prints the entire text of the JSON file as context. That's not ideal, but it's rare for this to fail, so I think it's ok for now.

I considered using `assert_json_diff` instead of `similar`, but its errors are a lot harder to read IMO, even though they are better at omitting unnecessary context:

```
Diff: json atoms at path ".files.children[0].children[10].license.copyright[0]" are not equal:
    lhs:
        "2016 The Fuchsia Authors"
    rhs:
        "2019 The Crossbeam Project Developers"

json atoms at path ".files.children[0].children[10].license.spdx" are not equal:
    lhs:
        "BSD-2-Clause AND (Apache-2.0 OR MIT)"
    rhs:
        "Apache-2.0 OR MIT"

json atom at path ".files.children[0].children[10].children" is missing from lhs

json atoms at path ".files.children[0].children[10].name" are not equal:
    lhs:
        "library/std/src/sys/sync/mutex/fuchsia.rs"
    rhs:
        "library/std/src/sync/mpmc"
...
```
2025-10-07 19:39:09 +02:00
Matthias Krüger 60bbb533df Rollup merge of #147205 - alexcrichton:wasip3, r=davidtwco
Add a new `wasm32-wasip3` target to Rust

This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This follows in the footsteps of the previous `wasm32-wasip2` target and is used to represent binding to the WASIp3 set of APIs managed by the WASI subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized. They're in the process of doing so and the current trajectory is to have the APIs published in December of this year. The goal here is to get the wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as `wasm32-wasip2` except that `target_env = "p3"` is specified. This indicates to crates in the ecosystem that WASIp3 APIs should be used, such as the [`wasip3` crate]. Over time this target will evolve as implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added to the WASIp3-track of targets to enable using `std::thread`, for example, on this target.

These changes are all expected to be non-breaking changes for users of this target. Runtimes supporting WASIp3, currently Wasmtime and Jco, support WASIp2 APIs as well and will work with components whether or not they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This means that changing the internal implementation details of libstd over time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
2025-10-07 19:39:07 +02:00
Josh Stone 03cdcb5cd5 bootstrap: add Builder::rustc_cmd that includes the lib path
When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.
2025-10-07 09:55:55 -07:00