34690 Commits

Author SHA1 Message Date
bors
582cbeeae2 Auto merge of #140925 - the8472:test-140207, r=compiler-errors
add regression test for 140207

Assembly test for #140207
2025-05-12 04:32:50 +00:00
bors
19cdfb3de9 Auto merge of #140842 - tmiasko:print-mono-items, r=saethlin
Remove mono item collection strategy override from -Zprint-mono-items

Previously `-Zprint-mono-items` would override the mono item collection
strategy. When debugging one doesn't want to change the behaviour, so
this was counter productive. Additionally, the produced behaviour was
artificial and might never arise without using the option in the first
place (`-Zprint-mono-items=eager` without `-Clink-dead-code`).  Finally,
the option was incorrectly marked as `UNTRACKED`.

Resolve those issues, by turning `-Zprint-mono-items` into a boolean
flag that prints results of mono item collection without changing the
behaviour of mono item collection.

For codegen-units test incorporate `-Zprint-mono-items` flag directly
into compiletest tool.

Test changes are mechanical. `-Zprint-mono-items=lazy` was removed
without additional changes, and `-Zprint-mono-items=eager` was turned
into `-Clink-dead-code`.  Linking dead code disables internalization, so
tests have been updated accordingly.
2025-05-11 22:15:30 +00:00
bors
350ccc431a Auto merge of #140899 - oyvindln:update_coverage_dump_deps, r=Zalathar
Update miniz_oxide dependency of coverage_dump

This was the final subproject that depended on ```miniz_oxide``` 0.7.x after the rest were when updating the ```backtrace-rs``` dependency in in #140705. Older versions of ```miniz_oxide``` got hit by a [serious](https://github.com/rust-lang/rust/issues/132636) performance regression in rust 1.82 (which has been worked around in more recent versions of the library) so should really be avoided if possible (granted it only affects compression so not sure if it had much impact in practice here, though there have also been some other performance improvements since .)

This also means no longer having to build two versions of miniz_oxide as everything can now use the same version, and no longer needing to build both ```adler``` and ```adler2```
2025-05-11 19:01:19 +00:00
bors
0278750273 Auto merge of #140902 - azhogin:azhogin/async-drop-open-drop-for-adt-fix, r=oli-obk
Async drop fix for async_drop_in_place<T> layout for unspecified T

Fix for https://github.com/rust-lang/rust/issues/140423.
Layout of `async_drop_in_place<T>::{closure}` is calculated for unspecified T from dataflow_const_prop `try_make_constant`.

`@oli-obk,` do you think, it may be a better solution to add check like `if !args[0].is_fully_specialized() { return None; }` in `fn async_drop_coroutine_layout`?
And could you, pls, recommend, how to implement `is_fully_specialized()` in a most simple way?
2025-05-11 09:22:50 +00:00
bors
3b80a009e9 Auto merge of #135015 - heiher:stabilize-loongarch-target-features, r=Amanieu
Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by #44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: https://github.com/rust-lang/reference/pull/1707

r? `@Amanieu`
2025-05-11 06:10:41 +00:00
bors
e80fe4a7d4 Auto merge of #140912 - fmease:rollup-rwtn31e, r=fmease
Rollup of 7 pull requests

Successful merges:

 - #140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - #140795 (Prefer to suggest stable candidates rather than unstable ones)
 - #140865 (Make t letter looks like lowercase rather than uppercase)
 - #140878 (Two expand-related cleanups)
 - #140882 (Split duration_constructors to get non-controversial constructors out)
 - #140886 (Update deps of bootstrap for Cygwin)
 - #140903 (test intrinsic fallback bodies with Miri)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-11 03:05:38 +00:00
León Orell Valerian Liehr
fcb2813910
Rollup merge of #140903 - RalfJung:fallback-body-tests, r=WaffleLapkin
test intrinsic fallback bodies with Miri

`@Urgau` noted in https://github.com/rust-lang/rust/pull/140792 that fallback bodies our backends don't use are untested... which is correct, and it is a problem. So this adds a testing-only flag to Miri to force the use of fallback bodies, and adds a run of the Miri test suite with that flag to CI. This should not take much more than a minute so I hope it's fine? Let's see how long it actually takes.

While at it, I made that test run also enable MIR optimizations. Miri's CI has a run with that, and it has caught mir-opt bugs in the past -- this way we'd see the CI failure earlier.

