summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-09-02bump channel to stableBoxy-1/+1
2024-08-31ci: Try to remove unused Xcode dirsJubilee Young-0/+17
2024-08-30ci: Use mv instead of cp in upload stepJubilee Young-4/+4
2024-08-29rustdoc: do not run doctests with invalid langstringsMichael Howell-7/+19
(cherry picked from commit 7c4150fce0510218304b726174029fbb2c33ee03)
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-107/+42
This reverts commit 8c3a94a1c79c67924558a4adf7fb6d98f5f0f741, reversing changes made to 3d68afc9e821b00d59058abc9bda670b07639955.
2024-08-12bump stage0 to stable 1.80.1Josh Stone-430/+332
2024-08-01[beta-1.81] Update cargoWeihang Lo-0/+0
2024-07-24rustdoc: clean up and fix ord violations in item sortingMichael Howell-70/+119
Based on e3fdafc263a4a705a3bec1a6865a4d011b2ec7c5 with a few minor changes: - The name sorting function is changed to follow the [version sort] from the style guide - the `cmp` function is redesigned to more obviously make a partial order, by always return `cmp()` of the same variable as the `!=` above [version sort]: https://doc.rust-lang.org/nightly/style-guide/index.html#sorting Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-07-21Fix dry-run execution of pre-releaseMark Rousskov-0/+6
2024-07-21Switch channel to betaMark Rousskov-1/+1
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-20Auto merge of #128002 - matthiaskrgr:rollup-21p0cue, r=matthiaskrgrbors-47/+113
Rollup of 6 pull requests Successful merges: - #127463 ( use precompiled rustdoc with CI rustc) - #127779 (Add a hook for `should_codegen_locally`) - #127843 (unix: document unsafety for std `sig{action,altstack}`) - #127873 (kmc-solid: `#![forbid(unsafe_op_in_unsafe_fn)]`) - #127917 (match lowering: Split `finalize_or_candidate` into more coherent methods) - #127964 (run_make_support: skip rustfmt for lib.rs) r? `@ghost` `@rustbot` modify labels: rollup
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-47/+107
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-20Auto merge of #127658 - compiler-errors:precise-capturing-rustdoc-cross, ↵bors-17/+17
r=fmease Add cross-crate precise capturing support to rustdoc Follow-up to #127632. Fixes #127228. r? `@fmease` Tracking: * https://github.com/rust-lang/rust/issues/123432
2024-07-20use precompiled rustdoc with CI rustconur-ozkan-6/+53
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. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-20Rollup merge of #127984 - nyurik:src-refs, r=onur-ozkanMatthias Krüger-9/+9
Avoid ref when using format! in src Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing).  Inlining format args prevents accidental `&` misuse. See also https://github.com/rust-lang/rust-clippy/issues/10851
2024-07-20Rollup merge of #127866 - alexcrichton:disable-wasm-component-ld-by-default, ↵Matthias Krüger-5/+25
r=onur-ozkan Conditionally build `wasm-component-ld` This commit updates the support for the `wasm-component-ld` tool from #126967 to conditionally build rather than unconditionally building it when LLD is enabled. This support is disabled by default and can be enabled by one of two means: * the `extended` field in `config.toml` which dist builders use to build a complete set of tools for each host platform. * a `"wasm-component-ld"` entry in the `tools` section of `config.toml`. Neither of these are enabled by default meaning that most local builds will likely not have this new tool built. Dist builders should still, however, build the tool.
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/+52
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-19Avoid ref when using format! in compilerYuri Astrakhan-9/+9
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing).  Inlining format args prevents accidental `&` misuse.
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-37/+18
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 #127963 - GuillaumeGomez:fix-logo-display, r=notriddleMatthias Krüger-1/+0
Fix display of logo "border" Before: ![Screenshot from 2024-07-19 13-32-17](https://github.com/user-attachments/assets/381bb9c8-0ae0-408b-8476-9785ef1b5fd4) After: ![Screenshot from 2024-07-19 13-37-46](https://github.com/user-attachments/assets/19cdb71f-3912-4fcd-95de-99b9f86a8293) r? `@notriddle`
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 #127934 - Kobzol:checktools-better-error, r=onur-ozkanMatthias Krüger-0/+4
Improve error when a compiler/library build fails in `checktools.sh` Suggested by ``@RalfJung`` [here](https://github.com/rust-lang/rust/issues/127869#issuecomment-2235829643). `x86_64-gnu-tools` should take ~45 minutes, let's see if this doesn't regress it. r? ``@onur-ozkan``
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/+52
2024-07-19Add a change tracker entryAlex Crichton-0/+5
2024-07-19Conditionally build `wasm-component-ld`Alex Crichton-5/+20
This commit updates the support for the `wasm-component-ld` tool from #126967 to conditionally build it rather than unconditionally building it when LLD is enabled. This support is disabled by default and can be enabled by one of two means: * the `extended` field in `config.toml` which dist builders use to build a complete set of tools for each host platform. * a `"wasm-component-ld"` entry in the `tools` section of `config.toml`. Neither of these are enabled by default meaning that most local builds will likely not have this new tool built. Dist builders should still, however, build the tool.
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-5/+5
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-19Improve error when a compiler/library build fails in `checktools.sh`Jakub Beránek-0/+4
2024-07-19Fix display of logo "border"Guillaume Gomez-1/+0
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-19Rollup merge of #127932 - notriddle:notriddle/current, r=GuillaumeGomezMatthias Krüger-3/+5
rustdoc: fix `current` class on sidebar modnav | Before | After | | -- | -- | | ![image](https://github.com/user-attachments/assets/35866be8-5a58-41eb-9169-b2bb403fe7cd) | ![image](https://github.com/user-attachments/assets/89b087ea-82bf-49f5-9c87-20162880eb32)
2024-07-19Rollup merge of #127621 - Oneirical:hypnotest-show, r=jieyouxuMatthias Krüger-2/+0
Rewrite and rename `issue-22131` and `issue-26006` `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: i686-mingw
2024-07-19Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwUbors-42/+107
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`