about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-20Rollup merge of #128005 - ChrisDenton:msvc-include, r=joboetMatthias Krüger-13/+0
Remove _tls_used hack All the MSVC targets use `target_thread_locals` (see the [base spec](https://github.com/rust-lang/rust/blob/1afc5fd042f7583b9668dd62be98325487483d1c/compiler/rustc_target/src/spec/base/windows_msvc.rs#L34)) so this hack is no longer needed. The compiler will ensure that thread locals work properly.
2024-07-20Rollup merge of #127975 - GuillaumeGomez:fix-trait-bounds-display, r=notriddleMatthias Krüger-16/+68
Fix trait bounds display Fixes https://github.com/rust-lang/rust/issues/127398. I took a simple rule: if there are more than two bounds, we display them like rustfmt. Before this PR: ![Screenshot from 2024-07-19 17-38-59](https://github.com/user-attachments/assets/4162b57e-7ebb-48f9-a3a1-25e443c140cb) After this PR: ![Screenshot from 2024-07-19 17-39-09](https://github.com/user-attachments/assets/a3ba22dd-5f34-45d0-ad9d-0cdf89dc509c) r? `@notriddle`
2024-07-20Rollup merge of #127958 - jieyouxu:compiletest-rmake-cleanup, r=KobzolMatthias Krüger-92/+186
Cleanup rmake.rs setup in compiletest While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible: - Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before. - Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s). - Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`. - Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables. - Prune useless env vars passed to both `rustc` and recipe binary commands. - Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling. This PR is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/127920. r? bootstrap (or Kobzol, or Mark, or T-compiler) try-job: aarch64-apple try-job: armhf-gnu try-job: dist-x86_64-linux try-job: test-various try-job: x86_64-mingw try-job: x86_64-msvc try-job: x86_64-gnu-llvm-18
2024-07-20Rollup merge of #127867 - alexcrichton:add-wasm32-wasip2-to-dist-manifest, ↵Matthias Krüger-0/+1
r=Mark-Simulacrum Add `wasm32-wasip2` to `build-manifest` tool This is an accidental omission of mine from #126967 which means that `rustup target add wasm32-wasip2` isn't working on today's nightlies.
2024-07-20Rollup merge of #127839 - ehuss:safe-directory-docker, r=Mark-SimulacrumMatthias Krüger-1/+1
Fix git safe-directory path for docker images This fixes the path for configuring the git safe.directory setting inside docker images. AFAIK, `~/gitconfig` without a dot is not something that git uses ([ref](https://git-scm.com/docs/git-config)). This was needed in my environment to avoid the ` fatal: detected dubious ownership in repository at '/checkout'` error. For context, this was added in #99967.
2024-07-20Rollup merge of #127752 - uweigand:s390x-miropt-update, r=Mark-SimulacrumMatthias Krüger-4/+3
Ignore allocation bytes in one more mir-opt test Following on PR #126502, add `rustc -Zdump-mir-exclude-alloc-bytes` to tests/mir-opt/dataflow-const-prop/aggregate_copy.rs as well to skip writing allocation bytes in MIR dumps. Fixes #126261
2024-07-20Rollup merge of #127734 - ChrisDenton:netc, r=Mark-SimulacrumMatthias Krüger-109/+109
Windows: move BSD socket shims to netc On Windows we need to alter a few types so that they can be used in the cross-platform socket code. Currently these alterations are spread throughout the `c` module with some more in the `netc` module. Let's gather all our BSD compatibility shims in the `netc` module so it's all in one place and easier to discover.
2024-07-20Rollup merge of #127720 - c410-f3r:concat-rep, r=cjgillotMatthias Krüger-45/+90
[`macro_metavar_expr_concat`] Allow `concat` in repetitions cc #127723
2024-07-20Auto merge of #128002 - matthiaskrgr:rollup-21p0cue, r=matthiaskrgrbors-222/+370
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-20Remove _tls_used hackChris Denton-13/+0
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 #127917 - Zalathar:after-or, r=NadrierilMatthias Krüger-91/+129
match lowering: Split `finalize_or_candidate` into more coherent methods I noticed that `finalize_or_candidate` was responsible for several different postprocessing tasks, making it difficult to understand. This PR aims to clean up some of the confusion by: - Extracting `remove_never_subcandidates` from `merge_trivial_subcandidates` - Extracting `test_remaining_match_pairs_after_or` from `finalize_or_candidate` - Taking what remains of `finalize_or_candidate`, and inlining it into its caller --- Reviewing individual commits and ignoring whitespace is recommended. Most of the large-looking changes are just moving existing code around, mostly unaltered. r? ``@Nadrieril``
2024-07-20Rollup merge of #127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, ↵Matthias Krüger-2/+5
r=Amanieu kmc-solid: `#![forbid(unsafe_op_in_unsafe_fn)]` The path logic _should_ handle the forbiddance in the itron sources correctly, despite them being an "out-of-line" module.
2024-07-20Rollup merge of #127843 - workingjubilee:break-up-big-ass-stack-overflow-fn, ↵Matthias Krüger-24/+61
r=joboet unix: document unsafety for std `sig{action,altstack}` I found many surprising elements here while trying to wrap a measly 5 functions with `unsafe`. I would rather not "just" mindlessly wrap this code with `unsafe { }`, so I decided to document it properly. On Unix, this code covers the "create and setup signal handler" part of the stack overflow code, and serves as the primary safety boundary for the signal handler. It is rarely audited, very gnarly, and worth extra attention. It calls other unsafe functions defined in this module, but "can we correctly map the right memory, or find the right address ranges?" are separate questions, and get increasingly platform-specific. The question here is the more general "are we doing everything in the correct order, and setting up the handler in the correct way?" As part of this audit, I noticed that we do some peculiar things that we should probably refrain from. However, I avoided making changes that I deemed might have a different final result in Rust programs. I did, however, reorder some events so that the signal handler is installed _after_ we install the alternate stack. We do not run much code between these events, but it is probably best if the timespan between the handler being available and the new stack being installed is 0 nanoseconds.
2024-07-20Rollup merge of #127779 - momvart:should_codegen_hook, r=cjgillotMatthias Krüger-58/+62
Add a hook for `should_codegen_locally` This PR lifts the module-local function `should_codegen_locally` to `TyCtxt` as a hook. In addition to monomorphization, this function is used for checking the dependency of `compiler_builtins` on other libraries. Moving this function to the hooks also makes overriding it possible for the tools that use the rustc interface.
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/+87
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-20compiletest/rmake: simplify path calculations许杰友 Jieyou Xu (Joe)-36/+10
2024-07-20compiletest/rmake: avoid double test directory for rmake.rs tests许杰友 Jieyou Xu (Joe)-2/+8
This is important for other tests that have various things like modes, revisions and the like. These features are not supported in run-make tests, so we don't need the double layering.
2024-07-20compiletest/rmake: improve comments许杰友 Jieyou Xu (Joe)-30/+7
2024-07-20compiletest/rmake: prune unused `RUST_BUILD_STAGE` and explain env vars ↵许杰友 Jieyou Xu (Joe)-6/+20
passed to recipes
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-20Auto merge of #127998 - matthiaskrgr:rollup-ykp0h5r, r=matthiaskrgrbors-294/+1296
Rollup of 9 pull requests Successful merges: - #123196 (Add Process support for UEFI) - #127556 (Replace a long inline "autoref" comment with method docs) - #127693 (Migrate `crate-hash-rustc-version` to `rmake`) - #127866 (Conditionally build `wasm-component-ld` ) - #127918 (Safely enforce thread name requirements) - #127948 (fixes panic error `index out of bounds` in conflicting error) - #127980 (Avoid ref when using format! in compiler) - #127984 (Avoid ref when using format! in src) - #127987 (More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait`) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-20Auto merge of #127003 - GrigorenkoPV:107975, r=SparrowLiibors-0/+799
Add a test for #107975 The int is zero. But also not zero. This is so much fun. This is a part of #105107. Initially I was going to just rebase #108445, but quite a few things changed since then: * The [mcve](https://github.com/rust-lang/rust/issues/105787#issuecomment-1750112388) used for #105787 got fixed.[^upd2] * You can't just `a ?= b` for #107975 anymore. Now you have to `a-b ?= 0`. This is what this PR does. As an additional flex, it show that three ways of converting a pointer to its address have this issue: 1. `as usize` 2. `.expose_provenance()` 3. `.addr()` * #108425 simply got fixed. Yay. As an aside, the naming for `addr_of!` is quite unfortunate in context of provenance APIs. Because `addr_of!` gives you a pointer, but what provenance APIs refer to as "address" is the `usize` value. Oh well. UPD1: GitHub is incapable of parsing #107975 in the PR name, so let's add it here. [^upd2]: UPD2: [The other mcve](https://github.com/rust-lang/rust/issues/105787#issue-1500501670) does not work anymore either, saying "this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details."
2024-07-20Rollup merge of #127987 - estebank:impl-trait-sugg, r=cjgillotMatthias Krüger-64/+71
More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait` When encountering `-> Trait`, suggest `-> Box<dyn Trait>` (instead of `-> Box<Trait>`. If there's a single returned type within the `fn`, suggest `-> impl Trait`.
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 #127980 - nyurik:compiler-refs, r=oli-obkMatthias Krüger-65/+61
Avoid ref when using format! in compiler 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 #127948 - surechen:fix_127915, r=compiler-errorsMatthias Krüger-4/+49
fixes panic error `index out of bounds` in conflicting error fixes #127915
2024-07-20Rollup merge of #127918 - ChrisDenton:thread-name-string, r=joboetMatthias Krüger-23/+51
Safely enforce thread name requirements The requirements for the thread name to be both UTF-8 and null terminated are easily enforced by a wrapper type so lets do that. The fact this used to be just a bare `CString` has tripped me up before because it was entirely safe to use a non UTF-8 `CString`.
2024-07-20Rollup merge of #127866 - alexcrichton:disable-wasm-component-ld-by-default, ↵Matthias Krüger-5/+26
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-39/+57
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-20Rollup merge of #127556 - Zalathar:autoref, r=NadrierilMatthias Krüger-81/+84
Replace a long inline "autoref" comment with method docs This comment has two problems: - It is very long, making the flow of the enclosing method hard to follow. - It starts by talking about an `autoref` flag that hasn't existed since #59114. - This makes it hard to trust that the information in the comment is accurate or relevant, even though much of it still seems to be true. This PR therefore replaces the long inline comment with a revised doc comment on `bind_matched_candidate_for_guard`, and some shorter inline comments. For readers who want more historical context, we also link to the PR that added the old comment, and the PR that removed the `autoref` flag.
2024-07-20Rollup merge of #123196 - Ayush1325:uefi-process, r=joboetMatthias Krüger-4/+888
Add Process support for UEFI UEFI does not have an actual process. However, it does provide methods to launch and execute another UEFI image. Having process support is important since it is possible to run rust test suit using `Command::output` and is the first step towards being able to run it for UEFI. Here is an overview of how the support is implemented. - We create a copy of the SystemTable. This is required since at least OVMF seems to crash if the original system table is modified. - Stdout and Stderr pipe works by registering a new `simple_text_output` Protocol and pointing the child system table to use those. - `Stdio::Inherit` just points the console to the current running image console which seems to work with even 3 levels of process. - `spawn` is left unimplemented since it does not make sense for UEFI architecture. Additionally, since https://github.com/rust-lang/rust/pull/105458 was merged, the `spawn` and `output` implementations are completely independent.
2024-07-20Inline `finalize_or_candidate`Zalathar-17/+7
2024-07-20Improve `test_remaining_match_pairs_after_or`Zalathar-0/+13
2024-07-20Split out `test_remaining_match_pairs_after_or`Zalathar-43/+58
Only the last candidate can possibly have more match pairs, so this can be separate from the main or-candidate postprocessing loop.
2024-07-20Improve `merge_trivial_subcandidates`Zalathar-5/+15
2024-07-20Split out `remove_never_subcandidates`Zalathar-37/+47
2024-07-19Allow concat in repetitionsCaio-45/+90
2024-07-19Auto merge of #127968 - fmease:upd-jsondocck-directive-style, r=GuillaumeGomezbors-1090/+1095
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-19std: forbid unwrapped unsafe in unsupported_backslashJubilee Young-0/+1
2024-07-19kmc-solid: forbid(unsafe_op_in_unsafe_fn)Jubilee Young-2/+4
2024-07-19Add a bunch of tests for #107975Pavel Grigorenko-0/+799
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-19More accurate suggestion for `-> Box<dyn Trait>` or `-> impl Trait`Esteban Küber-64/+71
When encountering `-> Trait`, suggest `-> Box<dyn Trait>` (instead of `-> Box<Trait>`. If there's a single returned type within the `fn`, suggest `-> impl Trait`.
2024-07-19Add GUI test for trait bounds displayGuillaume Gomez-0/+41
2024-07-19Reduce width to ensure that the name is wider and thus still triggering the ↵Guillaume Gomez-9/+13
scroll
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-65/+61
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-19Improve display of trait bounds when there are more than twoGuillaume Gomez-7/+14
2024-07-19Auto merge of #127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgrbors-212/+744
Rollup of 6 pull requests Successful merges: - #127295 (CFI: Support provided methods on traits) - #127814 (`C-cmse-nonsecure-call`: improved error messages) - #127949 (fix: explain E0120 better cover cases when its raised) - #127966 (Use structured suggestions for unconstrained generic parameters on impl blocks) - #127976 (Lazy type aliases: Diagostics: Detect bivariant ty params that are only used recursively) - #127978 (Avoid ref when using format! for perf) r? `@ghost` `@rustbot` modify labels: rollup