r? `@scottmcm`
2025-05-11 02:44:40 +02:00
León Orell Valerian Liehr
392bbe4ba5
Rollup merge of #140886 - Berrysoft:update-bootstrap-lock, r=jieyouxu
Update deps of bootstrap for Cygwin

This PR just runs
```
cargo update fd-lock xattr libc errno
```
It reduces dependency on `rustix 0.38.40` and updates `libc` & `errno`. Now it compiles successfully on Cygwin:)
2025-05-11 02:44:39 +02:00
León Orell Valerian Liehr
9add533f9b
Rollup merge of #140882 - Dietr1ch:dev/duration_constructors_lite, r=BurntSushi
Split duration_constructors to get non-controversial constructors out

This implements #140881
2025-05-11 02:44:39 +02:00
León Orell Valerian Liehr
eb29f196a1
Rollup merge of #140878 - nnethercote:two-expand-cleanups, r=compiler-errors
Two expand-related cleanups

Minor improvements I found while looking at this code. Best reviewed one commit at a time.

r? `@BoxyUwU`
2025-05-11 02:44:38 +02:00
Lukas Wirth
2bafe9d96c
Merge pull request #19772 from rust-lang/push-nxzlokoozypo
internal: Make diagnostics experimental by default
2025-05-12
2025-05-10 15:01:30 +00:00
gohome001
c6e3a4cf20 minor: code review tweak 2025-05-10 13:16:34 +08:00
Dietrich Daroch
3faf03f6b4 Split duration_constructors to get non-controversial bits out faster. 2025-05-09 22:52:39 -04:00
Florian Diebold
40b7f4af27 Make diagnostics experimental by default 2025-05-09 16:15:48 +02:00
bors
d452c93b55 Auto merge of #140176 - dpaoliello:arm64ecdec, r=wesleywiser
Fix linking statics on Arm64EC

Arm64EC builds recently started to fail due to the linker not finding a symbol:
```
symbols.o : error LNK2001: unresolved external symbol #_ZN3std9panicking11EMPTY_PANIC17hc8d2b903527827f1E (EC Symbol)
          C:\Code\hello-world\target\arm64ec-pc-windows-msvc\debug\deps\hello_world.exe : fatal error LNK1120: 1 unresolved externals
```

It turns out that `EMPTY_PANIC` is a new static variable that was being exported then imported from the standard library, but when exporting LLVM didn't prepend the name with `#` (as only functions are prefixed with this character), whereas Rust was prefixing with `#` when attempting to import it.

The fix is to have Rust not prefix statics with `#` when importing.

Adding tests discovered another issue: we need to correctly mark static exported from dylibs with `DATA`, otherwise MSVC's linker assumes they are functions and complains that there is no exit thunk for them.

CI found another bug: we only apply `DllImport` to non-local statics that aren't foreign items (i.e., in an `extern` block), that is we want to use `DllImport` for statics coming from other Rust crates. However, `__rust_no_alloc_shim_is_unstable` is a static generated by the Rust compiler if required, but downstream crates consider it a foreign item since it is declared in an `extern "Rust"` block, thus they do not apply `DllImport` to it and so fails to link if it is exported by the previous crate as `DATA`. The fix is to apply `DllImport` to foreign items that are marked with the `rustc_std_internal_symbol` attribute (i.e., we assume they aren't actually foreign and will be in some Rust crate).

Fixes #138541

---
try-job: dist-aarch64-msvc
try-job: dist-x86_64-msvc
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
2025-05-09 00:43:28 +00:00
Lukas Wirth
8b624868e4
Merge pull request #19507 from Hmikihiro/fix_module_doc_links
fix: resolve doc path from parent module if outer comments exist on module
2025-05-08 16:34:35 +00:00
Hayashi Mikihiro
7c7d440188 add assert to check ast_index smaller than INNER_ATTR_SET_BIT
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-08 23:37:47 +09:00
bors
85905359cf Auto merge of #140732 - onur-ozkan:use-in-tree-rustfmt, r=Kobzol
make it possible to run in-tree rustfmt with `x run rustfmt`

Currently, there is no way to run in-tree `rustfmt` using `x fmt` or `x test tidy` commands. This PR implements `rustfmt` on `x run`, which allows bootstrap to run the in-tree `rustfmt`.

