1
Fork 0
Commit graph

284024 commits

Author SHA1 Message Date
Michael Goulet
5b074125e5
Rollup merge of #135895 - hkBst:patch-15, r=joboet
Document workings of successors more clearly

This is an attempt to fix #135087 together with https://github.com/rust-lang/rust/pull/135886, but I am not sure if I've succeeded in adding much clarity here, so don't be shy with your comments.
2025-03-06 12:22:09 -05:00
Michael Goulet
91826b687c
Rollup merge of #135733 - frank-king:feature/pin-self-receiver, r=oli-obk,traviscross
Implement `&pin const self` and `&pin mut self` sugars

This PR implements part of #130494.

It introduces the sugars `&pin const self` and `&pin mut self` for `self: Pin<&Self>` and `self: Pin<&mut Self>`.
2025-03-06 12:22:08 -05:00
bors
e6af292f91 Auto merge of #138039 - onur-ozkan:handle-forced-compiler-on-tools, r=jieyouxu
handle forced compiler and revert #137476

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

I would appreciate it if we could measure CI pipelines with the current changes to see if this reduces recent CI overhead. cc `@rust-lang/infra`

try-job: dist-powerpc64le-linux
2025-03-06 17:20:24 +00:00
Yotam Ofek
5d259224bd Manual, post-clippy --fix cleanups 2025-03-06 16:12:36 +00:00
Yotam Ofek
329b8a312d Implement Ord by-hand instead of PartialOrd for Link 2025-03-06 16:07:14 +00:00
Yotam Ofek
ccfbfe2292 x clippy src/librustdoc --fix 2025-03-06 16:06:41 +00:00
Redddy
6b14125102
Fix broken link to Miri intrinsics in documentation
Replaced the outdated link to https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics with the correct link https://github.com/rust-lang/miri/tree/master/src/intrinsics in the library/core/src/intrinsics/mod.rs file.
2025-03-07 00:55:24 +09:00
Eric Huss
662d73514a Git ignore citool's target directory
Whenever running citool, it leaves behind a target directory. Ignore
this like we do for other tools.
2025-03-06 06:57:00 -08:00
Tomasz Miąsko
c5b7a9c4b5 Factor out edge breaking code 2025-03-06 15:13:56 +01:00
lcnr
1fac14de23
fix typo
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2025-03-06 14:46:10 +01:00
Lukas Wirth
6a3ede1240
Merge pull request #19290 from aibaars/patch-1
Add warning and debug information when `cargo metadata` fails
2025-03-06 13:21:24 +00:00
Arthur Baars
66a1164eeb Change %e to ?e to include detailed error message 2025-03-06 12:42:35 +00:00
okaneco
d4c0c94577 Stabilize const_copy_from_slice feature
Stabilizes `copy_from_slice` method on `[T]`
2025-03-06 07:32:52 -05:00
lcnr
71d688bb72 TypeVerifier do not walk into required consts 2025-03-06 12:53:35 +01:00
Rémy Rakic
7d6bbe2df7 expand comments of TyCtxt impl of DynSync/DynSend
so that it doesn't get removed again
2025-03-06 11:20:25 +00:00
Oli Scherer
a2c1211b6d Hide the end of ranges in pretty printing if it's also the maximum of the type 2025-03-06 10:50:23 +00:00
Oli Scherer
e8f7a382be Remove the Option part of range ends in the HIR 2025-03-06 10:47:40 +00:00
lcnr
ad45962939 apply_closure_requirement use LocalDefId 2025-03-06 11:04:35 +01:00
Oli Scherer
0e7b283573 Avoid having to handle an Option in the type system 2025-03-06 10:03:11 +00:00
Oli Scherer
4f2b108816 Prefer a two value enum over bool 2025-03-06 10:03:11 +00:00
Rémy Rakic
ca64815c70 Revert "rustc_middle: parallel: TyCtxt: remove "unsafe impl DynSend/DynSync""
This reverts commit 8eba29ac10.
2025-03-06 09:16:24 +00:00
moxian
e13af7abca Don't even bother checking changelog in --dry-run mode 2025-03-06 01:07:02 -08:00
xizheyin
7e199b10c9
Add ui test: suggest-struct-or-union-add-generic-impl-trait.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-06 16:23:23 +08:00
Yotam Ofek
fde37335aa librustdoc: flatten nested ifs 2025-03-06 08:16:28 +00:00
Lukas Wirth
2e6292c0f3
Merge pull request #19295 from alibektas/rust_analyzer_run_on_cargo_toml
fix: Make RustAnalyzer:Run available in manifest file
2025-03-06 08:08:56 +00:00
Lukas Wirth
86741ea6fd
Merge pull request #19297 from Natural-selection1/master
Adjust relevance scoring threshold to consistent with existing implem…
2025-03-06 08:05:46 +00:00
Scott McMurray
eae5ed609d Make is_le and friends work like clang's 2025-03-05 21:58:46 -08:00
Scott McMurray
1b21952f02 Also add a MIR pre-codegen test for the derived PartialOrd::le 2025-03-05 21:45:16 -08:00
Tongjun Gao
d95d2784da Adjust relevance scoring threshold to consistent with existing implementations 2025-03-06 10:14:39 +08:00
moxian
571f95fb94 Remember silenced bootstrap changelog warnings even in --dry-run 2025-03-05 16:28:35 -08:00
Tomasz Miąsko
5bae3adde9 Calculate predecessor count directly
Avoid allocating a vector of small vectors merely to determine how many
predecessors each basic block has.

