about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-14Add testbjorn3-0/+29
2025-02-14Don't error when adding a staticlib with bitcode files compiled by newer LLVMbjorn3-6/+22
2025-02-14Auto merge of #137010 - workingjubilee:rollup-g00c07v, r=workingjubileebors-186/+314
Rollup of 9 pull requests Successful merges: - #135439 (Make `-O` mean `OptLevel::Aggressive`) - #136460 (Simplify `rustc_span` `analyze_source_file`) - #136904 (add `IntoBounds` trait) - #136908 ([AIX] expect `EINVAL` for `pthread_mutex_destroy`) - #136924 (Add profiling of bootstrap commands using Chrome events) - #136951 (Use the right binder for rebinding `PolyTraitRef`) - #136981 (ci: switch loongarch jobs to free runners) - #136992 (Update backtrace) - #136993 ([cg_llvm] Remove dead error message) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-13Rollup merge of #136993 - dpaoliello:cleanllvm4, r=workingjubileeJubilee-8/+0
[cg_llvm] Remove dead error message Part of #135502 Discovered a dead error message in rustc_codegen_llvm, so removing it. r? ``@Zalathar``
2025-02-13Rollup merge of #136992 - ehuss:update-backtrace, r=workingjubileeJubilee-0/+0
Update backtrace This updates the backtrace submodule. 6 commits in f8cc6ac9acc4e663ecd96f9bcf1ff4542636d1b9..9d2c34e7e63afe1e71c333b247065e3b7ba4d883 2025-01-04 03:37:47 +0100 to 2025-02-13 14:14:18 -0800 - Various cleanups: https://github.com/rust-lang/backtrace-rs/pull/673 - libunwind: Use builtin _Unwind_GetIP for NuttX on ARM platform: https://github.com/rust-lang/backtrace-rs/pull/692 - remove outdated docs part on Dbghelp::ensure_open: https://github.com/rust-lang/backtrace-rs/pull/696 - Cleanup Windows trace modules: https://github.com/rust-lang/backtrace-rs/pull/697 - Attempt to fix ARM32 Windows: https://github.com/rust-lang/backtrace-rs/pull/685 - Prepare backtrace for Rust 2024: https://github.com/rust-lang/backtrace-rs/pull/700
2025-02-13Rollup merge of #136981 - marcoieni:no-largedisk-loongarch, r=KobzolJubilee-2/+2
ci: switch loongarch jobs to free runners try-job: dist-loongarch64-linux try-job: dist-loongarch64-musl
2025-02-13Rollup merge of #136951 - compiler-errors:clause-binder, r=lqdJubilee-2/+20
Use the right binder for rebinding `PolyTraitRef` Fixes #136940 I committed a slightly different test which still demonstrates the issue.
2025-02-13Rollup merge of #136924 - Kobzol:bootstrap-tracing, r=jieyouxuJubilee-4/+84
Add profiling of bootstrap commands using Chrome events Since we now have support for tracing in bootstrap, and the execution of most commands is centralized within a few functions, it's quite trivial to also trace command execution, and visualize it using the Chrome profiler. This can be helpful both to profile what takes time in bootstrap and also to get a visual idea of what happens in a given bootstrap invocation (since the execution of external commands is usually the most interesting thing). This is how it looks: ![image](https://github.com/user-attachments/assets/3351489e-3a0f-4729-9082-5bf40c586d4b) I first tried to use [tracing-flame](https://github.com/tokio-rs/tracing/tree/master/tracing-flame), but the output wasn't very useful, because the event/stackframe names were bootstrap code locations, instead of the command contents. r? ``@jieyouxu``
2025-02-13Rollup merge of #136908 - mustartt:aix-mutex-destory-einval, r=joboetJubilee-3/+3
[AIX] expect `EINVAL` for `pthread_mutex_destroy` Calling `pthread_mutex_destory` on a mutex initalized with the static initializer macro `PTHREAD_MUTEX_INITIALIZER` will result in `EINVAL` if the mutex is not lock/unlocked prior to calling `pthread_mutex_destroy`.
2025-02-13Rollup merge of #136904 - pitaj:range-into_bounds, r=tgross35Jubilee-1/+111
add `IntoBounds` trait for `range_into_bounds` feature Tracking issue: #136903 ACP: https://github.com/rust-lang/libs-team/issues/538
2025-02-13Rollup merge of #136460 - real-eren:simplify-rustc_span-analyze, r=NoratriebJubilee-132/+55
Simplify `rustc_span` `analyze_source_file` Simplifies the logic to what the code *actually* does, which is to just record newlines and multibyte characters. Checking for other ASCII control characters is unnecessary because the generic fallback doesn't do anything for those cases. Also uses a simpler (and more efficient) means of iterating the set bits of the mask.
2025-02-13Rollup merge of #135439 - clubby789:O3, r=NoratriebJubilee-34/+39
Make `-O` mean `OptLevel::Aggressive` Implementation of this MCP: https://github.com/rust-lang/compiler-team/issues/828, changing the meaning of `-O` from `-Copt-level=2` to `-Copt-level=3`. This also renames `OptLevel::Default` to `OptLevel::More`, as `Default` no longer makes sense.
2025-02-14Auto merge of #137001 - workingjubilee:rollup-u3dn4gc, r=workingjubileebors-681/+1159
Rollup of 11 pull requests Successful merges: - #136863 (rework rigid alias handling ) - #136869 (Fix diagnostic when using = instead of : in let binding) - #136895 (debuginfo: Set bitwidth appropriately in enum variant tags) - #136928 (eagerly prove WF when resolving fully qualified paths) - #136941 (Move `llvm.ccache` to `build.ccache`) - #136950 (rustdoc: use better, consistent SVG icons for scraped examples) - #136957 (coverage: Eliminate more counters by giving them to unreachable nodes) - #136960 (Compiletest should not inherit all host RUSTFLAGS) - #136962 (unify LLVM version finding logic) - #136970 (ci: move `x86_64-gnu-debug` job to the free runner) - #136973 (Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump)) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-13Rollup merge of #136973 - jyn514:fulldeps-stage1, r=jieyouxuJubilee-6/+8
Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump) "stage 1" for fulldeps means "compile with stage 0, link against stage 1". But this code wanted to switch on the compiler that's building, not the compiler that's being tested. Fix the check. Previously, it would fail with a warning about linker-messages: ``` --- stderr ------------------------------- warning[E0602]: unknown lint: `linker_messages` | = note: requested on the command line with `-A linker_messages` = note: `#[warn(unknown_lints)]` on by default ``` cc https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E, https://github.com/rust-lang/rust/pull/136960
2025-02-13Rollup merge of #136970 - marcoieni:no-largedisk, r=KobzolJubilee-3/+1
ci: move `x86_64-gnu-debug` job to the free runner try-job: x86_64-gnu-debug
2025-02-13Rollup merge of #136962 - onur-ozkan:fix-enzyme-note, r=jieyouxuJubilee-10/+18
unify LLVM version finding logic kind a self-explanatory
2025-02-13Rollup merge of #136960 - jyn514:compiletest-args, r=jieyouxuJubilee-6/+5
Compiletest should not inherit all host RUSTFLAGS I told ``@rhelmot`` to do this in #134913. But it's not correct; compiletest shouldn't inherit RUSTFLAGS at all. Pass a single new --host-rustcflags to compiletest instead, without overwriting any existing arguments. Fixes the following failure, which only happens when building llvm from source and then running `x test --stage 1 ui-fulldeps`: ``` diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 0b3bb14ce51..978ac46c5a2 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr ``@@`` -1,3 +1,8 ``@@`` +warning[E0602]: unknown lint: `linker_messages` + | + = note: requested on the command line with `-A linker_messages` + = note: `#[warn(unknown_lints)]` on by default ``` See https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E for more context.
2025-02-13Rollup merge of #136957 - Zalathar:counters, r=oli-obkJubilee-229/+237
coverage: Eliminate more counters by giving them to unreachable nodes When preparing a function's coverage counters and metadata during codegen, any part of the original coverage graph that was removed by MIR optimizations can be treated as having an execution count of zero. Somewhat counter-intuitively, if we give those unreachable nodes a _higher_ priority for receiving physical counters (instead of counter expressions), that ends up reducing the total number of physical counters needed. This works because if a node is unreachable, we don't actually create a physical counter for it. Instead that node gets a fixed zero counter, and any other node that would have relied on that physical counter in its counter expression can just ignore that term completely.
2025-02-13Rollup merge of #136950 - notriddle:notriddle/svg-example-buttons, ↵Jubilee-5/+76
r=GuillaumeGomez rustdoc: use better, consistent SVG icons for scraped examples ## Screenshots ![](https://github.com/user-attachments/assets/f305fb20-5ded-428a-b0d0-04e8b7762769) ![](https://github.com/user-attachments/assets/5b9bee5e-74b9-447b-a19a-49f32b6bf218) ![image](https://github.com/user-attachments/assets/d855a8c8-dc24-44f9-a067-1e0f0654c28a) ![image](https://github.com/user-attachments/assets/71bca54a-0562-480a-8989-938acc351307) ## Description This continues two ongoing projects - Replacing ascii art with real icons that don't look like syntax, are understandable to people who're familiar with desktop computers and smart devices, and aren't ugly. - Using labels and tooltips to clarify these icons, when the limits of popular iconography hit us. In this case, I've added tooltips, because, unfortunately, there's not room for always-visible labels. r? ``@GuillaumeGomez``
2025-02-13Rollup merge of #136941 - Kobzol:ccache-build, r=onur-ozkanJubilee-15/+34
Move `llvm.ccache` to `build.ccache` (S)ccache can be useful for more things that just LLVM. For example, we will soon want to use it also for GCC, and theoretically also for building stage0 Rust tools (https://github.com/rust-lang/rust/pull/136921, https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Using.20sccache.20for.20Rust). r? ``@onur-ozkan``
2025-02-13Rollup merge of #136928 - lcnr:method-lookup-check-wf, r=compiler-errorsJubilee-158/+338
eagerly prove WF when resolving fully qualified paths fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/161. This hopefully shouldn't impact perf. I do think we need to deal with at least part of the fallout here, opening for vibes. r? ``@compiler-errors``
2025-02-13Rollup merge of #136895 - maurer:fix-enum-discr, r=nikicJubilee-3/+9
debuginfo: Set bitwidth appropriately in enum variant tags Previously, we unconditionally set the bitwidth to 128-bits, the largest an enum would possibly be. Then, LLVM would cut down the constant by chopping off leading zeroes before emitting the DWARF. LLVM only supported 64-bit enumerators, so this would also have occasionally resulted in truncated data. LLVM added support for 128-bit enumerators in llvm/llvm-project#125578 That patchset trusts the constant to describe how wide the variant tag is, so the high 64-bits of zeros are considered potentially load-bearing. As a result, we went from emitting tags that looked like: DW_AT_discr_value (0xfe) (because `dwarf::BestForm` selected `data1`) to emitting tags that looked like: DW_AT_discr_value (<0x10> fe ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ) This makes the `DW_AT_discr_value` encode at the bitwidth of the tag, which: 1. Is probably closer to our intentions in terms of describing the data. 2. Doesn't invoke the 128-bit support which may not be supported by all debuggers / downstream tools. 3. Will result in smaller debug information.
2025-02-13Rollup merge of #136869 - chenyukang:yukang-fix-133713-let-binding, r=estebankJubilee-1/+73
Fix diagnostic when using = instead of : in let binding Fixes #133713 r? ``@estebank``
2025-02-13Rollup merge of #136863 - lcnr:treat-as-rigid, r=compiler-errorsJubilee-245/+360
rework rigid alias handling Necessary for https://github.com/rust-lang/rust/pull/136824 if we treat coinductive cycles as errors as we otherwise don't emit an error for ```rust trait Overflow { type Assoc; } impl<T> Overflow for T { type Assoc = <T as Overflow>::Assoc; } ``` The important part is that we only add a `RigidAlias` candidate in cases where the alias is actually supposed to be rigid: - its trait bound has been proven via a `ParamEnv` or `ItemBound` candidate - it's one of the special builtin traits which have a blanket impl with a `default` assoc type This means that we now more explicitly control which aliases should rigid to avoid accidentally accepting cyclic aliases. This requires changes to diagnostics as we no longer enter an explicit `RigidAlias` candidate for `NormalizesTo` goals whose trait bound doesn't hold. To fix this I've modified the `BestObligation` visitor always ignore `RigidAlias` candidates and to instead manually check these requirements if there are no applicable candidates. I also removed the hack for handling `structurally_normalize_ty` failures. This fixes #134905 as we no longer continue to use the `EvalCtxt` even though a nested goal failed. r? ``@compiler-errors``
2025-02-14fallout :skull_emoji:lcnr-133/+291
2025-02-13[cg_llvm] Remove dead error messageDaniel Paoliello-8/+0
2025-02-14eagerly prove WF when resolving fully qualified pathslcnr-25/+47
2025-02-13adjust derive_errorlcnr-79/+204
2025-02-13Update backtraceEric Huss-0/+0
2025-02-13Auto merge of #134633 - GrigorenkoPV:get_disjoint_mut, r=cuviperbors-103/+98
Stabilize `get_many_mut` as `get_disjoint_mut` Tracking issue: #104642 Closes #104642 FCP completed in https://github.com/rust-lang/rust/issues/104642#issuecomment-2558161073
2025-02-13rework pointee handling for the new rigid alias approachlcnr-67/+79
2025-02-13normalizes-to rework rigid alias handlinglcnr-99/+77
2025-02-13Make `-O` mean `-C opt-level=3`clubby789-34/+39
2025-02-13ci: switch loongarch jobs to free runnersMarcoIeni-2/+2
2025-02-13Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obkbors-129/+158
valtree performance tuning Summary: This PR makes type checking of code with many type-level constants faster. After https://github.com/rust-lang/rust/pull/136180 was merged, we observed a small perf regression (https://github.com/rust-lang/rust/pull/136318#issuecomment-2635562821). This happened because that PR introduced additional copies in the fast reject code path for consts, which is very hot for certain crates: https://github.com/rust-lang/rust/blob/6c1d960d88dd3755548b3818630acb63fa98187e/compiler/rustc_type_ir/src/fast_reject.rs#L486-L487 This PR improves the performance again by properly interning the valtrees so that copying and comparing them becomes faster. This will become especially useful with `feature(adt_const_params)`, so the fast reject code doesn't have to do a deep compare of the valtrees. Note that we can't just compare the interned consts themselves in the fast reject, because sometimes `'static` lifetimes in the type are be replaced with inference variables (due to canonicalization) on one side but not the other. A less invasive alternative that I considered is simply avoiding copies introduced by https://github.com/rust-lang/rust/pull/136180 and comparing the valtrees it in-place (see commit: https://github.com/rust-lang/rust/commit/9e91e50ac5920f0b9b4a3b1e0880c85336ba5c64 / perf results: https://github.com/rust-lang/rust/pull/136593#issuecomment-2642303245), however that was still measurably slower than interning. There are some minor regressions in secondary benchmarks: These happen due to changes in memory allocations and seem acceptable to me. The crates that make heavy use of valtrees show no significant changes in memory usage.
2025-02-13Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump)jyn-6/+8
"stage 1" for fulldeps means "compile with stage 0, link against stage 1". But this code wanted to switch on the compiler that's building, not the compiler that's being tested. Fix the check. Previously, it would fail with a warning about linker-messages: ``` --- stderr ------------------------------- warning[E0602]: unknown lint: `linker_messages` | = note: requested on the command line with `-A linker_messages` = note: `#[warn(unknown_lints)]` on by default ```
2025-02-13unify LLVM version finding logiconur-ozkan-10/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-13Document bootstrap profilingJakub Beránek-0/+8
2025-02-13Add export of bootstrap tracing to Chrome eventsJakub Beránek-11/+35
2025-02-13Trace execution of bootstrap commandsJakub Beránek-2/+50
2025-02-13Remove `llvm.ccache` option from `config.example.toml`Jakub Beránek-4/+0
2025-02-13Auto merge of #136965 - jhpratt:rollup-bsnqvmf, r=jhprattbors-791/+1232
Rollup of 8 pull requests Successful merges: - #134999 (Add cygwin target.) - #136559 (Resolve named regions when reporting type test failures in NLL) - #136660 (Use a trait to enforce field validity for union fields + `unsafe` fields + `unsafe<>` binder types) - #136858 (Parallel-compiler-related cleanup) - #136881 (cg_llvm: Reduce visibility of all functions in the llvm module) - #136888 (Always perform discr read for never pattern in EUV) - #136948 (Split out the `extern_system_varargs` feature) - #136949 (Fix import in bench for wasm) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-13ci: move `x86_64-gnu-debug` job to the free runnerMarcoIeni-3/+1
2025-02-13Rollup merge of #136949 - ehuss:wasm-bench-time, r=jhprattJacob Pratt-2/+1
Fix import in bench for wasm This import was causing annoying unused import errors when checking the standard library for some wasm targets. The problem is that everything here is disabled if it is wasm32, but this import wasn't cfg'd.
2025-02-13Rollup merge of #136948 - workingjubilee:split-off-extern-system-varargs, ↵Jacob Pratt-53/+63
r=compiler-errors Split out the `extern_system_varargs` feature After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`. Tracking issue: - https://github.com/rust-lang/rust/issues/136946
2025-02-13Rollup merge of #136888 - compiler-errors:never-read, r=NadrierilJacob Pratt-47/+82
Always perform discr read for never pattern in EUV Always perform a read of `!` discriminants to ensure that it's captured by closures in expr use visitor Fixes #136852 r? Nadrieril or reassign
2025-02-13Rollup merge of #136881 - dpaoliello:cleanllvm3, r=ZalatharJacob Pratt-421/+479
cg_llvm: Reduce visibility of all functions in the llvm module Next part of #135502 This reduces the visibility of all functions in the `llvm` module to `pub(crate)` and marks the `enzyme_ffi` modules with `#![expect(dead_code)]` (as previously discussed: <https://github.com/rust-lang/rust/pull/135502#discussion_r1915608085>). r? ``@Zalathar``
2025-02-13Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, ↵Jacob Pratt-77/+17
r=SparrowLii Parallel-compiler-related cleanup Parallel-compiler-related cleanup I carefully split changes into commits. Commit messages are self-explanatory. Squashing is not recommended. cc "Parallel Rustc Front-end" https://github.com/rust-lang/rust/issues/113349 r? SparrowLii ``@rustbot`` label: +WG-compiler-parallel
2025-02-13Rollup merge of #136660 - compiler-errors:BikeshedGuaranteedNoDrop, r=lcnrJacob Pratt-167/+427
Use a trait to enforce field validity for union fields + `unsafe` fields + `unsafe<>` binder types This PR introduces a new, internal-only trait called `BikeshedGuaranteedNoDrop`[^1] to faithfully model the field check that used to be implemented manually by `allowed_union_or_unsafe_field`. https://github.com/rust-lang/rust/blob/942db6782f4a28c55b0b75b38fd4394d0483390f/compiler/rustc_hir_analysis/src/check/check.rs#L84-L115 Copying over the doc comment from the trait: ```rust /// Marker trait for the types that are allowed in union fields, unsafe fields, /// and unsafe binder types. /// /// Implemented for: /// * `&T`, `&mut T` for all `T`, /// * `ManuallyDrop<T>` for all `T`, /// * tuples and arrays whose elements implement `BikeshedGuaranteedNoDrop`, /// * or otherwise, all types that are `Copy`. /// /// Notably, this doesn't include all trivially-destructible types for semver /// reasons. /// /// Bikeshed name for now. ``` As far as I am aware, there's no new behavior being guaranteed by this trait, since it operates the same as the manually implemented check. We could easily rip out this trait and go back to using the manually implemented check for union fields, however using a trait means that this code can be shared by WF for `unsafe<>` binders too. See the last commit. The only diagnostic changes are that this now fires false-negatives for fields that are ill-formed. I don't consider that to be much of a problem though. r? oli-obk [^1]: Please let's not bikeshed this name lol. There's no good name for `ValidForUnsafeFieldsUnsafeBindersAndUnionFields`.
2025-02-13Rollup merge of #136559 - ↵Jacob Pratt-19/+38
compiler-errors:resolve-regions-for-type-test-failure, r=BoxyUwU Resolve named regions when reporting type test failures in NLL Just a improvement tweak to an error message that I broke out of a bigger PR that I had to close lol