Fixes #140723
2025-05-08 11:53:39 +00:00
Chayim Refael Friedman
46a31febda
Merge pull request #19764 from ChayimFriedman2/too-many-asterisks-dbg
fix: Fix postfix snippets duplicating derefs
2025-05-08 09:55:35 +00:00
Chayim Refael Friedman
6e8ad1666a Fix postfix snippets duplicating derefs 2025-05-08 11:44:38 +03:00
Lukas Wirth
0551bde817
Merge pull request #19763 from ChayimFriedman2/ws-completions
fix: Still complete parentheses & method call arguments if there are existing parentheses, but they are after a newline
2025-05-08 08:23:52 +00:00
Lukas Wirth
8d9b318a85 perf: Request cancellation while processing changed files 2025-05-08 10:18:17 +02:00
Chayim Refael Friedman
70842faa4d Still complete parentheses & method call arguments if there are existing parentheses, but they are after a newline 2025-05-08 11:05:39 +03:00
bors
4c2b4ca4f2 Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrieril
allow deref patterns to participate in exhaustiveness analysis

Per [this proposal](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Exhaustiveness), this PR allows deref patterns to participate in exhaustiveness analysis. Currently all deref patterns enforce `DerefPure` bounds on their scrutinees, so this assumes all patterns it's analyzing are well-behaved. This also doesn't support [mixed exhaustiveness](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Mixed-exhaustiveness), and instead emits an error if deref patterns are used together with normal constructors. I think mixed exhaustiveness would be nice to have (especially if we eventually want to support arbitrary `Deref` impls[^1]), but it'd require more work to get reasonable diagnostics[^2].

Tracking issue for deref patterns: #87121

r? `@Nadrieril`

[^1]: Regardless of whether we support limited exhaustiveness checking for untrusted `Deref` or always require other arms to be exhaustive, I think it'd be useful to allow mixed matching for user-defined smart pointers. And it'd be strange if it worked there but not for `Cow`.

[^2]: I think listing out witnesses of non-exhaustiveness can be confusing when they're not necessarily disjoint, and when you only need to cover some of them, so we'd probably want special formatting and/or explanatory subdiagnostics. And if it's implemented similarly to unions, we'd probably also want some way of merging witnesses; the way witnesses for unions can appear duplicated is pretty unfortunate. I'm not sure yet how the diagnostics should look, especially for deeply nested patterns.
2025-05-08 02:16:45 +00:00
bors
cdc27d1c08 Auto merge of #140590 - lcnr:closure-in-dead-code, r=compiler-errors
borrowck nested items in dead code

fixes https://github.com/rust-lang/rust/issues/140583

r? `@compiler-errors`
2025-05-07 19:49:36 +00:00
bors
1e092772a2 Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obk
Use thread local dep graph encoding

This adds thread local encoding of dep graph nodes. Each thread has a `MemEncoder` that gets flushed to the global `FileEncoder` when it exceeds 64 kB. Each thread also has a local cache of dep indices. This means there can now be empty gaps in `SerializedDepGraph`.

Indices are marked green and also allocated by the new atomic operation `DepNodeColorMap::try_mark_green` as the encoder lock is removed.
2025-05-07 12:39:54 +00:00
bors
e9430af94e Auto merge of #140735 - GuillaumeGomez:rollup-dlhbxsg, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #139518 (Stabilize precise capture syntax in style guide)
 - #140398 (Fix backtrace for cygwin)
 - #140719 (fix typo in autorefs lint doc example)
 - #140724 (Update `compiler-builtins` to 0.1.158)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-07 09:31:15 +00:00
Guillaume Gomez
f2921b99d9
Rollup merge of #140398 - Berrysoft:cygwin-backtrace, r=tgross35
Fix backtrace for cygwin

Closes #140304

Depends on:
- [x] https://github.com/rust-lang/backtrace-rs/pull/704

This PR could not be merged until the above PR is merged. I'll update the submodule then.

EDIT: submodule updated.
2025-05-07 10:50:49 +02:00
Guillaume Gomez
cd85099e22
Rollup merge of #139518 - xizheyin:issue-138527, r=traviscross
Stabilize precise capture syntax in style guide

Closes #138527

r? `@jieyouxu`
2025-05-07 10:50:48 +02:00
bors
24390f60d6 Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format