Additionally use u8 and saturating operations. The pass only needs to
distinguish between [0..1] and [2..].
2025-03-06 00:25:46 +01:00
Tomasz Miąsko
508b803c44 Remove start block special case
Edges to the start block are invalid. The special case is unnecessary.
2025-03-06 00:23:15 +01:00
Jubilee Young
9d8ce72901 compiler: factor Windows x86-32 ABI impl into its own file
While it shares more than zero code with the SysV x86-32 ABI impl,
there is no particular reason to organize wildly different ABIs
using if-else in the same function.
2025-03-05 15:11:20 -08:00
Michael Goulet
181ef540cf Use final path segment for diagnostic 2025-03-05 23:06:54 +00:00
Ali Bektas
bee6cdd962 fix: Make RustAnalyzer:Run available in manifest file 2025-03-06 00:01:16 +01:00
Thalia Archibald
c85d3f6e87 bootstrap and compiletest: Use size_of_val from the prelude instead of imported
Use `std::mem::size_of_val` from the prelude instead of importing or
qualifying it.

This function was added to all preludes in Rust 1.80.
2025-03-05 11:11:57 -08:00
bors
30f168ef81 Auto merge of #137907 - compiler-errors:inline-fnonce, r=saethlin
Inline `FnOnce`/`FnMut`/`Fn` shims once again

This PR fixes the argument checking for `extern "rust-call"` ABI functions with a spread arg, which do no expect their arguments to be exploded from a tuple like closures do.

Secondly, it removes the hack that prevented them from being inlined. This results in more work done by the compiler, but it does end up allowing us to inline functions we didn't before.

Fixes #137901
2025-03-05 18:39:17 +00:00
Sergio Gasquez
376955ef25 feat: Remove - from xtensa targets cpu names
Co-authored-by: MabezDev <scott@mabez.dev>
2025-03-05 16:34:09 +01:00
Jana Dönszelmann
8391c08b03
Revert #138019 after further discussion about adding this exception in hir-pretty 2025-03-05 16:19:03 +01:00
bors
07b5eeebc9 Auto merge of #138058 - jieyouxu:rollup-skdt0oz, r=jieyouxu
Rollup of 20 pull requests

Successful merges:

 - #134063 (dec2flt: Clean up float parsing modules)
 - #136581 (Retire the legacy `Makefile`-based `run-make` test infra)
 - #136662 (Count char width at most once in `Formatter::pad`)
 - #136764 (Make `ptr_cast_add_auto_to_object` lint into hard error)
 - #136798 (Added documentation for flushing per #74348)
 - #136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes)
 - #136975 (Look for `python3` first on MacOS, not `py`)
 - #136977 (Upload Datadog metrics with citool)
 - #137240 (Slightly reformat `std::fs::remove_dir_all` error docs)
 - #137298 (Check signature WF when lowering MIR body)
 - #137463 ([illumos] attempt to use posix_spawn to spawn processes)
 - #137477 (uefi: Add Service Binding Protocol abstraction)
 - #137569 (Stabilize `string_extend_from_within`)
 - #137633 (Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack)
 - #137679 (Various coretests improvements)
 - #137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`)
 - #137728 (Remove unsizing coercions for tuples)
 - #137731 (Resume one waiter at once in deadlock handler)
 - #137875 (mir_build: Integrate "simplification" steps into match-pair-tree creation)
 - #138028 (compiler: add `ExternAbi::is_rustic_abi`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-05 15:09:49 +00:00
