about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-08-03Auto merge of #127324 - DianQK:match-br, r=cjgillotbors-536/+1936
Simplify match based on the cast result of `IntToInt` Continue to complete #124150. The condition in #120614 is wrong, e.g. `-1i8` cannot be converted to `255i16`. I've rethought the issue and simplified the conditional judgment for a more straightforward approach. The new approach is to check **if the case value after the `IntToInt` conversion equals the target value**. In different types, `IntToInt` uses different casting methods. This rule is as follows: - `i8`/`u8` to `i8`/`u8`: do nothing. - `i8` to `i16`/`u16`: sign extension. - `u8` to `i16`/`u16`: zero extension. - `i16`/`u16` to `i8`/`u8`: truncate to the target size. The previous error was a mix of zext and sext. r? mir-opt
2024-08-03Auto merge of #128370 - petrochenkov:libsearch, r=bjorn3bors-38/+65
linker: Pass fewer search directories to the linker - The logic for passing `-L` directories to the linker is consolidated in a single function, so the search priorities are immediately clear. - Only `-Lnative=`, `-Lframework=` `-Lall=` directories are passed to linker, but not `-Lcrate=` and others. That's because only native libraries are looked up by name by linker, all Rust crates are passed using full paths, and their directories should not interfere with linker search paths. - The main sysroot library directory shouldn't generally be passed because it shouldn't contain native libraries, except for one case which is now marked with a FIXME. - This also helps with https://github.com/rust-lang/rust/pull/123436, in which we need to walk the same list of directories manually. The next step is to migrate `find_native_static_library` to exactly the same set and order of search directories (which may be a bit annoying for the `iOSSupport` directories https://github.com/rust-lang/rust/pull/121430#issuecomment-2256372341).
2024-08-03Auto merge of #128404 - compiler-errors:revert-dead-code-changes, r=pnkfelixbors-662/+164
Revert recent changes to dead code analysis This is a revert to recent changes to dead code analysis, namely: * efdf219 Rollup merge of #128104 - mu001999-contrib:fix/128053, r=petrochenkov * a70dc297a899b76793a14c5705f6ec78fd7a57a7 Rollup merge of #127017 - mu001999-contrib:dead/enhance, r=pnkfelix * 31fe9628cf830a08e7194a446f66c668aaea86e9 Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix * 2724aeaaeb127a8073e39461caacbe21a128ce7b Rollup merge of #126618 - mu001999-contrib:dead/enhance, r=pnkfelix * 977c5fd419ade52467f7de79d5bfc25c0c893275 Rollup merge of #126315 - mu001999-contrib:fix/126289, r=petrochenkov * 13314df21b0bb0cdd02c6760581d1b9f1052fa7e Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this `AnonPipe` type is not publically reachable -- please correct me if I'm wrong cc `@NobodyXu` who added these in ##127153. Some of these reverts (#126315 and #126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs? I apologize for the size of the PR and the churn that it has on the codebase (and for reverting `@mu001999's` work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way. cc `@mu001999` r? `@pnkfelix` Fixes #128272 Fixes #126169
2024-08-03Remove another false-negative hidden by dead code changesMichael Goulet-4/+0
2024-08-03Bless test falloutMichael Goulet-6/+14
2024-08-03Suppress new false-negatives that were masked by dead code analysis changesMichael Goulet-0/+4
2024-08-03Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-273/+89
This reverts commit 13314df21b0bb0cdd02c6760581d1b9f1052fa7e, reversing changes made to 6e534c73c35f569492ed5fb5f349075d58ed8b7e.
2024-08-03Revert "Rollup merge of #126315 - mu001999-contrib:fix/126289, r=petrochenkov"Michael Goulet-34/+1
This reverts commit 977c5fd419ade52467f7de79d5bfc25c0c893275, reversing changes made to 24c94f0e4f5aa333c665fbbba423172c30176624.
2024-08-03Revert "Rollup merge of #126618 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-75/+36
This reverts commit 2724aeaaeb127a8073e39461caacbe21a128ce7b, reversing changes made to d929a42a664c026167800801b26d734db925314f.
2024-08-03Revert "Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix"Michael Goulet-164/+52
This reverts commit 31fe9628cf830a08e7194a446f66c668aaea86e9, reversing changes made to f20307851ead9fbbb9fa88bbffb3258a069230a6.
2024-08-03Revert "Rollup merge of #127017 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-87/+10
This reverts commit a70dc297a899b76793a14c5705f6ec78fd7a57a7, reversing changes made to ceae37188b9f1be527bb16c9d657a161be7dbbe3.
2024-08-03Revert "Rollup merge of #128104 - mu001999-contrib:fix/128053, r=petrochenkov"Michael Goulet-83/+22
This reverts commit 91b18a058c4661f82e420b633dc0a3e1ccd14b88, reversing changes made to 9aedec9313dc8ecf9bdcb5f09c4eb0ad8b9a4875.
2024-08-03Fix linking to sanitizers on Apple targetsVadim Petrochenkov-3/+7
2024-08-03linker: Pass fewer search directories to the linkerVadim Petrochenkov-38/+61
2024-08-03Auto merge of #128595 - matthiaskrgr:rollup-7a4qa8b, r=matthiaskrgrbors-199/+571
Rollup of 7 pull requests Successful merges: - #126704 (Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate) - #127586 (Add `#[must_use]` to some `into_raw*` functions.) - #128161 (nested aux-build in tests/rustdoc/ tests) - #128303 (Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}`) - #128368 (Formatting tweaks) - #128483 (Still more `cfg` cleanups) - #128557 (chore: use shorthand initializer) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-03Rollup merge of #128557 - nyurik:dup-init, r=compiler-errorsMatthias Krüger-2/+2
chore: use shorthand initializer Tiny readability improvement - don't use redundant initializer vars
2024-08-03Rollup merge of #128483 - nnethercote:still-more-cfg-cleanups, r=petrochenkovMatthias Krüger-153/+169
Still more `cfg` cleanups Found while looking closely at `cfg`/`cfg_attr` processing code. r? `````````@petrochenkov`````````
2024-08-03Rollup merge of #128368 - nnethercote:rustfmt-tweaks, r=cuviperMatthias Krüger-3/+5
Formatting tweaks Some small post-#125443 formatting tweaks. r? ``@cuviper``
2024-08-03Rollup merge of #128303 - NobodyXu:specialise-for-pipe, r=cuviperMatthias Krüger-0/+25
Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}` Enable `std::io::copy` specialisation on unix for the newly added anonymous pipe API, tracking issue rust-lang/rust#127154
2024-08-03Rollup merge of #128161 - EtomicBomb:just-compiletest, r=notriddleMatthias Krüger-35/+318
nested aux-build in tests/rustdoc/ tests * Fixes bug that prevented using nested aux-build in `tests/rustdoc/` tests. Before, `fn document` and the auxiliary builder disagreed about where to find the nested aux-build source file (`auxiliary/auxiliary/aux.rs` vs `auxiliary/aux.rs`), preventing them from building. Picked the latter in line with other builders in compiletest. * Adds `//@ doc-flags` header, which forwards flags to rustdoc and not rustc. * Adds `//@ unique-doc-out-dir` header, which sets the --out-dir for the rustdoc invocation to a unique directory: `<root out dir>/docs/<test name>/doc` * Changes working directory of the rustdoc invocation to the root out directory (common among all aux-builds). Prior art: exec_compiled_test in runtest.rs * Adds tests that use nested aux builds and new headers These changes provide useful capabilities for writing rustdoc tests on their own. They are also needed to test the implementation for the [mergable-rustdoc-cross-crate-info](https://github.com/rust-lang/rfcs/pull/3662) RFC. try-job: x86_64-msvc
2024-08-03Rollup merge of #127586 - zachs18:more-must-use, r=cuviperMatthias Krüger-4/+14
Add `#[must_use]` to some `into_raw*` functions. cc #121287 r? ``@cuviper`` Adds `#[must_use = "losing the pointer will leak memory"]`[^1] to `Box::into_raw(_with_allocator)`, `Vec::into_raw_parts(_with_alloc)`, `String::into_raw_parts`[^2], and `rc::{Rc, Weak}::into_raw_with_allocator` (Rc's normal `into_raw` and all of `Arc`'s `into_raw*`s are already `must_use`). Adds `#[must_use = "losing the raw <resource name may leak resources"]` to `IntoRawFd::into_raw_fd`, `IntoRawSocket::into_raw_socket`, and `IntoRawHandle::into_raw_handle`. [^1]: "*will* leak memory" may be too-strong wording (since `Box`/`Vec`/`String`/`rc::Weak` might not have a backing allocation), but I left it as-is for simplicity and consistency. [^2]: `String::into_raw_parts`'s `must_use` message is changed from the previous (possibly misleading) "`self` will be dropped if the result is not used".
2024-08-03Rollup merge of #126704 - sayantn:sha, r=AmanieuMatthias Krüger-2/+38
Added SHA512, SM3, SM4 target-features and `sha512_sm_x86` feature gate This is an effort towards #126624. This adds support for these 3 target-features and introduces the feature flag `sha512_sm_x86`, which would gate these target-features and the yet-to-be-implemented detection and intrinsics in stdarch.
2024-08-03Auto merge of #128356 - Oneirical:real-estate-reaLTOr, r=jieyouxubors-121/+200
Migrate `cross-lang-lto-clang` and `cross-lang-lto-pgo-smoketest` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). This has the same problem outlined by #126180, where the tests do not actually run as no test-running CI enviroment has `RUSTBUILD_FORCE_CLANG_BASED_TESTS` set. However, I still find it interesting to turn the Makefiles into the rmake format until the Clang issue is fixed. This should technically be tested on MSVC... if MSVC actually ran Clang tests. try-job: x86_64-gnu-debug
2024-08-03Auto merge of #128576 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 15 commits in 257b72b8adfb1f2aa9916cefca67285c21666276..fa646583675d7c140482bd906145c71b7fb4fc2b 2024-07-30 15:08:27 +0000 to 2024-08-02 16:08:06 +0000 - refactor(toml): Rename 'resolved' to 'normalized' (rust-lang/cargo#14342) - faq: rephrase offline usage. (rust-lang/cargo#14336) - docs(unstable): Improve nightly link (rust-lang/cargo#14344) - Fix a typo in 1.81 changes (rust-lang/cargo#14343) - Change tests to support `rustc` wording changes (rust-lang/cargo#14341) - chore(deps): update rust crate windows-sys to 0.59 (rust-lang/cargo#14335) - chore(deps): update rust crate gix to 0.64.0 (rust-lang/cargo#14332) - chore(deps): update compatible (rust-lang/cargo#14331) - chore(deps): update rust crate rusqlite to 0.32.0 (rust-lang/cargo#14334) - fix: also build manpage for cargo.md (rust-lang/cargo#14339) - fix(config): Adjust MSRV resolve config field name / values (rust-lang/cargo#14296) - fix(toml): Resolve regression from toml_edit 0.22.18 (rust-lang/cargo#14329) - test(publish): More dev-dep stripping cases (rust-lang/cargo#14327) - Use gmake on AIX (rust-lang/cargo#14323) - fix(publish): Don't strip non-dev features (rust-lang/cargo#14325) r? ghost
2024-08-03Re-enable SimplifyToExp in match_branches.DianQK-6/+1
2024-08-03Simplify match based on the cast result of `IntToInt`.DianQK-532/+1937
2024-08-02Update cargoWeihang Lo-0/+0
2024-08-03Auto merge of #128528 - ↵bors-30/+0
workingjubilee:you-dont-need-to-see-this-cpuid-move-along, r=Amanieu Finish removing `has_cpuid` The one use of it was guaranteed to be always true. try-job: test-various
2024-08-02Auto merge of #128361 - Oneirical:testle-deforestation, r=jieyouxubors-31/+59
Migrate `link-cfg` and `rustdoc-default-output` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-mingw try-job: x86_64-gnu-llvm-18 try-job: i686-msvc
2024-08-02chore: use shorthand initializerYuri Astrakhan-2/+2
2024-08-02run cross-lang-lto-pgo-smoketest in CI by renaming itOneirical-142/+35
2024-08-02rewrite cross-lang-lto-pgo-smoketest to rmakeOneirical-3/+147
2024-08-02rewrite cross-lang-lto-clang to rmakeOneirical-26/+68
2024-08-02rewrite rustdoc-default-output to rmakeOneirical-7/+16
2024-08-02Auto merge of #127926 - Oneirical:classical-orctestra, r=jieyouxubors-48/+149
Migrate `foreign-double-unwind`, `issue-36710` and `foreign-exceptions` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). ~~This is expected to fail CI, I am getting a weird `core dumped` error on `foreign-double-unwind` locally. Posting this to start a discussion.~~ EDIT: I got it, `foreign_double_unwind` is *supposed* to fail in the execution stage, but this wasn't obvious, because the original test was just piping the stdout to `CGREP` (which silently ignores errors). try-job: aarch64-apple try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc try-job: x86_64-gnu-llvm-18 try-job: i686-msvc try-job: dist-i586-gnu-i586-i686-musl
2024-08-02rewrite foreign-exceptions to rmakeOneirical-70/+48
2024-08-02rewrite and rename issue-36710 to rmakeOneirical-20/+27
2024-08-02rewrite foreign-double-unwind to rmakeOneirical-14/+130
2024-08-02Auto merge of #128352 - Oneirical:daLTOnist-vision, r=jieyouxubors-60/+148
Migrate `cross-lang-lto` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: i686-mingw try-job: x86_64-mingw try-job: armhf-gnu try-job: test-various try-job: aarch64-apple try-job: x86_64-gnu-llvm-18
2024-08-02rustfmt: Remove `has_cpuid` from testJubilee Young-18/+0
2024-08-02Auto merge of #128254 - Amanieu:orig-binary-search, r=tgross35bors-37/+50
Rewrite binary search implementation This PR builds on top of #128250, which should be merged first. This restores the original binary search implementation from #45333 which has the nice property of having a loop count that only depends on the size of the slice. This, along with explicit conditional moves from #128250, means that the entire binary search loop can be perfectly predicted by the branch predictor. Additionally, LLVM is able to unroll the loop when the slice length is known at compile-time. This results in a very compact code sequence of 3-4 instructions per binary search step and zero branches. Fixes #53823 Fixes #115271
2024-08-02Auto merge of #128529 - matthiaskrgr:rollup-gzq2slo, r=matthiaskrgrbors-225/+358
Rollup of 6 pull requests Successful merges: - #126818 (Better handle suggestions for the already present code and fix some suggestions) - #128436 (Update sysinfo version to 0.31.2) - #128453 (raw_eq: using it on bytes with provenance is not UB (outside const-eval)) - #128491 ([`macro_metavar_expr_concat`] Dogfooding) - #128494 (MIR required_consts, mentioned_items: ensure we do not forget to fill these lists) - #128521 (rustdoc: Remove dead opaque_tys rendering logic) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-02Rollup merge of #128521 - aDotInTheVoid:opaque-fallout, r=camelidMatthias Krüger-11/+0
rustdoc: Remove dead opaque_tys rendering logic #127276 removed OpaqueTy from clean, and the code populating AllTypes::opaque_tys, but not this field itself.
2024-08-02Rollup merge of #128494 - RalfJung:mir-lazy-lists, r=compiler-errorsMatthias Krüger-44/+113
MIR required_consts, mentioned_items: ensure we do not forget to fill these lists Bodies initially get created with empty required_consts and mentioned_items, but at some point those should be filled. Make sure we notice when that is forgotten.
2024-08-02Rollup merge of #128491 - c410-f3r:unlock-rfc-2011, r=workingjubileeMatthias Krüger-16/+3
[`macro_metavar_expr_concat`] Dogfooding cc #124225 Starts inner usage to test the robustness of the implementation.
2024-08-02Rollup merge of #128453 - RalfJung:raw_eq, r=saethlinMatthias Krüger-35/+9
raw_eq: using it on bytes with provenance is not UB (outside const-eval) The current behavior of raw_eq violates provenance monotonicity. See https://github.com/rust-lang/rust/pull/124921 for an explanation of provenance monotonicity. It is violated in raw_eq because comparing bytes without provenance is well-defined, but adding provenance makes the operation UB. So remove the no-provenance requirement from raw_eq. However, the requirement stays in-place for compile-time invocations of raw_eq, that indeed cannot deal with provenance. Cc `@rust-lang/opsem`
2024-08-02Rollup merge of #128436 - GuillaumeGomez:update-sysinfo, r=clubby789Matthias Krüger-61/+158
Update sysinfo version to 0.31.2 I needed to update `memchr` version (which was pinned in https://github.com/rust-lang/rust/commit/36a16798f798eb59db21ff2a8a163135b4a599fe). So let's see if it triggers the linker issue. try-job: x86_64-mingw
2024-08-02Rollup merge of #126818 - estebank:suggestions-fix, r=wesleywiserMatthias Krüger-58/+75
Better handle suggestions for the already present code and fix some suggestions When a suggestion part is for code that is already present, skip it. If all the suggestion parts for a suggestion are for code that is already there, do not emit the suggestion. Fix two suggestions that treat `span_suggestion` as if it were `span_help`.
2024-08-01std: Remove has_cpuidJubilee Young-12/+0
The one use of it was guaranteed to be always true.
2024-08-02Auto merge of #128147 - lolbinarycat:fmt-write-bloat-rmake, r=jieyouxubors-26/+89
migrate fmt-write-bloat to rmake try-job: aarch64-apple try-job: x86_64-gnu-llvm-18 try-job: dist-x86_64-linux