r? `@nnethercote`
2025-05-07 06:18:39 +00:00
dianne
eb446f92fd add stubbed-out cases for rust-analyzer
rust-analyzer doesn't construct `DerefPattern(_)` constructors, so these
shouldn't crash. It looks like this is how slice patterns are
implemented too.
2025-05-06 18:53:55 -07:00
bors
3732587143 Auto merge of #140514 - m-ou-se:proc-macro-span-file, r=Amanieu
Stabilize proc_macro::Span::{file, local_file}.

Stabilizes this part of https://github.com/rust-lang/rust/issues/54725:

```rust
impl Span {
    pub fn file(&self) -> String; // Mapped/artificial file name, for display purposes.

    pub fn local_file(&self) -> Option<PathBuf>; // Real file name as it exists on the local file system.
}
```

See also the naming discussion in https://github.com/rust-lang/rust/issues/139903
2025-05-06 22:03:11 +00:00
Hayashi Mikihiro
0235ff883f extract function: doc_attributes to find def from inner doc
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-07 03:12:19 +09:00
Hayashi Mikihiro
cc0e3acd91 add doc link test for hover
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-07 00:36:52 +09:00
Hayashi Mikihiro
318185720c add doc link test for goto def
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-07 00:36:42 +09:00
Hayashi Mikihiro
778322eb31 check module path inner or outer
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-07 00:36:17 +09:00
bors
3f31806a93 Auto merge of #140561 - compiler-errors:gather-fewer-locals, r=lcnr
Do not gather local all together at the beginning of typeck

r? lcnr
2025-05-06 10:27:27 +00:00
Marijn Schouten
618c3de146 Remove duplicate impl of string unescape 2025-05-06 10:00:22 +00:00
Lukas Wirth
debaef80be
Merge pull request #19738 from ChayimFriedman2/weird-gats
fix: Don't panic on some weird code
2025-05-06 09:05:19 +00:00
Hayashi Mikihiro
ab4ba5cd29 Remove ast index mask
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
52b523aabe import std::iter::repeat
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
7d6956ea57 Update crates/hir-expand/src/attrs.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
b786f98761 Update crates/hir-expand/src/attrs.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
9f6b4255c2 fix: resolve doc path if outer comments exist on module and replace from cfg_attr bit to doc_place bit
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Chayim Refael Friedman
3b3e89240d Don't panic on some weird code 2025-05-06 10:54:35 +03:00
Lukas Wirth
8c43442365
Merge pull request #19721 from ChayimFriedman2/more-parallel
Better handle parallelism in cache priming
2025-05-06 07:40:56 +00:00
Chayim Refael Friedman
f23af9291c Notify the user that we're collecting symbols
It could be confusing if they see "Indexing n/n" but cache priming does not finish.
2025-05-06 10:29:53 +03:00
bors
65576ebbd7 Auto merge of #140695 - Zalathar:rollup-i32gzbo, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - #139550 (Fix `-Zremap-path-scope` rmeta handling)
 - #139764 (Consistent trait bounds for ExtractIf Debug impls)
 - #139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - #140035 (Implement RFC 3503: frontmatters)
 - #140251 (coverage-dump: Resolve global file IDs to filenames)
 - #140393 (std: get rid of `sys_common::process`)
 - #140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - #140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - #140634 (Use more accurate ELF flags on MIPS)
 - #140673 (Clean rustdoc tests folder)
 - #140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - #140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-06 06:37:30 +00:00
Stuart Cook
c332523848
Rollup merge of #140687 - ehuss:update-mdbook, r=jieyouxu
Update mdbook to 0.4.49

This is a routine update to pull in some fixes and updates.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0449
2025-05-06 16:28:43 +10:00
Stuart Cook
d76c112cbf
Rollup merge of #140678 - compiler-errors:dont-ice-on-infer-in-upvar, r=lcnr
Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis

See the writeup in `tests/ui/closures/opaque-upvar.rs`.

TL;DR is that this has to do with the fact that the recursive revealing uses, which have not yet been constrained from the defining use by the time that closure upvar inference is performed, remain as infer vars during upvar analysis. We don't really care, though, since anywhere we structurally match on a type in upvar analysis, we already call `structurally_resolve_type` right before `.kind()`, which would emit a true ambiguity error.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/197

r? lcnr
2025-05-06 16:28:43 +10:00