Commit graph

284993 commits

Author SHA1 Message Date
John Kåre Alsaker
60e4a1b8f3 Remove prev_index_to_index field from CurrentDepGraph 2025-03-24 19:58:34 +01:00
rustbot
41d68e098c Update books 2025-03-24 18:00:58 +01:00
Michael Goulet
484362e3f8 Mark a fixed test 2025-03-24 16:57:07 +00:00
Michael Goulet
c80d9b8d67 Don't ICE when encountering placeholders in layout computation 2025-03-24 16:57:07 +00:00
Michael Goulet
aba23fd500 Don't mark privacy test as needing GCE 2025-03-24 16:57:07 +00:00
Michael Goulet
251455bcc5 Allow WellFormed goals to be returned from relating in new solver 2025-03-24 16:57:06 +00:00
klensy
75f283e40b happy tidy 2025-03-24 19:40:52 +03:00
klensy
724a5a430b bump thorin to drop duped deps 2025-03-24 19:38:16 +03:00
Oli Scherer
67e0b899f0 Add a helper for building an owner id in ast lowering 2025-03-24 15:41:33 +00:00
bors
4510e86a41 Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obk
Only use the new node hashmap for anonymous nodes

This is a rebase of https://github.com/rust-lang/rust/pull/112469.

cc `@cjgillot`
2025-03-24 15:02:09 +00:00
Samuel Tardieu
856a181570 Fix autofix for self and self as … in unused_imports lint
This fixes two problems with the autofixes for the `unused_imports`
lint:

- `use std::collections::{HashMap, self as coll};` would suggest, when
  `HashMap` is unused, the incorrect `use std::collections::self as coll;`
  which does not compile.

- `use std::borrow::{self, Cow};` would suggest, when `self` is unused,
  `use std::borrow::{Cow};`, which contains unnecessary brackets.
2025-03-24 13:01:47 +01:00
bors
90f5eab952 Auto merge of #115747 - Zoxc:query-hashes, r=oli-obk
Optimize hash map operations in the query system

This optimizes hash map operations in the query system by explicitly passing hashes and using more optimal operations. `find_or_find_insert_slot` in particular saves a hash table lookup over `entry`. It's not yet available in a safe API, but will be in https://github.com/rust-lang/hashbrown/pull/466.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.6189s</td><td align="right">1.6129s</td><td align="right"> -0.37%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2353s</td><td align="right">0.2337s</td><td align="right"> -0.67%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9344s</td><td align="right">0.9289s</td><td align="right"> -0.59%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.4693s</td><td align="right">1.4652s</td><td align="right"> -0.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.6606s</td><td align="right">5.6439s</td><td align="right"> -0.30%</td></tr><tr><td>Total</td><td align="right">9.9185s</td><td align="right">9.8846s</td><td align="right"> -0.34%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9956s</td><td align="right"> -0.44%</td></tr></table>

r? `@cjgillot`
2025-03-24 11:40:33 +00:00
Eduard Stefes
02e1f118cd Fix ui pattern_types test for big-endian platforms
The newly added pattern types validity tests fail on s390x and
presumably other big-endian systems, due to print of raw values
with padding bytes.

To fix the tests remove the raw output values in the error note by
`normalize-stderr`.
2025-03-24 12:31:23 +01:00
Pietro Albini
f5659f28f8
ignore tests broken while cross compiling 2025-03-24 11:33:56 +01:00
Guillaume Gomez
d9f250af21 Remove duplicated loop when computing doc cfgs 2025-03-24 10:56:42 +01:00
Oli Scherer
2d3115f61f with_scope is only ever used for ast modules 2025-03-24 09:55:54 +00:00
Nicholas Nethercote
a29e875b63 Move is_used_keyword_conditional.
So the order of the `Symbol::is_*` predicates match the order of the
keywords list.
2025-03-24 18:44:40 +11:00
Nicholas Nethercote
10236fbe7b Alphabetize the keywords list. 2025-03-24 18:44:38 +11:00
Nicholas Nethercote
3aaa12f622 Fix some formatting. 2025-03-24 18:43:37 +11:00
Nicholas Nethercote
a28d5092e9 Improve keyword comments a little. 2025-03-24 18:43:37 +11:00
Nicholas Nethercote
9dd5340d3c Remove is_any_keyword methods.
They're dodgy, covering all the keywords, including weak ones, and
edition-specific ones without considering the edition. They have a
single use in rustfmt. This commit changes that use to
`is_reserved_ident`, which is a much more widely used alternative and is
good enough, judging by the lack of effect on the test suite.
2025-03-24 18:43:37 +11:00
bors
b95aac6a98 Auto merge of #138878 - jieyouxu:revert-ci-llvm, r=dianqk
Revert "fix download-llvm logic for subtree sync branches #137593"

