Commit graph

308340 commits

Author SHA1 Message Date
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
Nicholas Nethercote
5d0007627a Clarify and improve EdgesVec::INLINE_CAPACITY use.
`INLINE_CAPACITY` has two different uses:
- It dictates the inline capacity of `EdgesVec::edges`, which is a
  `SmallVec`.
- It dictates when `TaskDeps` switches from a linear scan lookup to a
  hashset lookup to determine if an edge has been seen before.

These two uses are in the same part of the code, but they're
fundamentally separate and don't need to use the same constant.

This commit separates the two uses, and adds some helpful comments,
making the code clearer. It also changes the value used for the
linear/hashset threshold from 8 to 16, which gives slightly better perf.
2025-10-09 16:12:50 +11:00
Samuel Tardieu
c425389f18
Cleanup: do not handle methods from several places
Some methods lints were handled in the `methods` module outside the
`check_methods()` function.
2025-10-09 06:45:30 +02: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
Yukang
6fd1c2bd94 add doc alias for set_times
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2025-10-08 20:38:56 -07:00
Yukang
1dd5641d74 add doc alias for set_times_nofollow
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2025-10-08 20:38:56 -07:00
yukang
2438df75fe support fs::set_times for wasi 2025-10-08 20:38:56 -07:00
yukang
46c6f0aade rebase #147504 2025-10-08 20:38:56 -07:00
yukang
1c5c8caad2 use proper unsupported 2025-10-08 20:38:52 -07: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
Nicholas Nethercote
43e813c559 Replace TaskDeps::default() with TaskDeps::new().
There are only two places that create a `TaskDeps`. One constructs it
manually, the other uses `default`. It's weird that `default()` uses a
capacity of 128.

This commit just gets rid of `default` and introduces `new` so that
both construction sites can be equivalent.
2025-10-09 14:03:11 +11:00
Yukang
6308e76cd7 Update library/std/src/fs.rs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2025-10-09 10:33:35 +08:00
Yukang
3d40fa6958 Update library/std/src/fs.rs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2025-10-09 10:33:35 +08:00
yukang
722545427f Implement fs api set_times and set_times_nofollow 2025-10-09 10:33:29 +08: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
Nicholas Nethercote
38d7e8b502 Rename a badly-named variable. 2025-10-09 13:22:43 +11:00
A4-Tacks
fae6cdf0db
Allow generic_param_list for static items 2025-10-09 09:45:42 +08:00
Nicholas Nethercote
cc69b42519 Use contains with task_deps.reads. 2025-10-09 11:18:49 +11:00
Cameron Steffen
735ddcc05a Split overlapping_{inherent,trait}_impls 2025-10-08 18:45:11 -05: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
bors
61efd19024 Auto merge of #147477 - cjgillot:split-call-guards, r=tmiasko
Refactor AddCallGuards in two loops.

This PR splits the pass into an analysis loop and a change loop. This allows to avoid invalidating CFG caches if there are no changes to be performed.

r? `@ghost` for perf
2025-10-08 23:12:38 +00:00
Timo
e70b206665
chore: multipart_suggestions for manual_assert (#13787)
This should address
https://github.com/rust-lang/rust-clippy/issues/13099 for the let_unit
test.

changelog: [manual_assert]: Updated manual_assert to use
multipart_suggestions where appropriate
2025-10-08 21:32:11 +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
Evan Jones
0e2130c2c9
std::thread spawn: Docs: Link to Builder::spawn; Make same.
Replace "use this API instead" with a link to Builder::spawn. Edit
the paragraph to make it slightly clearer.

The Scope::spawn method already included a. Make the docs for the two
nearly the same.
2025-10-08 16:02:31 -04:00
Samuel Tardieu
69bd890ff1
Honor allow/expect attributes on ADT and impl Clone nodes 2025-10-08 22:02:14 +02:00
AMS21
036ab3a925
refactor: Remove LLVMRustInsertPrivateGlobal and define_private_global
Since it can easily be implemented using the existing LLVM C API in
terms of `LLVMAddGlobal` and `LLVMSetLinkage` and `define_private_global`
was only used in one place.
2025-10-08 21:59:48 +02:00
Camille Gillot
5702fbf03d Refactor AddCallGuards in two loops. 2025-10-08 19:44:56 +00:00
Samuel Tardieu
c5a96d49e4
perf(get_unwrap): avoid calling is_type_diagnostic_item multiple times (#15847)
changelog: none
2025-10-08 19:43:59 +00:00
cyrgani
e3d2016a22 inline constants in generated enum Encode impls 2025-10-08 21:32:28 +02:00
cyrgani
0355358e6c run zero-size assertion in const {} 2025-10-08 21:32:27 +02:00
bors
b6f0945e46 Auto merge of #146869 - cjgillot:gvn-lazy-const, r=dianqk
GVN: Evaluate constants lazily.

GVN currently evaluates constants eagerly. This is not necessary. This PR makes constant evaluation on-demand to avoid unnecessary work.

r? `@ghost` for perf
2025-10-08 19:23:26 +00:00
The 8472
99ab27f90c specialize slice::fill to use memset when possible
LLVM generally can do this on its own, but it helps miri and other backends.
2025-10-08 20:14:24 +02:00
yukang
53c79f4523 bless format 2025-10-09 01:29:16 +08:00
Ada Alakbarova
80b886e895
perf(get_unwrap): avoid calling is_type_diagnostic_item multiple times 2025-10-08 19:27:51 +02:00
yukang
affaf532f9 referring to repeat_n in std::iter::repeat 2025-10-09 01:25:32 +08:00
yukang
1654cce210 prefer to use repeat_n over repeat and take 2025-10-09 01:24:55 +08:00
Alex Macleod
7b0c3d02c8
refactor(obfuscated_if_else): make a bit more type-safe (#15846)
changelog: none
2025-10-08 16:58:54 +00:00
Ada Alakbarova
d1be6d810b
Make obfuscated_if_else a bit more type-safe 2025-10-08 18:29:29 +02: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
a828ffcf5f Add Motor OS std library port
Motor OS was added as a no-std Tier-3 target in
https://github.com/rust-lang/rust/pull/146848
as x86_64-unknown-motor.

This patch/PR adds the std library for Motor OS.

While the patch may seem large, all it does is proxy
std pal calls to moto-rt. When there is some non-trivial
code (e.g. thread::spawn), it is quite similar, and often
identical, to what other platforms do.
2025-10-08 08:57:58 -07: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
Jonathan Brouwer
c050bfbf6f
Fix double error for #[no_mangle] on consts 2025-10-08 17:46:33 +02:00
Jonathan Brouwer
730221e654
Fix double error for #[no_mangle] on closures 2025-10-08 17:46:33 +02:00
sayantn
45ca537746
Port the Miri implementations of SIMD intrinsics to rustc_const_eval 2025-10-08 21:05:19 +05:30
Camille Gillot
2533f78d62 Reorder passes. 2025-10-08 15:24:44 +00:00
Marijn Schouten
d4ecd710a5 format: some small cleanup 2025-10-08 15:13:47 +00:00