about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-16uefi: Implement pathAyush Singh-5/+158
UEFI paths can be of 4 types: 1. Absolute Shell Path: Uses shell mappings 2. Absolute Device Path: this is what we want 3: Relative root: path relative to the current root. 4: Relative Absolute shell path can be identified with `:` and Absolute Device path can be identified with `/`. Relative root path will start with `\`. The algorithm is mostly taken from edk2 UEFI shell implementation and is somewhat simple. Check for the path type in order. For Absolute Shell path, use `EFI_SHELL->GetDevicePathFromMap` to get a BorrowedDevicePath for the volume. For Relative paths, we use the current working directory to construct the new path. BorrowedDevicePath abstraction is needed to interact with `EFI_SHELL->GetDevicePathFromMap` which returns a Device Path Protocol with the lifetime of UEFI shell. Absolute Shell paths cannot exist if UEFI shell is missing. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-14Auto merge of #135465 - jhpratt:rollup-7p93bct, r=jhprattbors-79/+488
Rollup of 10 pull requests Successful merges: - #134498 (Fix cycle error only occurring with -Zdump-mir) - #134977 (Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion) - #135390 (Re-added regression test for #122638) - #135393 (uefi: helpers: Introduce OwnedDevicePath) - #135440 (rm unnecessary `OpaqueTypeDecl` wrapper) - #135441 (Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024) - #135444 (Update books) - #135450 (Fix emscripten-wasm-eh with unwind=abort) - #135452 (bootstrap: fix outdated feature name in comment) - #135454 (llvm: Allow sized-word rather than ymmword in tests) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-13Rollup merge of #135454 - maurer:sized-word-ymmword, r=jieyouxuJacob Pratt-2/+2
llvm: Allow sized-word rather than ymmword in tests llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests. `@rustbot` label: +llvm-main
2025-01-13Rollup merge of #135452 - jieyouxu:fix-comment, r=compiler-errorsJacob Pratt-1/+1
bootstrap: fix outdated feature name in comment Follow-up to https://github.com/rust-lang/rust/pull/135391#discussion_r1912826594. I guess I updated everything else **except** the comment right next to the actual dependencies 💀 r? bootstrap
2025-01-13Rollup merge of #135450 - hoodmane:wasm-eh-abort-fix, r=workingjubileeJacob Pratt-3/+3
Fix emscripten-wasm-eh with unwind=abort If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort`. Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to #131830. r? workingjubilee
2025-01-13Rollup merge of #135444 - rustbot:docs-update, r=ehussJacob Pratt-1/+5
Update books ## rust-lang/book 10 commits in 04d06dfe541607e6419f3d028c3f9b245f3be4d9..5a65e2af063ff701ae858f1f7536ee347b3cfe63 2025-01-09 17:59:43 UTC to 2025-01-06 13:47:07 UTC - Appendix E: Update for 2024 Edition (rust-lang/book#4196) - Implement and integrate an mdBook plugin to strip markup from headings (rust-lang/book#4195) - Update appendix-06-translation.md - new persian translation added (rust-lang/book#4192) - Remove extraneous `use` statement (rust-lang/book#4193) - Take measurement inaccuracy intervals into account (rust-lang/book#4078) - Ch. 21.3: remove error ferris from working code (rust-lang/book#4183) - infra: match mdbook version in CI to rust-lang/rust (rust-lang/book#4191) - Ch. 17: Set correct heading level for the chapter (rust-lang/book#4190) - Switch back from `eprintln!` to `println!` in listing 17-12 (rust-lang/book#4178) - fix typo in Listing invocation for listing 20-14 (rust-lang/book#4184) ## rust-lang/nomicon 1 commits in 7ef05b9777c94836bc92f50f23e6e00981521a89..625b200e5b33a5af35589db0bc454203a3d46d20 2025-01-06 17:17:38 UTC to 2025-01-06 17:17:38 UTC - Fix accidental inline HTML in Markdown (rust-lang/nomicon#474) ## rust-lang/reference 3 commits in acd6794e712d5e2ef6f5c84fb95688d32a69b816..293af991003772bdccf2d6b980182d84dd055942 2025-01-07 16:31:22 UTC to 2025-01-06 17:17:15 UTC - Add spec identifiers to dynamically-sized-types.md (rust-lang/reference#1582) - fix typo in a "rule" name in type-coercions.md (rust-lang/reference#1708) - Fix unclosed `<sup>` elements (rust-lang/reference#1709) ## rust-lang/rust-by-example 2 commits in 093397535b48ae13ec76bc526b7e6eb8c096a85c..054259ed1bf01cdee4309ee764c7e103f6df3de5 2025-01-13 10:44:04 UTC to 2025-01-03 18:59:26 UTC - Fix function name in new_types.md in Japanese (rust-lang/rust-by-example#1907) - Fix typo in static_lifetime.md (rust-lang/rust-by-example#1905)
2025-01-13Rollup merge of #135441 - compiler-errors:redundant-captures-lint, r=lqdJacob Pratt-12/+16
Make sure to mark `IMPL_TRAIT_REDUNDANT_CAPTURES` as `Allow` in edition 2024 I never got sign-off on #127672 for this lint being warn by default in edition 2024, so let's turn downgrade this lint to allow for now. Should be backported so it ships with the edition. ```@rustbot``` label: +beta-nominated
2025-01-13Rollup merge of #135440 - lcnr:yeeeeeeeeeeeeeeeeeeeeeeet, r=compiler-errorsJacob Pratt-32/+24
rm unnecessary `OpaqueTypeDecl` wrapper
2025-01-13Rollup merge of #135393 - Ayush1325:uefi-helper-path, r=thomccJacob Pratt-7/+16
uefi: helpers: Introduce OwnedDevicePath This PR is split off from #135368 to reduce noise. No real functionality changes, just some quality of life improvements. Also implement Debug for OwnedDevicePath for some quality of life improvements.
2025-01-13Rollup merge of #135390 - ranger-ross:readd-test-122638, r=BoxyUwUJacob Pratt-0/+78
Re-added regression test for #122638 Re-adds the test for #122638 :smile: fixes #122638 r? `@BoxyUwU` (please let me know if this can be improved. I am still fairly new to using compiletest)
2025-01-13Rollup merge of #134977 - estebank:issue-112357, r=BoxyUwUJacob Pratt-5/+306
Detect `mut arg: &Ty` meant to be `arg: &mut Ty` and provide structured suggestion When a newcomer attempts to use an "out parameter" using borrows, they sometimes get confused and instead of mutating the borrow they try to mutate the function-local binding instead. This leads to either type errors (due to assigning an owned value to a mutable binding of reference type) or a multitude of lifetime errors and unused binding warnings. This change adds a suggestion to the type error ``` error[E0308]: mismatched types --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:6:14 | LL | fn change_object(mut object: &Object) { | ------- expected due to this parameter type LL | let object2 = Object; LL | object = object2; | ^^^^^^^ expected `&Object`, found `Object` | help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` and to the unused assignment lint ``` error: value assigned to `object` is never read --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:11:5 | LL | object = &object2; | ^^^^^^ | note: the lint level is defined here --> $DIR/mut-arg-of-borrowed-type-meant-to-be-arg-of-mut-borrow.rs:1:9 | LL | #![deny(unused_assignments, unused_variables)] | ^^^^^^^^^^^^^^^^^^ help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding | LL ~ fn change_object2(object: &mut Object) { LL | let object2 = Object; LL ~ *object = object2; | ``` Fix #112357.
2025-01-13Rollup merge of #134498 - oli-obk:push-wmxynprsyxvr, r=compiler-errorsJacob Pratt-16/+37
Fix cycle error only occurring with -Zdump-mir fixes #134205 During mir dumping, we evaluate static items to render their allocations. If a static item refers to itself, its own MIR will have a reference to itself, so during mir dumping we end up evaluating the static again, causing us to try to build MIR again (mir dumping happens during MIR building). Thus I disabled evaluation of statics during MIR dumps in case the MIR body isn't far enough along yet to be able to be guaranteed cycle free.
2025-01-14Auto merge of #135438 - matthiaskrgr:rollup-rt2zrbz, r=matthiaskrgrbors-122/+167
Rollup of 4 pull requests Successful merges: - #133752 (replace copypasted ModuleLlvm::parse) - #135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests) - #135405 (path: Move is_absolute check to sys::path) - #135426 (Assert that `Instance::try_resolve` is only used on body-like things) r? `@ghost` `@rustbot` modify labels: rollup try-job: x86_64-mingw-1
2025-01-13Fix emscripten-wasm-eh with unwind=abortHood Chatham-3/+3
If we build the standard library with wasm-eh then we need to link with `-fwasm-exceptions` even if we compile with `panic=abort` Without this change, linking a `panic=abort` crate fails with: `undefined symbol: __cpp_exception`. Followup to #131830.
2025-01-13llvm: Allow sized-word rather than ymmword in testsMatthew Maurer-2/+2
llvm/llvm-project#122530 changes LLVM to use sized-word rather than ymmword for scatter gather pointers. While this will not always be qword, it is for these two tests.
2025-01-14bootstrap: fix outdated feature name in comment许杰友 Jieyou Xu (Joe)-1/+1
2025-01-13uefi: helpers: Introduce OwnedDevicePathAyush Singh-7/+16
This PR is split off from #135368 to reduce noise. Rename DevicePath to OwnedDevicePath. This is to allow a non-owning version of DevicePath in the future to work with UEFI shell APIs which provide const pointers to device paths for UEFI shell fs mapping. Also implement Debug for OwnedDevicePath for some quality of life improvements. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13Auto merge of #135192 - jdupak-ms:cdb-tests, r=wesleywiserbors-49/+294
Add and improve debuginfo tests for Windows Adds new test for closures and function pointers. Improves robustness of existing tests by sorting wildcard matched outputs. try-job: i686-msvc
2025-01-13Mark rustbook as an external toolEric Huss-1/+5
It has been a bit of a pain trying to keep the lints in sync across the submodule repositories, so the just turns it off.
2025-01-13Update booksrustbot-0/+0
2025-01-13Make sure to mark IMPL_TRAIT_REDUNDANT_CAPTURES as Allow in edition 2024Michael Goulet-12/+16
2025-01-13Rollup merge of #135426 - compiler-errors:no-resolve-assoc-ty, r=lcnrMatthias Krüger-97/+116
Assert that `Instance::try_resolve` is only used on body-like things `Instance::resolve` is not set up to resolve items that are not body-like things. The logic in `resolve_associated_item` very much encodes this assumption: https://github.com/rust-lang/rust/blob/e7ad3ae331bf2716389c10e01612e201a7f98c8d/compiler/rustc_ty_utils/src/instance.rs#L96-L386 However, some diagnostics were using `Instance::resolve` on an associated type, and it was simply a lucky coicidence that nothing went wrong. This PR adds an assertion to make sure we won't do this again in the future, and fixes two callsites: 1. `call_kind` which returns a `CallKind` enum to categorize what a call in MIR comes from, and was using `Instance::resolve` to point at the associated type `Deref::Target` for a specific self ty. 2. `MirBorrowckCtxt::explain_deref_coercion`, which was doing the same thing. The logic was replaced with `specialization_graph::assoc_def`, which is the proper way of fetching the right `AssocItem` for a given impl. r? `@lcnr` or re-roll :)
2025-01-13Rollup merge of #135405 - Ayush1325:path-is-absolute, r=tgross35Matthias Krüger-11/+27
path: Move is_absolute check to sys::path I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1]. This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not. I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases. [0]: https://github.com/rust-lang/rust/pull/135368 [1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137
2025-01-13Rollup merge of #135245 - Enselic:no-set-env, r=davidtwcoMatthias Krüger-7/+21
rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests Avoid unsafe `std::env::set_var()` by allowing tests to inject `std::env::var("RUSTC_BOOTSTRAP")` with a `env_var_rustc_bootstrap` parameter. Part of https://github.com/rust-lang/rust/issues/130672 Discussed at https://github.com/rust-lang/rust/pull/129636#discussion_r1766381501 (CC `@compiler-errors` `@bjorn3)`
2025-01-13Rollup merge of #133752 - klensy:cp, r=davidtwcoMatthias Krüger-7/+3
replace copypasted ModuleLlvm::parse replaced code same as in https://github.com/rust-lang/rust/blob/bd36e69d2533ee750e2d805915b8ca88d2825e0f/compiler/rustc_codegen_llvm/src/lib.rs#L426-L445 except before error message was emitted via `write::llvm_err`, which returned other error kind, but it still ok?
2025-01-13rm unnecessary `OpaqueTypeDecl` wrapperlcnr-32/+24
2025-01-13Auto merge of #135204 - RalfJung:win64-zst, r=SparrowLiibors-271/+91
fix handling of ZST in win64 ABI on windows-msvc targets The Microsoft calling conventions do not really say anything about ZST since they do not seem to exist in MSVC. However, both GCC and clang allow passing ZST over `__attribute__((ms_abi))` functions (which matches our `extern "win64" fn`) on `windows-gnu` targets, and therefore implicitly define a de-facto ABI for these types (and lucky enough they seem to define the same ABI). This ABI should be the same for windows-msvc and windows-gnu targets, so we use this as a hint for how to implement this ABI everywhere: we always pass ZST by-ref. The best alternative would be to just reject compiling functions which cannot exist in MSVC, but that would be a breaking change. Cc `@programmerjake` `@ChrisDenton` Fixes https://github.com/rust-lang/rust/issues/132893
2025-01-13Auto merge of #135167 - mzacho:depth-limit-const-eval-query, r=oli-obkbors-33/+76
Depth limit const eval query Currently the const-eval query doesn't have a recursion limit or timeout, causing the complier to freeze in an infinite loop, see #125718. This PR depth limits the `eval_to_const_value_raw` query (with the [`recursion_limit`](https://doc.rust-lang.org/reference/attributes/limits.html) attribute) and improves the diagnostics for query overflow errors, so spans are reported for other dep kinds than `layout_of` (e.g. `eval_to_const_value_raw`). fixes #125718 fixes #114192
2025-01-13Add and improve debuginfo tests for WindowsJakub Dupak-49/+294
2025-01-13Auto merge of #135430 - jhpratt:rollup-39cecwd, r=jhprattbors-23/+404
Rollup of 3 pull requests Successful merges: - #135355 (ci: added test log format for ci) - #135386 (clean up code related to the rustdoc-js test suite) - #135391 (bootstrap: Implement conditional `tracing` infra) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-13path: Move is_absolute check to sys::pathAyush Singh-11/+27
I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1]. This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not. I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases. [0]: https://github.com/rust-lang/rust/pull/135368 [1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13Rollup merge of #135391 - jieyouxu:conditional-tracing, r=onur-ozkanJacob Pratt-6/+341
bootstrap: Implement conditional `tracing` infra Add a conditional `tracing` setup that is gated behind `BOOTSTRAP_TRACING` env var. This `tracing` infra is implemented by: - Introducing an optional `tracing` cargo feature in bootstrap. - Added optional `tracing*` dependencies which are gated behind the `tracing` cargo feature. - When `BOOTSTRAP_TRACING` is set, `bootstrap.py` will build bootstrap with `--features=tracing`. There is a small trick here to share `BOOTSTRAP_TRACING` env var without having to add a separate env var: - `BOOTSTRAP_TRACING=1` is not a registered `tracing` filter target, so that can be used to enable the `tracing` cargo feature yet not actually enable any tracing logs (useful for editor r-a setups without actually outputting any tracing logs). - `BOOTSTRAP_TRACING=TRACE` and such are actually valid `tracing` filters, but that sets `BOOTSTRAP_TRACING` anyway. Example usage: https://github.com/rust-lang/rust/pull/135299 (that experimental PR is not conditionally gated) This PR is intentionally kept minimal to focus on the infra itself. To get actual mileage, instrumentations will need to be added to individual `Step`s and such. r? `@onur-ozkan` (or reroll)
2025-01-13Rollup merge of #135386 - lolbinarycat:bootstrap-test-cleanup, r=jieyouxuJacob Pratt-14/+14
clean up code related to the rustdoc-js test suite r? `@jieyouxu`
2025-01-13Rollup merge of #135355 - ranger-ross:improved-ci-logs, r=onur-ozkanJacob Pratt-3/+49
ci: added test log format for ci This PR adds a new test render format specifically for ci. The goal as stated in #134910 is to make reviewing test failures in CI easier. See the new test output format in the CI for this PR ([here](https://github.com/rust-lang/rust/actions/runs/12723914643/job/35469515397?pr=135355)) closes #134910 cc: `@jyn514`
2025-01-13rustc-dev-guide: document `BOOTSTRAP_TRACING` and bootstrap `tracing` setup许杰友 Jieyou Xu (Joe)-0/+104
2025-01-13Auto merge of #135352 - notriddle:notriddle/stability-shown, r=camelidbors-1/+38
rustdoc: use import stability marker in display Fixes #135078
2025-01-13Assert that Instance::try_resolve is only used on body-like thingsMichael Goulet-97/+116
2025-01-13Auto merge of #135371 - Mark-Simulacrum:no-alloc-case-cmp, r=compiler-errorsbors-3/+5
Remove allocations from case-insensitive comparison to keywords Follows up on work in 99d02fb40fd339255ed08596ebeb41e9b8a09d45, expanding the alloc-free comparisons to more cases of case-insensitive keyword matching. r? ghost for perf
2025-01-13bootstrap.py: build bootstrap binary with `--features=tracing` if ↵许杰友 Jieyou Xu (Joe)-0/+4
`BOOTSTRAP_TRACING` env var is set
2025-01-13bootstrap: add `tracing` and `tracing-tree` based tracing setup许杰友 Jieyou Xu (Joe)-1/+36
2025-01-13bootstrap: add optional `tracing` cargo feature and optional `tracing*` deps许杰友 Jieyou Xu (Joe)-5/+197
2025-01-12Auto merge of #135420 - GuillaumeGomez:rollup-93vepka, r=GuillaumeGomezbors-1012/+483
Rollup of 7 pull requests Successful merges: - #135348 (rustdoc-json: Include items in stripped modules in `Crate::paths`.) - #135365 (Update the explanation for why we use box_new in vec!) - #135383 (De-abstract tagged ptr and make it covariant) - #135401 (Remove some empty expected files to fix blessing) - #135406 (Update unstable lint docs to include required feature attributes) - #135407 (Deny various clippy lints) - #135411 (run_make_support: add `#![warn(unreachable_pub)]`) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-12Rollup merge of #135411 - Urgau:unreach_pub-run-make, r=jieyouxuGuillaume Gomez-0/+1
run_make_support: add `#![warn(unreachable_pub)]` This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `run_make_support` crate. Related to https://github.com/rust-lang/compiler-team/issues/773 r? ``@jieyouxu``
2025-01-12Rollup merge of #135407 - joshtriplett:more-clippy, r=compiler-errorsGuillaume Gomez-12/+33
Deny various clippy lints Almost all of these clippy lints have zero occurrences. Two of them have one each, and this PR fixes those.
2025-01-12Rollup merge of #135406 - Aditya-PS-05:fix/unstable-lint-docs, r=compiler-errorsGuillaume Gomez-0/+5
Update unstable lint docs to include required feature attributes closes #135298 ## Summary This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage: - fuzzy_provenance_casts - lossy_provenance_casts - unqualified_local_imports - test_unstable_lint ## Changes Made: - Added the appropriate #![feature(...)] attributes to the example code for each lint. - Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior. Reference: - Used the `must_not_suspend` lint documentation as a template for these updates.
2025-01-12Rollup merge of #135401 - joshtriplett:empty-expected, r=lqdGuillaume Gomez-0/+0
Remove some empty expected files to fix blessing https://github.com/rust-lang/rust/pull/134808 made --bless remove empty expected files. Remove some empty files that were causing noise in unrelated `--bless` invocations.
2025-01-12Rollup merge of #135383 - BoxyUwU:cov_tag_ptr, r=compiler-errorsGuillaume Gomez-985/+291
De-abstract tagged ptr and make it covariant In #135272 I needed to use a tagged ptr in `hir::TyKind` in order to not regress hir type sizes. Unfortunately the existing `CopyTaggedPtr` abstraction is insufficient as it makes the `'hir` lifetime invariant. I spent some time trying to keep existing functionality while making it covariant but in the end I realised that actually we dont use *any* of this code *anywhere* in rustc, so I've just removed everything and replaced it with a much less general abstraction that is suitable for what I need in #135272. Idk if anyone has a preference for just keeping all the abstractions here in case anyone needs them in the future :woman_shrugging:
2025-01-12Rollup merge of #135365 - saethlin:box-new, r=compiler-errorsGuillaume Gomez-2/+2
Update the explanation for why we use box_new in vec! The perf run in this PR demonstrates that there is no longer a dramatic change in compile time with the intrinsic `box_new` vs calling `Box::new`, but I've locally confirmed that there is still a dramatic change in stack use.
2025-01-12Rollup merge of #135348 - aDotInTheVoid:pathspathspaths, r=GuillaumeGomezGuillaume Gomez-13/+151
rustdoc-json: Include items in stripped modules in `Crate::paths`. Closes #135309 When we're running rustdoc-json, we should err on the side of adding more items to `Cache::paths`, as that directly becomes `Crate::paths` in the output. r? ``@GuillaumeGomez.`` Best reviewed commit-by-commit.
2025-01-12Auto merge of #135384 - saethlin:inline-copy-from-slice, r=joboetbors-0/+1
Add #[inline] to copy_from_slice I'm doing cooked things to CGU partitioning for compiler-builtins (https://github.com/rust-lang/rust/pull/135395) and this was the lone symbol in my compiler-builtins rlib that wasn't an intrinsic. Adding `#[inline]` makes it go away. Perf report indicates a marginal but chaotic effect on compile time, marginal improvement in codegen. As expected.