Reverts #137593.

Looks like unfortunately the `--diff-merges=first-parent` flag is a `git show`-only flag, not `git rev-list` which only accepts `--first-parent`.

See https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---first-parent which has `--first-parent`, versus https://git-scm.com/docs/git-show#Documentation/git-show.txt---diff-mergesltformatgt which has `--diff-merges=first-parent`.

This reverts commit 95994f94ff, reversing changes made to 7290b04b0a.

This will unfortunately re-open https://github.com/rust-lang/rust/issues/101907 but that isn't fixed anyway since the git invocation is broken.

cc `@RalfJung` `@Mark-Simulacrum` for FYI (but I would've written the same incorrect flag 💀)
r? `@onur-ozkan` (or bootstrap or infra or anyone really)
2025-03-24 07:25:53 +00:00
Jieyou Xu
c71569a765
Revert "Rollup merge of #137593 - RalfJung:subtree-sync-download-llvm, r=Mark-Simulacrum"
Looks like unfortunately the `--diff-merges` flag is a `git show`-only
command, not `git rev-list`.

This reverts commit 95994f94ff, reversing
changes made to 7290b04b0a.
2025-03-24 14:09:06 +08:00
Ayush Singh
021d23b64e
std: fs: uefi: Implement OpenOptions
UEFI does not have specific modes for create_new, truncate and append.
So those need to to be simulated after opening the file.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-24 08:44:31 +05:30
Ayush Singh
fc0cf52e28
std: fs: uefi: Make lstat call stat
- UEFI does not have symlinks. So lstat and stat should behave the same.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-24 08:40:08 +05:30
Ayush Singh
0cd1d516ae
std: fs: uefi: Implement canonicalize
- Should be same as absolute in UEFI since there are no symlinks.
- Also each absolute path representation should be unique according to
  the UEFI specification.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-24 08:40:07 +05:30
John Kåre Alsaker
38c39ffc6c Remove QueryWaiter::notify 2025-03-24 03:53:19 +01:00
Thalia Archibald
b672659472 Trusty: Fix build for anonymous pipes and std::sys::process
PRs #136842 (Add libstd support for Trusty targets), #137793 (Stablize
anonymous pipe), and #136929 (std: move process implementations to
`sys`) merged around the same time, so update Trusty to take them into
account.
2025-03-23 19:32:20 -07:00
John Kåre Alsaker
14786ce645 Batch mark waiters as unblocked when resuming in the deadlock handler 2025-03-24 02:09:14 +01:00
bors
ae8ab87de4 Auto merge of #138873 - jhpratt:rollup-tggrbxl, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - #137593 (fix download-llvm logic for subtree sync branches)
 - #137736 (Don't attempt to export compiler-builtins symbols from rust dylibs)
 - #138135 (Simplify `PartialOrd` on tuples containing primitives)
 - #138321 ([bootstrap] Distribute split debuginfo if present)
 - #138574 (rustdoc: be more strict about "Methods from Deref")
 - #138606 (Fix missing rustfmt in msi installer - cont)
 - #138671 (Fix `FileType` `PartialEq` implementation on Windows)
 - #138728 (Update `compiler-builtins` to 0.1.152)
 - #138783 (Cache current_dll_path output)
 - #138846 (Tweaks to writeback and `Obligation -> Goal` conversion)

Failed merges:

 - #138755 ([rustdoc] Remove duplicated loop when computing doc cfgs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-24 01:03:21 +00:00
John Kåre Alsaker
fbcf765705 Revert "resume one waiter at a call"
This reverts commit cc1e4ede93.
2025-03-24 02:02:10 +01:00
Jacob Pratt
0e95f962d9
Rollup merge of #138846 - compiler-errors:stall-prereqs, r=lcnr
Tweaks to writeback and `Obligation -> Goal` conversion

Each of these commits are self-contained, but are prerequisites that I'd like to land before #138845, which still needs some cleaning.