Frank King
50d0f992ac Simplify rewrite_explicit_self 2025-03-05 22:50:50 +08:00
Frank King
52cd8746ba Simplify parse_self_param 2025-03-05 22:50:27 +08:00
Frank King
cb7d687e96 Implement &pin const self and &pin mut self sugars 2025-03-05 22:37:53 +08:00
许杰友 Jieyou Xu (Joe)
9c75ed2fa2 triagebot: add compiler_leads ad-hoc group
Intended for e.g. rolling reviewers for adding new targets.
2025-03-05 22:18:53 +08:00
Lukas Wirth
2cff7013c0
Merge pull request #19292 from Veykril/push-zonnrrlosqmv
Fix syntax highlightingg punct filtering ignoring mods
2025-03-05 14:18:09 +00:00
Lukas Wirth
363297dc53
Merge pull request #19279 from Natural-selection1/master
Improve keyword completion for 'let' and 'let mut'
2025-03-05 14:14:41 +00:00
Lukas Wirth
8641805dfe Fix syntax highlightingg punct filtering ignoring mods 2025-03-05 15:02:44 +01:00
许杰友 Jieyou Xu (Joe)
fe4c0850fe
Rollup merge of #138028 - workingjubilee:is-rustic-abi, r=compiler-errors
compiler: add `ExternAbi::is_rustic_abi`

Various parts of the compiler were hand-rolling this extremely simple check that is nonetheless easy to get wrong as the compiler evolves over time. Discourage them from being so "original" again by replacing it with a single implementation on the type that represents these ABIs. This simplifies a surprising amount of code as a result.

Also fixes #132981, an ICE that emerged due to other checks being made stricter.
2025-03-05 21:46:46 +08:00
许杰友 Jieyou Xu (Joe)
9d1b2f7fda
Rollup merge of #137875 - Zalathar:irrefutable, r=Nadrieril
mir_build: Integrate "simplification" steps into match-pair-tree creation

The “simplification” step helps to prepare THIR patterns for lowering into MIR, and originally dates back to the earliest days of MIR in the compiler.

Over time, various intermediate data structures have been introduced (e.g. `MatchPair`, later renamed to `MatchPairTree`) that reduce the need for a separate simplification step, because some of the necessary simplifications can be built into the construction of those intermediate structures instead. This PR continues that process to its logical conclusion and removes the simplification step entirely, by integrating its remaining responsibilities into match-pair-tree creation: flattening “irrefutable” nodes, collecting bindings/ascriptions in flat lists, and sorting or-patterns after other subpatterns.

This has a few immediate benefits:
- We can remove `TestCase::Irrefutable`, which was not allowed to exist after simplification, and was much larger than other test-case variants.
- We can make `MatchPairTree::place` non-optional, because only irrefutable nodes could fail to have a place.

In the future, this should also help with some ideas I have for simplifying how `AscribeUserType` and `ExpandedConstant` nodes are handled, by representing them as side-data keyed by THIR pattern ID, so that they are no longer their own kinds of THIR pattern node.
2025-03-05 21:46:45 +08:00
许杰友 Jieyou Xu (Joe)
927c11fcb7
Rollup merge of #137731 - SparrowLii:waiter, r=nnethercote
Resume one waiter at once in deadlock handler

When multiple query loop errors occur in the code, only one waiter should be resumed at a time to avoid waking up multiple waiters at the same time and causing deadlock due to thread grabbing.

This fixes the UI failures in #132051

cc `@Zoxc` `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`

Zulip discussion [here](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fwg-parallel-rustc/topic/Deadlocks.20and.20Rayon)

Edit: We can't reproduce these bugs with the existing test suits, so we keep them until we merge #132051
UPDATES #129912
UPDATES #120757
UPDATES #129911
2025-03-05 21:46:45 +08:00