summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-08-26Auto merge of #13290 - Jarcho:interior_mut_quick, r=Alexendoobors-6/+23
`declare_interior_mutable_const`: Ignore pointer types. fixes #12951 fixes #13233 changelog: `declare_interior_mutable_const`: Ignore pointer types.
2024-08-26Auto merge of #13168 - Alexendoo:std-instead-of-core-msrv, r=Manishearthbors-20/+83
Make `std_instead_of_core` somewhat MSRV aware For #13158, this catches some things e.g. `core::net` and the recently stable `core::error` but not things moved individually like `UnwindSafe`, as far as I can see the version for those isn't easily available Beta nominating since ideally we'd get this change in the same version as `core::error` becomes stable cc `@kpreid` changelog: none
2024-08-26Auto merge of #12892 - meithecatte:needless-borrows-mutrefs, r=xFrednetbors-5/+59
needless_borrows_for_generic_args: Fix for &mut This commit fixes a bug introduced in #12706, where the behavior of the lint has been changed, to avoid suggestions that introduce a move. The motivation in the commit message is quite poor (if the detection for significant drops is not sufficient because it's not transitive, the proper fix would be to make it transitive). However, #12454, the linked issue, provides a good reason for the change — if the value being borrowed is bound to a variable, then moving it will only introduce friction into future refactorings. Thus #12706 changes the logic so that the lint triggers if the value being borrowed is Copy, or is the result of a function call, simplifying the logic to the point where analysing "is this the only use of this value" isn't necessary. However, said PR also introduces an undocumented carveout, where referents that themselves are mutable references are treated as Copy, to catch some cases that we do want to lint against. However, that is not sound — it's possible to consume a mutable reference by moving it. To avoid emitting false suggestions, this PR reintroduces the referent_used_exactly_once logic and runs that check for referents that are themselves mutable references. Thinking about the code shape of &mut x, where x: &mut T, raises the point that while removing the &mut outright won't work, the extra indirection is still undesirable, and perhaps instead we should suggest reborrowing: &mut *x. That, however, is left as possible future work. Fixes #12856 changelog: none
2024-08-20[beta-1.81] Update cargoWeihang Lo-0/+0
2024-08-15Revert "Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwU"Boxy-71/+31
This reverts commit 8c3a94a1c79c67924558a4adf7fb6d98f5f0f741, reversing changes made to 3d68afc9e821b00d59058abc9bda670b07639955.
2024-08-01[beta-1.81] Update cargoWeihang Lo-0/+0
2024-07-20Auto merge of #127663 - Oneirical:fuzzy-testure, r=jieyouxubors-9/+0
Migrate 9 more very similar FFI `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). For the tracking issue: - return-non-c-like-enum-from-c - pass-non-c-like-enum-to-c - c-static-dylib - c-static-rlib - extern-fn-generic - extern-fn-with-union - lto-no-link-whole-rlib - linkage-attr-on-static - issue-28595
2024-07-20Rollup merge of #127964 - jieyouxu:rmake-rustfmt-skip, r=nnethercoteMatthias Krüger-0/+6
run_make_support: skip rustfmt for lib.rs To avoid them getting reordered once https://github.com/rust-lang/rust/pull/125443 goes through. r? ``@nnethercote`` (since you were working on this)
2024-07-20Rollup merge of #127463 - onur-ozkan:precompiled-rustdoc, r=KobzolMatthias Krüger-1/+1
use precompiled rustdoc with CI rustc When CI rustc is enabled and rustdoc sources are unchanged, we can use the precompiled rustdoc from the CI rustc's sysroot. This speeds up bootstrapping quite a lot by avoiding unnecessary rustdoc compilation.
2024-07-20Rollup merge of #127693 - Rejyr:migrate-crate-hash-rustc-version-rmake, ↵Matthias Krüger-1/+0
r=jieyouxu Migrate `crate-hash-rustc-version` to `rmake` Part of #121876. r? ``@jieyouxu`` try-job: x86_64-gnu-llvm-18 try-job: dist-x86_64-linux
2024-07-19Auto merge of #127968 - fmease:upd-jsondocck-directive-style, r=GuillaumeGomezbors-47/+51
Update jsondocck directives to follow ui_test-style Context: Comment chain in #125813. Follow-up to #126788. Use the same temporary approach of "double parsing" until we figure out how we want to support compiletest/ui_test directive "add-ons" for child test runners like HtmlDocCk and JsonDocCk. I didn't touch much of jsondocck because I want to refactor it some other time (for robustness, maintainability and better diagnostics; basically by following a similar design of my WIP HtmlDocCk-next, cc #125780). r? `@GuillaumeGomez`
2024-07-19rewrite linkage-attr-on-static to rmakeOneirical-2/+0
2024-07-19rewrite lto-no-link-whole-rlib to rmakeOneirical-1/+0
2024-07-19rewrite extern-fn-with-union to rmakeOneirical-1/+0
2024-07-19rewrite extern-fn-generic to rmakeOneirical-1/+0
2024-07-19rewrite c-static-rlib to rmakeOneirical-1/+0
2024-07-19rewrite c-static-dylib to rmakeOneirical-1/+0
2024-07-19rewrite and rename issue-28595 to rmakeOneirical-1/+0
2024-07-19rewrite return-non-c-like-enum-from-c to rmakeOneirical-1/+0
2024-07-19Auto merge of #127969 - matthiaskrgr:rollup-nhxmwhn, r=matthiaskrgrbors-36/+14
Rollup of 7 pull requests Successful merges: - #112328 (Feat. adding ext that returns change_time) - #126199 (Add `isqrt` to `NonZero<uN>`) - #127856 (interpret: add sanity check in dyn upcast to double-check what codegen does) - #127934 (Improve error when a compiler/library build fails in `checktools.sh`) - #127960 (Cleanup dll/exe filename calculations in `run_make_support`) - #127963 (Fix display of logo "border") - #127967 (Disable run-make/split-debuginfo test for RISC-V 64) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Rollup merge of #127960 - jieyouxu:minor-rmake-cleanup, r=fmeaseMatthias Krüger-30/+6
Cleanup dll/exe filename calculations in `run_make_support` Use `std::env::consts` constants since now we have access to them (unlike in Makefiles!) ^^ cc `@bzEq` (this is one of the places in our test suites that tries to compute e.g. dylib extension; using `std::env::consts::DLL_EXTENSION` should correctly return `a` for AIX) r? `@fmease` (thank you for the suggestion in https://github.com/rust-lang/rust/pull/127760#discussion_r1678079698, this also improves correctness for the support library!) try-job: aarch64-apple try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc try-job: x86_64-gnu-llvm-18
2024-07-19Rollup merge of #127856 - RalfJung:interpret-cast-sanity, r=oli-obkMatthias Krüger-6/+8
interpret: add sanity check in dyn upcast to double-check what codegen does For dyn receiver calls, we already have two codepaths: look up the function to call by indexing into the vtable, or alternatively resolve the DefId given the dynamic type of the receiver. With debug assertions enabled, the interpreter does both and compares the results. (Without debug assertions we always use the vtable as it is simpler.) This PR does the same for dyn trait upcasts. However, for casts *not* using the vtable is the easier thing to do, so now the vtable path is the debug-assertion-only path. In particular, there are cases where the vtable does not contain a pointer for upcasts but instead reuses the old pointer: when the supertrait vtable is a prefix of the larger vtable. We don't want to expose this optimization and detect UB if people do a transmute assuming this optimization, so we cannot in general use the vtable indexing path. r? ``@oli-obk``
2024-07-19Update jsondocck directives to follow ui_test-styleLeón Orell Valerian Liehr-47/+51
2024-07-19run_make_support: skip rustfmt for lib.rs to preserve use ordering许杰友 Jieyou Xu (Joe)-0/+6
2024-07-19Auto merge of #127957 - matthiaskrgr:rollup-1u5ivck, r=matthiaskrgrbors-2/+0
Rollup of 6 pull requests Successful merges: - #127350 (Parser: Suggest Placing the Return Type After Function Parameters) - #127621 (Rewrite and rename `issue-22131` and `issue-26006` `run-make` tests to rmake) - #127662 (When finding item gated behind a `cfg` flag, point at it) - #127903 (`force_collect` improvements) - #127932 (rustdoc: fix `current` class on sidebar modnav) - #127943 (Don't allow unsafe statics outside of extern blocks) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19run_make_support: cleanup dll/exe filename calculations许杰友 Jieyou Xu (Joe)-30/+6
2024-07-19Auto merge of #127956 - tgross35:rollup-8ten7pk, r=tgross35bors-5/+2
Rollup of 7 pull requests Successful merges: - #121533 (Handle .init_array link_section specially on wasm) - #127825 (Migrate `macos-fat-archive`, `manual-link` and `archive-duplicate-names` `run-make` tests to rmake) - #127891 (Tweak suggestions when using incorrect type of enum literal) - #127902 (`collect_tokens_trailing_token` cleanups) - #127928 (Migrate `lto-smoke-c` and `link-path-order` `run-make` tests to rmake) - #127935 (Change `binary_asm_labels` to only fire on x86 and x86_64) - #127953 ([compiletest] Search *.a when getting dynamic libraries on AIX) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-19Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwUbors-31/+71
Represent type-level consts with new-and-improved `hir::ConstArg` ### Summary This is a step toward `min_generic_const_exprs`. We now represent all const generic arguments using an enum that differentiates between const *paths* (temporarily just bare const params) and arbitrary anon consts that may perform computations. This will enable us to cleanly implement the `min_generic_const_args` plan of allowing the use of generics in paths used as const args, while disallowing their use in arbitrary anon consts. Here is a summary of the salient aspects of this change: - Add `current_def_id_parent` to `LoweringContext` This is needed to track anon const parents properly once we implement `ConstArgKind::Path` (which requires moving anon const def-creation outside of `DefCollector`). - Create `hir::ConstArgKind` enum with `Path` and `Anon` variants. Use it in the existing `hir::ConstArg` struct, replacing the previous `hir::AnonConst` field. - Use `ConstArg` for all instances of const args. Specifically, use it instead of `AnonConst` for assoc item constraints, array lengths, and const param defaults. - Some `ast::AnonConst`s now have their `DefId`s created in rustc_ast_lowering rather than `DefCollector`. This is because in some cases they will end up becoming a `ConstArgKind::Path` instead, which has no `DefId`. We have to solve this in a hacky way where we guess whether the `AnonConst` could end up as a path const since we can't know for sure until after name resolution (`N` could refer to a free const or a nullary struct). If it has no chance as being a const param, then we create a `DefId` in `DefCollector` -- otherwise we decide during ast_lowering. This will have to be updated once all path consts use `ConstArgKind::Path`. - We explicitly use `ConstArgHasType` for array lengths, rather than implicitly relying on anon const type feeding -- this is due to the addition of `ConstArgKind::Path`. - Some tests have their outputs changed, but the changes are for the most part minor (including removing duplicate or almost-duplicate errors). One test now ICEs, but it is for an incomplete, unstable feature and is now tracked at https://github.com/rust-lang/rust/issues/127009. ### Followup items post-merge - Use `ConstArgKind::Path` for all const paths, not just const params. - Fix (no github dont close this issue) #127009 - If a path in generic args doesn't resolve as a type, try to resolve as a const instead (do this in rustc_resolve). Then remove the special-casing from `rustc_ast_lowering`, so that all params will automatically be lowered as `ConstArgKind::Path`. - (?) Consider making `const_evaluatable_unchecked` a hard error, or at least trying it in crater r? `@BoxyUwU`
2024-07-19Rollup merge of #127953 - bzEq:aix-compiletest-dylib-suffix, r=jieyouxuTrevor Gross-0/+2
[compiletest] Search *.a when getting dynamic libraries on AIX AIX uses `.a` as dylib suffix. Support it in compiletest.
2024-07-19Rollup merge of #127928 - Oneirical:anatesthetic-sleep, r=KobzolTrevor Gross-2/+0
Migrate `lto-smoke-c` and `link-path-order` `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).
2024-07-19Rollup merge of #127825 - Oneirical:self-testeem, r=jieyouxuTrevor Gross-3/+0
Migrate `macos-fat-archive`, `manual-link` and `archive-duplicate-names` `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). Please try: try-job: x86_64-msvc try-job: aarch64-apple
2024-07-19Revert format changeKai Luo-25/+5
2024-07-19AIX uses .a as dylib's suffixKai Luo-5/+27
2024-07-18rewrite link-path-order to rmakeOneirical-1/+0
2024-07-18rewrite lto-smoke-c to rmakeOneirical-1/+0
2024-07-18Rewrite and rename issue-26006 to rmakeOneirical-1/+0
2024-07-18Rewrite and rename issue-22131 to rmakeOneirical-1/+0
2024-07-18rewrite archive-duplicate-names to rmakeOneirical-1/+0
2024-07-18rewrite manual-link to rmakeOneirical-1/+0
2024-07-18rewrite macos-fat-archive to rmakeOneirical-1/+0
2024-07-18Rollup merge of #127822 - Oneirical:amazon-rainfortest, r=jieyouxuTrevor Gross-3/+0
Migrate `issue-85401-static-mir`, `missing-crate-dependency` and `unstable-flag-required` `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: armhf-gnu try-job: test-various try-job: x86_64-msvc try-job: aarch64-apple try-job: dist-x86_64-linux
2024-07-18Rollup merge of #127687 - RalfJung:pattern-cleanup, r=oli-obk,lcnrTrevor Gross-2/+1
Const-to-pattern-to-MIR cleanup Now that all uses of constants without structural equality are hard errors, there's a bunch of cleanup we can do in the code that handles patterns: we can always funnel patterns through valtrees first (rather than having a fallback path for when valtree construction fails), and we can make sure that if we emit a `PartialEq` call it is not calling anything user-defined. To keep the error messages the same, I made valtree construction failures return the information of *which* type it is that cannot be valtree'd. `search_for_structural_match_violation` is now not needed any more at all, so I removed it. r? `@oli-obk`
2024-07-18Rollup merge of #127491 - Oneirical:bulletproof-test, r=jieyouxuTrevor Gross-8/+0
Migrate 8 very similar FFI `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). There are some more of these, but while the code is almost always the same, I want to keep the number reasonable so my doc comments can be inspected for potential inaccuracies. Tell me if 8 is too much, I can cut this down. For the tracking issue: - issue-25581 - extern-fn-with-extern-types - extern-fn-struct-passing-abi - longjmp-across-rust - static-extern-type - extern-fn-explicit-align - extern-fn-with-packed-struct - extern-fn-mangle
2024-07-18avoid creating an Instance only to immediately disassemble it againRalf Jung-1/+0
2024-07-18valtree construction: keep track of which type was valtree-incompatibleRalf Jung-1/+1
2024-07-18interpret: add sanity check in dyn upcast to double-check what codegen doesRalf Jung-6/+8
2024-07-17Migrate `atomic-lock-free` to `rmake`Jerry Wang-1/+0
2024-07-17Add `llvm_components_contain` to `run-make-support`Jerry Wang-1/+8
2024-07-17rewrite unstable-flag-required to rmakeOneirical-1/+0
2024-07-17rewrite missing-crate-dependency to rmakeOneirical-1/+0