The ""most controversial"" one is probably [Explicitly don't fold coroutine obligations in writeback](e7d27bae27), which I prefer because I think using `fold_predicate` to control against not normalizing predicates seems... easy to mess up 🤔, and we could have *other things* that we don't want to normalize.

Explicitly noting whether we want `resolve` to normalize is a lot clearer (and currently in writeback is limited to resolving stalled coroutine obligations), since we can attach it to a comment that explains *why*.
2025-03-23 20:44:13 -04:00
Jacob Pratt
ab138e6aa8
Rollup merge of #138783 - bjorn3:cache_current_dll_path, r=lqd
Cache current_dll_path output

Computing the current dll path is somewhat expensive relative to other work when compiling `fn main() {}` as `dladdr` needs to iterate over the symbol table of librustc_driver.so until it finds a match.
2025-03-23 20:44:12 -04:00
Jacob Pratt
b406d9aaaa
Rollup merge of #138728 - tgross35:update-builtins, r=tgross35
Update `compiler-builtins` to 0.1.152

Includes the following changes related to unordered atomics:

* Remove element_unordered_atomic intrinsics [1]
* Remove use of `atomic_load_unordered` and undefined behaviour [2]

There are a handful of other small changes, but nothing else user-visible.

[1]: https://github.com/rust-lang/compiler-builtins/pull/789
[2]: https://github.com/rust-lang/compiler-builtins/pull/790
2025-03-23 20:44:12 -04:00
Jacob Pratt
8e30df7f26
Rollup merge of #138671 - ChrisDenton:filetype, r=joshtriplett
Fix `FileType` `PartialEq` implementation on Windows

Fixes #138668

On Windows the [`FileType`](https://doc.rust-lang.org/stable/std/fs/struct.FileType.html) struct was deriving `PartialEq` which in turn means it was doing a bit-for-bit comparison on the file attributes and reparse point. This is wrong because `attributes` may contain many things unrelated to file type.

`FileType` on Windows allows for four possible combinations (see also [`FileTypeExt`](https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTypeExt.html)): `file`, `dir`, `symlink_file` and `symlink_dir`. So the new implementation makes sure both symlink and directory information match (and only those things).

This could be considered just a bug fix but it is a behaviour change so someone from libs-api might want to FCP this (or might not)...
2025-03-23 20:44:11 -04:00
Jacob Pratt
0fc6279ce9
Rollup merge of #138606 - heiseish:131365-extended, r=Mark-Simulacrum
Fix missing rustfmt in msi installer - cont

## Context
- This PR extended and fixed https://github.com/rust-lang/rust/pull/131365, which was reverted in https://github.com/rust-lang/rust/pull/135253
- Initial effort from `@klensy` in https://github.com/rust-lang/rust/pull/135255 (at any points if you feel like picking this up again, let me know I'll close my PR! Just trying to push this through since it's my mistake in the original commits)
- Tested with both `beta` and `nightly` `rust.channel`

r? `@Mark-Simulacrum`
2025-03-23 20:44:11 -04:00
Jacob Pratt
abc67849a8
Rollup merge of #138574 - lolbinarycat:rustdoc-deref-24686-v2, r=GuillaumeGomez
rustdoc: be more strict about "Methods from Deref"

fixes #137083
fixes #24686

Currently done:
* [x] fix `render_assoc_items_inner
* [x] fix sidebar logic
* [x] port test from https://github.com/rust-lang/rust/pull/137564
* [x] add test for sidebar items

Note that this does not yet fix the sidebar logic.
2025-03-23 20:44:10 -04:00
Jacob Pratt
66f2a19676
Rollup merge of #138321 - wesleywiser:bootstrap_package_pdbs, r=onur-ozkan
[bootstrap] Distribute split debuginfo if present

If debuginfo has been requested in `config.toml`, it should be packaged alongside the appropriate binary when running `x.py dist`.

Currently, this is only implemented for msvc environments where split debuginfo is (basically) the only option. I've tested that this correctly packages the `.pdb` for each binary in the various dist packages.
2025-03-23 20:44:09 -04:00
Jacob Pratt
1ba9b7873a
Rollup merge of #138135 - scottmcm:chaining-ord, r=Mark-Simulacrum
Simplify `PartialOrd` on tuples containing primitives

We noticed in https://github.com/rust-lang/rust/pull/133984#issuecomment-2704011800 that currently the tuple comparison code, while it [does optimize down](https://github.com/rust-lang/rust/blob/master/tests/codegen/comparison-operators-2-tuple.rs) today, is kinda huge: <https://rust.godbolt.org/z/xqMoeYbhE>

This PR changes the tuple code to go through an overridable "chaining" version of the comparison functions, so that for simple things like `(i16, u16)` and `(f32, f32)` (as seen in the new MIR pre-codegen test) we just directly get the
```rust
if lhs.0 == rhs.0 { lhs.0 OP rhs.0 }
else { lhs.1 OP rhs.1 }
```
version in MIR, rather than emitting a mess for LLVM to have to clean up.

Test added in the first commit, so you can see the MIR diff in the second one.
2025-03-23 20:44:09 -04:00
Jacob Pratt
9a243cf7d3
Rollup merge of #137736 - bjorn3:compiler_builtins_export_fix, r=petrochenkov
Don't attempt to export compiler-builtins symbols from rust dylibs

They are marked with hidden visibility to prevent them from getting exported, so we shouldn't ask the linker to export them anyway. The only thing that does it cause a warning on macOS.

Part of https://github.com/rust-lang/rust/issues/136096

cc `@jyn514`
2025-03-23 20:44:08 -04:00
Jacob Pratt
95994f94ff
Rollup merge of #137593 - RalfJung:subtree-sync-download-llvm, r=Mark-Simulacrum
fix download-llvm logic for subtree sync branches

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

Cc `@onur-ozkan`
r? `@Mark-Simulacrum`
2025-03-23 20:44:08 -04:00
Trevor Gross
95181ae170 Update compiler-builtins to 0.1.152
Includes the following changes related to unordered atomics:

* Remove element_unordered_atomic intrinsics [1]
* Remove use of `atomic_load_unordered` and undefined behaviour [2]

There are a handful of other small changes, but nothing else
user-visible.

[1]: https://github.com/rust-lang/compiler-builtins/pull/789
[2]: https://github.com/rust-lang/compiler-builtins/pull/790
2025-03-24 00:29:21 +00:00
mejrs
f390dd7911 Add do_not_recommend typo help 2025-03-24 01:02:07 +01:00
Scott McMurray
7781346243 Stop using specialization for this
Uses `__`-named `doc(hidden)` methods instead.
2025-03-23 15:27:31 -07:00
bors
7290b04b0a Auto merge of #138866 - compiler-errors:rollup-9d8v3mz, r=compiler-errors
Rollup of 12 pull requests

Successful merges:

 - #136040 (Remove unused trait BoundedSize)
 - #138236 (uefi: Add OwnedEvent abstraction)
 - #138293 (rustdoc: Gate unstable `doc(cfg())` predicates)
 - #138509 (Add test to ensure no index out of bounds panic (#135474))
 - #138545 (Add MIR pre-codegen tests to track #138544)
 - #138631 (Update test for SGX now implementing `read_buf`)
 - #138641 (Add unstable `--print=supported-crate-types` option)
 - #138667 (std: uefi: fs: Implement mkdir)
 - #138849 (doc: rename reference #create-a-configtoml to #create-a-bootstraptoml)
 - #138854 (Fix ICE #138415 for invalid extern function body)
 - #138858 (Say which test failed the `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` assertion)
 - #138861 (Tweak type flags, fix missing flags from coroutine kind ty)

Failed merges:

 - #138755 ([rustdoc] Remove duplicated loop when computing doc cfgs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-23 20:59:14 +00:00
Michael Goulet
045a1c78ae
Rollup merge of #138861 - compiler-errors:flags-tweaks, r=lcnr
Tweak type flags, fix missing flags from coroutine kind ty

Firstly, make sure we visit the coroutine kind ty. Since this kind ty is either infer (before upvar computation), or `()` or `i8`/`i16`/`i32`, this isn't really that big of a deal, since other types in the coroutine will also be infer, so we're not misreporting `ty.has_infer()` or anything, but it's still wrong not to do this.

Furthermore, remove `HAS_TY_COROUTINE`, since nobody used it, and also remove special casing for `STILL_FURTHER_SPECIALIZABLE` since it's likely not important anymore? I have a vague recollection that it was important for polymorphization(?), but no tests seem to rely on this behavior.

r? lcnr or reassign
2025-03-23 14:59:36 -04:00
Michael Goulet
db52a4a030
Rollup merge of #138858 - jieyouxu:ct-llvm-components, r=onur-ozkan
Say which test failed the `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` assertion

Closes #138857.

This is of course a spot fix. The general problem requires reworking compiletest directive handling's diagnostics logic.
2025-03-23 14:59:35 -04:00
Michael Goulet
1e023420f9
Rollup merge of #138854 - TaKO8Ki:invalid-extern-fn-body, r=compiler-errors
Fix ICE #138415 for invalid extern function body

Fixes #138415
2025-03-23 14:59:35 -04:00
Michael Goulet
93e53139fe
Rollup merge of #138849 - chiichen:dev/master/doc-correct-configtoml, r=TaKO8Ki
doc: rename reference #create-a-configtoml to #create-a-bootstraptoml

e4ddc21c8a This commit renamed `config.toml` to `bootstrap.toml`.
2025-03-23 14:59:34 -04:00
Michael Goulet
f4096dcda8
Rollup merge of #138667 - Ayush1325:uefi-mkdir, r=joboet
std: uefi: fs: Implement mkdir

- Since there is no direct mkdir in UEFI, first check if a file/dir with same path exists and then create the directory.

cc `@dvdhrm` `@nicholasbishop`
2025-03-23 14:59:33 -04:00