summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-05-09Restrict the cases where `ptr_eq` triggers (#14526)Alex Macleod-100/+60
`ptr_eq` was recently enhanced to lint on more cases of raw pointers comparison: - lint on all raw pointer comparison, by proposing to use `[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`; - removing one symetric `as usize` on each size if needed - peeling any level of `as *[const|mut] _` if the remaining expression can still be coerced into the original one (i.e., is a ref or raw pointer to the same type as before) The current change restricts the lint to the cases where at least one level of symetric `as usize`, or any conversion to a raw pointer, could be removed. For example, a direct comparaison of two raw pointers will not trigger the lint anymore. changelog: [`ptr_eq`]: do not lint when comparing two raw pointers directly with no casts involved Fixes rust-lang/rust-clippy#14525
2025-05-09Ensure that peeling does not recurse into macros (#14527)Alex Macleod-15/+38
We do not want to remove casts done inside macros. Also, when printing the suggestion, take it from the same context as the origin expression (the root context). Problems found while working on #14526, but should be merged even if #14526 is not. changelog: none
2025-05-09fix: map_entry: don't emit lint before checks have been performed (#14568)Alex Macleod-15/+62
Fixes rust-lang/rust-clippy#14449, introduced in #14314 changelog: [`map_entry`]: fix a false positive where the lint would trigger without any insert calls present
2025-05-09`manual_ok_err`: don't lint subpatterns (#14661)Timo-2/+12
Fixes https://github.com/rust-lang/rust-clippy/issues/14660 changelog: none
2025-05-09update channel to stablePietro Albini-1/+1
2025-05-06[beta-1.87] Update cargoWeihang Lo-0/+0
2025-05-02extend the list of registered dylibs on `test::prepare_cargo_test`onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev> (cherry picked from commit 7b25d4a99edc12909dc73c31cb6a44238c4b9bf9)
2025-05-02rustdoc: Fix doctest heuristic for main fn wrappingLeón Orell Valerian Liehr-37/+28
(cherry picked from commit 714ea10ea41e97310a1b3d90fed4cfb3e2dd6b73)
2025-05-02Fix bad handling of macros if there is already a `main` functionGuillaume Gomez-1/+4
(cherry picked from commit aa69e3a0cb8f1b2e086709a038baad6f39249150)
2025-05-02If there is a `;` alone, we consider that the doctest needs to be put inside ↵Guillaume Gomez-2/+0
a function (cherry picked from commit 3ef98a55ef95b058e55897f1b213dd965839e3ed)
2025-05-02Improve codeGuillaume Gomez-4/+7
(cherry picked from commit 3ededc1053f752d993a0b25286faebfe3616819d)
2025-05-02Fix detection of `main` function if there are expressions around itGuillaume Gomez-4/+17
(cherry picked from commit 35363245657ee53a3735f1cef0df9a45e9ed44b9)
2025-04-18sync::mpsc: prevent double free on `Drop`Petros Angelatos-1/+1
This PR is fixing a regression introduced by #121646 that can lead to a double free when dropping the channel. The details of the bug can be found in the corresponding crossbeam PR https://github.com/crossbeam-rs/crossbeam/pull/1187 Signed-off-by: Petros Angelatos <petrosagg@gmail.com> (cherry picked from commit b9e2ac5c7b1d6bb3b6f5fdfe0819eaf7e95bf7ff)
2025-04-18sync::mpsc: add miri reproducer of double freePetros Angelatos-0/+45
Signed-off-by: Petros Angelatos <petrosagg@gmail.com> (cherry picked from commit 9eb6a5446a4e35f48ad22a5b70a74a8badb9fa0d)
2025-04-17Use `eprint!` instead of `eprintln!`Guillaume Gomez-1/+1
(cherry picked from commit f9927ee042f7d7418fbb64082272ce1feff4d895)
2025-04-17Fix 2024 edition doctest panic outputGuillaume Gomez-3/+5
(cherry picked from commit a91e97c06c778b84663cfe4f2871b868d275a137)
2025-04-07[beta-1.87] Update cargoWeihang Lo-0/+0
2025-04-04bump stage0Boxy-464/+358
2025-03-31bump channelBoxy-1/+1
2025-03-29Auto merge of #138784 - madsmtm:bootstrap-bump-cc-cmake, r=jieyouxubors-13/+44
Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54 The `cc` version in `bootstrap` was reverted down to 1.1.22 in https://github.com/rust-lang/rust/pull/137460 (previously at 1.2.0). The offending issue has since then been resolved in https://github.com/rust-lang/cc-rs/pull/1413, and a new version of `cc` has been released in https://github.com/rust-lang/cc-rs/pull/1435, so let's try to update the version again. See [the `cc-rs` changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) and [the `cmake-rs` changelog](https://github.com/rust-lang/cmake-rs/blob/fd56c5a6b4ecda8815c863eb5b12d7b3f0391197/CHANGELOG.md) for details on what has changed here. r? jieyouxu who tried this last in https://github.com/rust-lang/rust/pull/137022. `@rustbot` label T-bootstrap try-job: *apple*
2025-03-28Rollup merge of #139065 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-66/+231
Miri subtree update r? `@ghost`
2025-03-28Rollup merge of #139045 - onur-ozkan:less-verbose-bootstrap-test, r=KobzolMatthias Krüger-1/+1
bootstrap: update `test_find` test `cc::Build::get_archiver` is noisy on the `arm-linux-androideabi` target and constantly printing `llvm-ar --version` output during bootstrap tests on all platforms.
2025-03-28Rollup merge of #139038 - adamgreig:thumb-target-maintainers, r=NoratriebMatthias Krüger-10/+5
Update target maintainers for thumb targets to reflect new REWG Arm team name Closes #139027 The name of the team responsible for these targets has changed as the team was merged with other Arm-related teams (see https://github.com/rust-embedded/wg/pull/818). The link gives an up-to-date list of github usernames that can be pinged, whereas the old email address is not very actively maintained or tracked.
2025-03-28Rollup merge of #138986 - Shourya742:2025-03-25-add-ignore-to-change-id, ↵Matthias Krüger-48/+79
r=Kobzol feat(config): Add ChangeId enum for suppressing warnings closes: #138925
2025-03-28Rollup merge of #138678 - durin42:rmeta-stability, r=fmeaseMatthias Krüger-1/+2
rustc_resolve: fix instability in lib.rmeta contents rust-lang/rust@23032f31c91f2 accidentally introduced some nondeterminism in the ordering of lib.rmeta files, which we caught in our bazel-based builds only recently due to being further behind than normal. In my testing, this fixes the issue.
2025-03-28Rollup merge of #138104 - GuillaumeGomez:simplify-doctest-parsing, r=fmeaseMatthias Krüger-357/+267
Greatly simplify doctest parsing and information extraction The original process was pretty terrible, as it tried to extract information such as attributes by performing matches over tokens like `#!`, which doesn't work very well considering you can have `# ! [`, which is valid. Also, it now does it in one pass: if the parser is happy, then we try to extract information, otherwise we return early. r? `@fmease`
2025-03-28cache mangle_internal_symbol resultsRalf Jung-33/+40
2025-03-28bootstrap: update `test_find` testonur-ozkan-1/+1
`cc::Build::get_archiver` is noisy on the `arm-linux-androideabi` target and constantly printing `llvm-ar --version` output during bootstrap tests on all platforms. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-28bootstrap: Update download-ci-llvm-stampMads Marquart-1/+1
This PR makes a fairly large version update to CMake and cc, so it is likely that LLVM is built differently.
2025-03-28bootstrap: Override CMAKE_OSX_SYSROOT when building compiler-rtMads Marquart-3/+4
Similarly to what was previously done for the `llvm` step.
2025-03-28bootstrap: Set CMAKE_SYSTEM_NAME=Darwin on Apple platformsMads Marquart-0/+8
compiler-rt's CMake setup seems to have special logic for Apple platforms that works poorly when this is not set.
2025-03-28bootstrap: Fix CMAKE_OSX_ARCHITECTURES on all Apple platformsMads Marquart-1/+1
2025-03-28bootstrap: Always set CMAKE_SYSTEM_NAME when cross-compilingMads Marquart-0/+24
To avoid a panic in cmake-rs that was introduced in: https://github.com/rust-lang/cmake-rs/pull/158
2025-03-28bootstrap: bump cc to 1.2.17 and cmake to 0.1.54Mads Marquart-8/+6
2025-03-28Add new change-id option in bootstrap.example.toml and update the change-id ↵bit-aloo-4/+8
description references
2025-03-28Update target maintainers for thumb targets to reflect new REWG Arm team nameAdam Greig-10/+5
2025-03-27Rollup merge of #139010 - madsmtm:parse-xcrun-better, r=wesleywiserJacob Pratt-6/+12
Improve `xcrun` error handling The compiler invokes `xcrun` on macOS when linking Apple targets, to find the Xcode SDK which contain all the necessary linker stubs. The error messages that `xcrun` outputs aren't always that great though, so this PR tries to improve that by providing extra context when an error occurs. Fixes https://github.com/rust-lang/rust/issues/56829. Fixes https://github.com/rust-lang/rust/issues/84534. Part of https://github.com/rust-lang/rust/issues/129432. See also the alternative https://github.com/rust-lang/rust/pull/131433. Tested on: - `x86_64-apple-darwin`, MacBook Pro running Mac OS X 10.12.6 - With no tooling installed - With Xcode 9.2 - With Xcode 9.2 Commandline Tools - `aarch64-apple-darwin`, MacBook M2 Pro running macOS 14.7.4 - With Xcode 13.4.1 - With Xcode 16.2 - Inside `nix-shell -p xcbuild` (nixpkgs' `xcrun` shim) - `aarch64-apple-darwin`, VM running macOS 15.3.1 - With no tooling installed - With Xcode 16.2 Commandline Tools ``@rustbot`` label O-apple r? compiler CC ``@BlackHoleFox`` ``@thomcc``
2025-03-27Auto merge of #139023 - jhpratt:rollup-4ou6ei4, r=jhprattbors-58/+148
Rollup of 7 pull requests Successful merges: - #138844 (expand: Leave traces when expanding `cfg` attributes) - #138926 (Remove `kw::Empty` uses from `rustc_middle`.) - #138989 (Clean up a few things in rustc_hir_analysis::check::region) - #138999 (Report compiletest pass mode if forced) - #139014 (Improve suggest construct with literal syntax instead of calling) - #139015 (Remove unneeded LLVM CI test assertions) - #139016 (Add job duration changes to post-merge analysis report) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-27Rollup merge of #139016 - Kobzol:post-merge-analysis-durations, r=marcoieniJacob Pratt-9/+118
Add job duration changes to post-merge analysis report This should help us observe large regressions in job duration changes. I would also like to add quick links to GH jobs/workflow to the post-merge workflow, but for that I first need to store some CI metadata to the bootstrap metrics, to make it easier to lookup the corresponding GH workflows (otherwise we'd need to look them up by commit SHA, which would be much more complicated). The last commit adds this metadata. Once this PR is merged, and the metadata will be available in the metrics stored on S3, I'll send a follow-up PR that uses the metadata to add links to job names in the post-merge workflow report. r? `@marcoieni`
2025-03-27Rollup merge of #139015 - Kobzol:llvm-ci-test-fixes, r=onur-ozkanJacob Pratt-21/+1
Remove unneeded LLVM CI test assertions The `download_ci_llvm` bootstrap test was checking implementation details of the LLVM CI download check, which isn't very useful. It was essentially testing "if function_that_checks_if_llvm_ci_is_available returns true, we enable CI LLVM", but the usage of the function was an implementation detail. After https://github.com/rust-lang/rust/pull/138704, the inner implementation has changed, so the test now breaks if LLVM is updated. I don't think that it's very useful to test implementation details like this, without taking the outside git state into account. Ideally, we should mock the git state for the test, otherwise the test will randomly break when executed in environments which the test does not control (e.g. on CI when a LLVM change happens). I only kept the part of the test that checks that LLVM CI isn't used when we specify `download-ci-llvm = false`, as that should hold under all conditions, CI/local, and all git states. I also kept the `if-unchanged` assertion, but only on CI, and as a temporary measure. After https://github.com/rust-lang/rust/pull/138591, we should have a proper way of mocking the git state to make the test robust, and make it test what we actually want. Fixes [this](https://github.com/rust-lang/rust/pull/138784#issuecomment-2751460456). r? `@ghost`
2025-03-27Rollup merge of #138999 - jieyouxu:spellout-pass-mode, r=wesleywiserJacob Pratt-12/+17
Report compiletest pass mode if forced This is very non-obvious if it fails in PR CI, because the starting invocation is miles away from the final test suite outcome.
2025-03-27Rollup merge of #138926 - nnethercote:less-kw-Empty-rustc_middle, r=lcnrJacob Pratt-6/+3
Remove `kw::Empty` uses from `rustc_middle`. There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks. r? `@lcnr`
2025-03-27Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercoteJacob Pratt-10/+9
expand: Leave traces when expanding `cfg` attributes This is the same as https://github.com/rust-lang/rust/pull/138515, but for `cfg(true)` instead of `cfg_attr`. The difference is that `cfg(true)`s already left "traces" after themselves - the `cfg` attributes themselves, with `expanded_inert_attrs` set to true, with full tokens, available to proc macros. This is not a reasonably expected behavior, but it could not be removed without a replacement, because a [major rustdoc feature](https://github.com/rust-lang/rfcs/pull/3631) and a number of clippy lints rely on it. This PR implements a replacement. This needs a crater run, because it changes observable behavior (in an intended way) - proc macros can no longer see expanded `cfg(true)` attributes. (Some minor unnecessary special casing for `sym::cfg_attr` is also removed in this PR.) r? `@nnethercote`
2025-03-27Only take outer attributes into account when generating content between ↵Guillaume Gomez-120/+19
first non-crate items and the crate items
2025-03-27add changeInfo to change trackerbit-aloo-0/+5
2025-03-27feat(config): Add ChangeId enum for suppressing warningsbit-aloo-48/+70
Introduces the `ChangeId` enum to allow suppressing `change_id` warnings. Now, `ChangeId` supports both numeric values and the string literal `"ignore"`. Numeric values behave as expected, while `"ignore"` is used to suppress warning messages.
2025-03-27Add CI metadata to bootstrap metricsJakub Beránek-5/+36
This will allow us to provide links to CI workflows, jobs and summaries in the post-merge analysis report.
2025-03-27librustdoc: also stabilize iteration order hereAugie Fackler-1/+2
2025-03-27Remove recursion in `check_item`Guillaume Gomez-16/+4
2025-03-27Add new regression test for doctestGuillaume Gomez-0/+131