about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-24Use short type string in E0308 secondary span labelEsteban Küber-9/+43
We were previously printing the full type on the "this expression has type" label. ``` error[E0308]: mismatched types --> $DIR/secondary-label-with-long-type.rs:8:9 | LL | let () = x; | ^^ - this expression has type `((..., ..., ..., ...), ..., ..., ...)` | | | expected `((..., ..., ..., ...), ..., ..., ...)`, found `()` | = note: expected tuple `((..., ..., ..., ...), ..., ..., ...)` found unit type `()` = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/secondary-label-with-long-type/secondary-label-with-long-type.long-type-3987761834644699448.txt' = note: consider using `--verbose` to print the full type name to the console ``` Reported in a comment of #135919.
2025-01-23Auto merge of #135921 - matthiaskrgr:rollup-5mzn76m, r=matthiaskrgrbors-94/+669
Rollup of 9 pull requests Successful merges: - #134746 (Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver) - #135552 ([AIX] Lint on structs that have a different alignment in AIX's C ABI) - #135779 (CI: free disk on linux arm runner) - #135790 (Update windows-gnu targets to set `DebuginfoKind::DWARF`) - #135879 (fix outdated file path ref in llvm) - #135883 (Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`) - #135884 (remove implied end of slice) - #135887 (improvements on `build_steps::test` implementation) - #135898 (rustdoc-json-types: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-23Auto merge of #135494 - yotamofek:rustdoc-fmt-from_fn, r=fmeasebors-172/+127
Refactor `fmt::Display` impls in rustdoc This PR does a couple of things, with the intention of cleaning up and streamlining some of the `fmt::Display` impls in rustdoc: 1. Use the unstable [`fmt::from_fn`](https://github.com/rust-lang/rust/issues/117729) instead of open-coding it. 2. ~~Replace bespoke implementations of `Itertools::format` with the method itself.~~ 4. Some more minor cleanups - DRY, remove unnecessary calls to `Symbol::as_str()`, replace some `format!()` calls with lazier options The changes are mostly cosmetic but some of them might have a slight positive effect on performance.
2025-01-23Rollup merge of #135898 - aDotInTheVoid:dyndoc, r=fmeaseMatthias Krüger-2/+1
rustdoc-json-types: Finalize dyn compatibility renaming Followup to #131595. Part of #130852. Inspired by #135858 (does the same thing but for the rustdoc-types docs). r? ````@fmease````
2025-01-23Rollup merge of #135887 - onur-ozkan:testing-improvements, r=jieyouxuMatthias Krüger-65/+37
improvements on `build_steps::test` implementation Reviewing commits one-by-one should make it easier to understand.
2025-01-23Rollup merge of #135884 - hkBst:patch-13, r=compiler-errorsMatthias Krüger-1/+1
remove implied end of slice
2025-01-23Rollup merge of #135883 - GrigorenkoPV:btree_set_upper_bound_mut, r=tgross35Matthias Krüger-4/+4
Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut` https://github.com/rust-lang/rust/pull/128309#discussion_r1921097773 Tracking issue: https://github.com/rust-lang/rust/issues/107540
2025-01-23Rollup merge of #135879 - onur-ozkan:invalid-file-path, r=jieyouxuMatthias Krüger-1/+1
fix outdated file path ref in llvm This was added years ago and is outdated today.
2025-01-23Rollup merge of #135790 - wesleywiser:update_windows_gnu_debuginfokind, r=lqdMatthias Krüger-2/+145
Update windows-gnu targets to set `DebuginfoKind::DWARF` These targets have always used DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. However, their target definitions claim to use `DebuginfoKind::PDB` probably to ensure that we do not try to allow the use of split-DWARF debuginfo. This does not appear to be necessary since the targets set their supported split debug info to `Off`. I've looked at all of the uses of these properties and this patch does not appear to cause any functional changes in compiler behavior. I also added UI tests to attempt to validate there is no change in the behavior of these options on stable compilers. cc ````@mati865```` since you mentioned this in #135739 cc ````@davidtwco```` for split-dwarf
2025-01-23Rollup merge of #135779 - marcoieni:free-disk-arm-runner, r=KobzolMatthias Krüger-0/+2
CI: free disk on linux arm runner try-job: aarch64-gnu
2025-01-23Rollup merge of #135552 - ↵Matthias Krüger-16/+411
amy-kwan:amy-kwan/reprc-struct-diagnostic-power-alignment, r=workingjubilee [AIX] Lint on structs that have a different alignment in AIX's C ABI This PR adds a linting diagnostic on AIX for repr(C) structs that are required to follow the power alignment rule. A repr(C) struct needs to follow the power alignment rule if the struct: - Has a floating-point data type (greater than 4-bytes) as its first member, or - The first member of the struct is an aggregate, whose recursively first member is a floating-point data type (greater than 4-bytes). The power alignment rule for eligible structs is currently unimplemented, so a linting diagnostic is produced when such a struct is encountered.
2025-01-23Rollup merge of #134746 - compiler-errors:autoderef-norm-non-wf-coerce-ice, ↵Matthias Krüger-3/+67
r=lcnr Don't ICE in coerce when autoderef fails to structurally normalize non-WF type in new solver r? lcnr
2025-01-23Auto merge of #135461 - jieyouxu:migrate-jobserver-errors, r=Noratriebbors-19/+114
tests: Port `jobserver-error` to rmake.rs Part of #121876. This PR ports `tests/run-make/jobserver-error` to rmake.rs, and is basically #128789 slightly adjusted. The complexity involved here is mostly how to get `/dev/null/` piping to fd 3 working with std `Command`, whereas with a shell this is much easier (as is evident with the `Makefile` version). Supersedes #128789. This PR is co-authored with `@Oneirical` and `@coolreader18.` try-job: aarch64-gnu try-job: i686-gnu-1 try-job: x86_64-gnu-debug try-job: x86_64-gnu-llvm-18-1
2025-01-23Auto merge of #135164 - Kobzol:run-make-test-glibc-symbols, r=jieyouxubors-1/+129
Add test for checking used glibc symbols This test checks that we do not use too new glibc symbols in the compiler on x64 GNU Linux, in order not to break our [glibc promises](https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html). One thing that isn't solved in the PR yet is to make sure that this test will only run on `dist` CI, more specifically on the `dist-x86_64-linux` runner, in the opt-dist post-optimization tests (it can fail elsewhere, that doesn't matter). Any suggestions on how to do that are welcome. Fixes: https://github.com/rust-lang/rust/issues/134037 r? `@jieyouxu`
2025-01-22Auto merge of #135896 - matthiaskrgr:rollup-g6rv7za, r=matthiaskrgrbors-682/+1079
Rollup of 9 pull requests Successful merges: - #132983 (Edit dangling pointers ) - #135409 (Fix ICE-133117: multiple never-pattern arm doesn't have false_edge_start_block) - #135557 (Point at invalid utf-8 span on user's source code) - #135596 (Properly note when query stack is being cut off) - #135794 (Detect missing fields with default values and suggest `..`) - #135814 (ci: use ghcr buildkit image) - #135826 (Misc. `rustc_resolve` cleanups) - #135837 (Remove test panic from File::open) - #135856 (Library: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-22rustdoc-json-types: Finalize dyn compatibility renamingAlona Enraght-Moony-2/+1
2025-01-22Rollup merge of #135856 - fmease:library-mv-obj-save-dyn-compat-ii, r=tgross35Matthias Krüger-5/+4
Library: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130827. Part of #130852.
2025-01-22Rollup merge of #135837 - ChrisDenton:trunc, r=NoratriebMatthias Krüger-3/+0
Remove test panic from File::open Fixes #135831
2025-01-22Rollup merge of #135826 - yotamofek:resolve-cleanups4, r=petrochenkovMatthias Krüger-606/+562
Misc. `rustc_resolve` cleanups Hopefully this PR should make `rustc_resolve` a bit cleaner. Each commit here stands on its own. I tried to only include changes that are easy to review, and are a clear improvement. (but I'll be happy to revert any changes that turn out to be more controversial than I'd thought) Best viewed with whitespace ignored 😁 (especially [these two commits](https://github.com/rust-lang/rust/pull/135826/files/a93616acf3118ef233027d74e8c636f9b79c342d..ae87d005bc92cbecc47b554e634d1bd3d22e1068?diff=unified&w=1))
2025-01-22Rollup merge of #135814 - marcoieni:use-buildkit-ghcr, r=KobzolMatthias Krüger-2/+7
ci: use ghcr buildkit image
2025-01-22Rollup merge of #135794 - estebank:non-exhaustive-dfv-ctor, r=jieyouxuMatthias Krüger-0/+197
Detect missing fields with default values and suggest `..` When a struct ctor use has missing fields, if all those missing fields have defaults, suggest `..`: ``` error[E0063]: missing fields `field1` and `field2` in initializer of `S` --> $DIR/non-exhaustive-ctor.rs:16:13 | LL | let _ = S { field: () }; | ^ missing `field1` and `field2` | help: all remaining fields have default values, you can use those values with `..` | LL | let _ = S { field: (), .. }; | ++++ ```
2025-01-22Rollup merge of #135596 - compiler-errors:stack, r=oli-obkMatthias Krüger-15/+20
Properly note when query stack is being cut off cc #70953 also, i'm not certain whether we should even limit this at all. i don't see the problem with printing the full query stack, apparently it was limited b/c we used to ICE? but we're already printing the full stack to disk since #108714. r? oli-obk
2025-01-22Rollup merge of #135557 - estebank:wtf8, r=fee1-deadMatthias Krüger-20/+88
Point at invalid utf-8 span on user's source code ``` error: couldn't read `$DIR/not-utf8-bin-file.rs`: stream did not contain valid UTF-8 --> $DIR/not-utf8-2.rs:6:5 | LL | include!("not-utf8-bin-file.rs"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: byte `193` is not valid utf-8 --> $DIR/not-utf8-bin-file.rs:2:14 | LL | let _ = "�|�␂!5�cc␕␂��"; | ^ = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info) ``` When we attempt to load a Rust source code file, if there is a OS file failure we try reading the file as bytes. If that succeeds we try to turn it into UTF-8. If *that* fails, we provide additional context about *where* the file has the first invalid UTF-8 character. Fix #76869.
2025-01-22Rollup merge of #135409 - ↵Matthias Krüger-29/+115
Shunpoco:issue-133117-ICE-never-false-edge-start-block, r=Nadrieril Fix ICE-133117: multiple never-pattern arm doesn't have false_edge_start_block Fixes #133117 , and close fixes #133063 , fixes #130779 In order to fix ICE-133117, at first I needed to tackle to ICE-133063 (this fixed 130779 as well). ### ICE-133063 and ICE-130779 This ICE is caused by those steps: 1. An arm has or-pattern, and all of the sub-candidates are never-pattern 2. In that case, all sub-candidates are removed in remove_never_subcandidates(). So the arm (candidate) has no sub-candidate. 3. In the current implementation, if there is no sub-candidate, the function assigns `pre_binding_block` into the candidate ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/builder/matches/mod.rs#L2002-L2004)). However, otherwise_block should be assigned to the candidate as well, because the otherwise_block is unwrapped in multiple place (like in lower_match_tree()). As a result, it causes the panic. I simply added the same block as pre_binding_block into otherwise_block, but I'm wondering if there is a better block to assign to otherwise_block (is it ok to assign the same block into pre_binding and otherwise?) ### ICE-133117 This is caused by those steps: 1. There are two arms, both are or-pattern and each has one match-pair (in the test code, both are `(!|!)`), and the second arm has a guard. 2. In match_candidate() for the first arm, it expands the second arm’s sub-candidates as well ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/builder/matches/mod.rs#L1800-L1805)). As a result, the root candidate of the second arm is not evaluated/modified in match_candidate(). So a false_edge_start_block is not assigned to the candidate. 3. merge_trivial_subcandidates() is called against the candidate for the second arm. It just returns immediately because the candidate has a guard. So a flase_edge_start_block is not assigned to the candidate also in this function. 4. remove_never_subcandidates() is called against the candidate. Since all sub-candidates are never-pattern. they are removed. 5. In lower_match_tree(), since there is no sub-candidate for the candidate, the candidate itself is evaluated in visit_leave_rev ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_build/src/builder/matches/mod.rs#L1532)). Because the candidate has no false_edge_start_block, it causes the panic. So I modified the order of if blocks in merge_trivial_subcandidates() to assign a false_edge_start_block if the candidate doesn't have.
2025-01-22Rollup merge of #132983 - Anthony-Eid:dangling-pointers-lint, r=UrgauMatthias Krüger-2/+86
Edit dangling pointers Closes: #132283
2025-01-22Auto merge of #135893 - matthiaskrgr:rollup-2qqo647, r=matthiaskrgrbors-1461/+2141
Rollup of 10 pull requests Successful merges: - #133372 (Refactor dyn-compatibility error and suggestions) - #134396 (AIX: use align 8 for byval parameter) - #135156 (Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C API) - #135816 (Use `structurally_normalize` instead of manual `normalizes-to` goals in alias relate errors) - #135823 (make UI tests that use `--test` work on panic=abort targets) - #135850 (Update the `wasm-component-ld` tool) - #135858 (rustdoc: Finalize dyn compatibility renaming) - #135866 (Don't pick `T: FnPtr` nested goals as the leaf goal in diagnostics for new solver) - #135874 (Enforce that all spans are lowered in ast lowering) - #135875 (Remove `Copy` bound from `enter_forall`) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-22Don't ICE in coerce when autoderef fails to structurally normalize non-WF ↵Michael Goulet-3/+67
type in new solver
2025-01-22Rollup merge of #135875 - BoxyUwU:enter_forall_no_copy, r=lcnrMatthias Krüger-4/+4
Remove `Copy` bound from `enter_forall` idk why we ever required this, `TypeFoldable` implies `Clone`
2025-01-22Rollup merge of #135874 - oli-obk:push-vrvyyrtyxkxm, r=compiler-errorsMatthias Krüger-32/+36
Enforce that all spans are lowered in ast lowering This should ensure that incremental is used as extensively as possible. It's only a debug assertion, and only enabled when incremental is enabled (as we only lower spans to relative spans then).
2025-01-22Rollup merge of #135866 - BoxyUwU:dont_pick_fnptr_nested_goals, r=lcnrMatthias Krüger-68/+388
Don't pick `T: FnPtr` nested goals as the leaf goal in diagnostics for new solver r? `@lcnr` See `tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs` for a minimized example of what code this affects the diagnostics off. The output of running nightly `-Znext-solver` on that test is the following: ``` error[E0277]: the trait bound `Foo: Trait` is not satisfied --> src/lib.rs:14:20 | 14 | requires_trait(Foo); | -------------- ^^^ the trait `FnPtr` is not implemented for `Foo` | | | required by a bound introduced by this call | note: required for `Foo` to implement `Trait` --> src/lib.rs:7:16 | 7 | impl<T: FnPtr> Trait for T {} | ----- ^^^^^ ^ | | | unsatisfied trait bound introduced here note: required by a bound in `requires_trait` --> src/lib.rs:11:22 | 11 | fn requires_trait<T: Trait>(_: T) {} | ^^^^^ required by this bound in `requires_trait` ``` Part of rust-lang/trait-system-refactor-initiative#148
2025-01-22Rollup merge of #135858 - fmease:rustdoc-mv-obj-save-dyn-compat-ii, ↵Matthias Krüger-3/+2
r=GuillaumeGomez rustdoc: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #131594. Part of #130852.
2025-01-22Rollup merge of #135850 - alexcrichton:update-wasm-component-ld, r=jieyouxuMatthias Krüger-22/+21
Update the `wasm-component-ld` tool This commit updates the `wasm-component-ld` tool from 0.5.11 to 0.5.12. This pulls in a fix for the binary adapters that are included with this tool for an issue described in bytecodealliance/wasmtime#10058. Some other dependencies have additionally been updated in the meantime of `wasm-component-ld` but there should otherwise be no major changes.
2025-01-22Rollup merge of #135823 - ferrocene:ja-gh135819, r=jieyouxuMatthias Krüger-2/+6
make UI tests that use `--test` work on panic=abort targets By passing `-Zpanic_abort_test`. fixes #135819
2025-01-22Rollup merge of #135816 - BoxyUwU:root_normalizes_to_goal_ice, r=lcnrMatthias Krüger-121/+267
Use `structurally_normalize` instead of manual `normalizes-to` goals in alias relate errors r? `@lcnr` I added `structurally_normalize_term` so that code that is generic over ty or const can use the structurally normalize helpers. See `tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs` for a description of the reason for the (now fixed) ICEs
2025-01-22Rollup merge of #135156 - Zalathar:debuginfo-flags, r=cuviperMatthias Krüger-117/+87
Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C API In order to be able to use a mixture of LLVM-C and C++ bindings for debuginfo, our Rust-side `DIFlags` needs to have the same layout as LLVM-C's `LLVMDIFlags`, and we also need to be able to convert it to the `DIFlags` accepted by LLVM's C++ API. Internally, LLVM converts between the two types with a simple cast. We can't necessarily rely on that always being true, and LLVM doesn't expose a conversion function, so we have two potential options: - Convert each bit/subvalue individually - Statically assert that doing a cast is actually fine As long as both types do remain the same under the hood (which seems likely), the static-assert-and-cast approach is easier and faster. If the static assertions ever start failing against some future version of LLVM, we'll have to switch over to the convert-each-subvalue approach, which is a bit more error-prone. --- Extracted from #134009, though this PR ended up choosing the static-assert-and-cast approach over the convert-each-subvalue approach.
2025-01-22Rollup merge of #134396 - mustartt:byval-pointer-natural-alignment, ↵Matthias Krüger-1/+3
r=wesleywiser AIX: use align 8 for byval parameter On AIX, byval pointer arguments are aligned to 8 bytes based on the 64bit register size. For example, the C callee https://godbolt.org/z/5f4vnG6bh will expect the following argument. ``` ptr nocapture noundef readonly byval(%struct.TwoU64s) align 8 %0 ``` This case is captured by `run-make/extern-fn-explicit-align`
2025-01-22Rollup merge of #133372 - cramertj:rework-dyn-suggestions, r=fmeaseMatthias Krüger-1091/+1327
Refactor dyn-compatibility error and suggestions This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267 r? `@compiler-errors`
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-1091/+1327
This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267
2025-01-22[AIX] Lint on structs that have a different alignment in AIX's C ABIAmy Kwan-16/+411
2025-01-22reduce number of `prepare_cargo_test` argsonur-ozkan-8/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-22resolve clippy FIXMEonur-ozkan-52/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-22make bootstrap self test to use bootstrap cargoonur-ozkan-15/+26
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-22Reword comment slightlyJakub Beránek-1/+3
2025-01-22remove implied end of sliceMarijn Schouten-1/+1
2025-01-22Remove erroneous `unsafe` in `BTreeSet::upper_bound_mut`Pavel Grigorenko-4/+4
2025-01-22Auto merge of #134478 - compiler-errors:attr-span, r=oli-obkbors-34/+105
Properly record metavar spans for other expansions other than TT This properly records metavar spans for nonterminals other than tokentree. This means that we operations like `span.to(other_span)` work correctly for macros. As you can see, other diagnostics involving metavars have improved as a result. Fixes #132908 Alternative to #133270 cc `@ehuss` cc `@petrochenkov`
2025-01-22fix outdated file path ref in llvmonur-ozkan-1/+1
This was added years ago and is outdated today. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-22Use objdump instead of llvm-objdumpJakub Beránek-2/+4
2025-01-22Run the glibc run-make test in opt-distJakub Beránek-2/+3
2025-01-22Remove `Copy` bound from `enter_forall`Boxy-4/+4