Commit Graph

259469 Commits

Author SHA1 Message Date
bjorn3
bd2ff518ce Move codegen_and_build_linker from Queries to Linker 2024-07-01 11:00:49 +00:00
Oli Scherer
814bfe9335 This check should now be unreachable 2024-07-01 10:35:16 +00:00
Oli Scherer
a5d37238a1 Prefer item-local tainting checks over global error count checks 2024-07-01 10:31:41 +00:00
Oli Scherer
9d5da39b3a Revert some ICE avoiding logic that is not necessary anymore 2024-07-01 10:26:27 +00:00
onur-ozkan
97415ce6e7 fail on component linking errors
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-01 13:16:46 +03:00
Oli Scherer
61963fabdf Avoid an ICE reachable through const eval shenanigans 2024-07-01 10:14:42 +00:00
onur-ozkan
fe6f3fa107 improve the way bootstrap handles rustlib components
When CI rustc is enabled, bootstrap tries to symlink the rust source (project root)
into target sysroot right before copying it from the CI rustc's sysroot. This becomes
a problem in CI builders (which we currently don't see because they don't use CI rustc)
because the copying part will fail as they run on read-only mode.

This change fixes the problem by copying `rustc-src` from the CI rustc sysroot and only symlinking
`rustc-src` from the rust source when download-rustc is not enabled.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-01 13:10:46 +03:00
Amanda Stjerna
9be3a3d761 Add description for why this PR was made 2024-07-01 11:52:38 +02:00
Amanda Stjerna
eea5cf87b2 Code review: rename the method min_universe() 2024-07-01 11:32:45 +02:00
Guillaume Gomez
fcfac05657 Improve target method API in run-make-support 2024-07-01 10:55:57 +02:00
Guillaume Gomez
b5b97dccae Improve run-make-support API for assert* functions 2024-07-01 10:55:57 +02:00
bors
c3774be741 Auto merge of #127197 - matthiaskrgr:rollup-aqpvn5q, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #126923 (test: dont optimize to invalid bitcasts)
 - #127090 (Reduce merge conflicts from rustfmt's wrapping)
 - #127105 (Only update `Eq` operands in GVN if it can update both sides)
 - #127150 (Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`)
 - #127181 (Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`)
 - #127182 (Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical)
 - #127191 (Ensure `out_of_scope_macro_calls` lint is registered)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-01 08:51:46 +00:00
Amanda Stjerna
b3ef0e8487 Handle universe leaks by rewriting the constraint graph
This version is a squash-rebased version of a series
of exiermental commits, since large parts of them
were broken out into PR #125069.

It explicitly handles universe violations in higher-kinded
outlives constraints by adding extra outlives static constraints.
2024-07-01 10:39:42 +02:00
Matthias Krüger
f5ef1cd17c
Rollup merge of #127191 - beetrees:register-out-of-scope-macro-calls, r=compiler-errors
Ensure `out_of_scope_macro_calls` lint is registered

Fixes part of https://github.com/rust-lang/rust/issues/126984#issuecomment-2198792687.
2024-07-01 08:53:09 +02:00
Matthias Krüger
c9276ad27d
Rollup merge of #127182 - danielhuang:patch-4, r=Nilstrieb
Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical
2024-07-01 08:53:08 +02:00
Matthias Krüger
b067ee82f8
Rollup merge of #127181 - BoxyUwU:dump_def_parents, r=compiler-errors
Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`

We've run into a bunch of issues with anon consts having the wrong generics and it would have been incredibly helpful to be able to quickly slap a `rustc_` attribute to check what `tcx.parent(` will return on the relevant DefIds.

I wasn't sure of a better way to make this work for anon consts than requiring the attribute to be on the enclosing item and then walking the inside of it to look for any anon consts. This particular method will honestly break at some point when we stop having a `DefId` available for anon consts in hir but that's for another day...

r? ``@compiler-errors``
2024-07-01 08:53:07 +02:00
Matthias Krüger
c7e64dcbf1
Rollup merge of #127150 - xen0n:issue125908, r=Kobzol
Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`

Formerly the `loongarch*-*-none*` targets were added to the `dist-various-2` CI job, but no corresponding toolchain was added along with them. This meant the `compiler_builtins` for the targets were built with the host toolchain.

As the other `dist-various` toolchains are mostly pre-built so far, to avoid burdening them with crosstool-ng builds, simply move the two bare-metal LoongArch targets to the `dist-loongarch64-linux` job which has a ready-to-use LoongArch toolchain. With the proper CFLAGS applied it is possible to build artifacts suitable for bare-metal. I verified that the `compiler_builtins` objects are now correctly produced regarding architecture and ABI, with the changes here applied.

Fixes #125908.

cc ``@heiher``

try-job: dist-loongarch64-linux
try-job: dist-various-2
2024-07-01 08:53:07 +02:00
Matthias Krüger
6938b4b640
Rollup merge of #127105 - scottmcm:issue-127089, r=cjgillot
Only update `Eq` operands in GVN if it can update both sides

Otherwise the types might not match

Fixes #127089

r? mir-opt
2024-07-01 08:53:06 +02:00
Matthias Krüger
04a3969af7
Rollup merge of #127090 - kornelski:wrap-conflicts, r=fee1-dead
Reduce merge conflicts from rustfmt's wrapping

Imports in this file are changed by many different features. Rustfmt insists on reformatting and rewrapping the imports every time they change, which causes chronic merge conflicts.

I've split the big import into multiple smaller ones, so that different features will conflict less often.
2024-07-01 08:53:06 +02:00
Matthias Krüger
c471e07156
Rollup merge of #126923 - workingjubilee:regression-tests-for-simd-invalid-bitcast, r=calebzulawski
test: dont optimize to invalid bitcasts

Regression tests to prevent regressing.
2024-07-01 08:53:05 +02:00
bors
7b21c18fe4 Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercote
Automatically taint InferCtxt when errors are emitted

r? `@nnethercote`

Basically `InferCtxt::dcx` now returns a `DiagCtxt` that refers back to the `Cell<Option<ErrorGuaranteed>>` of the `InferCtxt` and thus when invoking `Diag::emit`, and the diagnostic is an error, we taint the `InferCtxt` directly.

That change on its own has no effect at all, because `InferCtxt` already tracks whether errors have been emitted by recording the global error count when it gets opened, and checking at the end whether the count changed. So I removed that error count check, which had a bit of fallout that I immediately fixed by invoking `InferCtxt::dcx` instead of `TyCtxt::dcx` in a bunch of places.

The remaining new errors are because an error was reported in another query, and never bubbled up. I think they are minor enough for this to be ok, and sometimes it actually improves diagnostics, by not silencing useful diagnostics anymore.

fixes #126485 (cc `@olafes)`

There are more improvements we can do (like tainting in hir ty lowering), but I would rather do that in follow up PRs, because it requires some refactorings.
2024-07-01 06:35:58 +00:00
B I Mohammed Abbas
9732251e5f Remove unqualified import io:: Error for vxworks as all Error references are qualified in process_vxworks.rs 2024-07-01 11:13:30 +05:30
bors
f92a6c41e6 Auto merge of #127176 - fee1-dead-contrib:fx-requires-next-solver, r=compiler-errors
Make `feature(effects)` require `-Znext-solver`

Per https://github.com/rust-lang/rust/pull/120639#pullrequestreview-2144804638

I made this a hard error because otherwise it should be a lint and that seemed more complicated. Not sure if this is the best place to put the error though.

r? project-const-traits
2024-07-01 04:21:13 +00:00
Michael Goulet
583b5fcad7 Use full expr span for return suggestion on type error/ambiguity 2024-06-30 23:11:54 -04:00
Michael Howell
15fbe618a1 rustdoc: update to pulldown-cmark 0.11 2024-06-30 18:33:48 -07:00
bors
ad12a2a5fc Auto merge of #127082 - GuillaumeGomez:help-gui-test, r=notriddle
Add back `help-page.goml` rustdoc GUI test

Since https://github.com/rust-lang/rust/pull/127010 was merged, let's see if we can revert https://github.com/rust-lang/rust/pull/126445...

r? `@notriddle`
2024-07-01 00:52:41 +00:00
beetrees
4c919ac50b
Ensure out_of_scope_macro_calls lint is registered 2024-07-01 00:25:25 +01:00
bors
b8d7dd8d69 Auto merge of #127026 - Urgau:cleanup-bootstrap-check-cfg, r=Kobzol
Cleanup bootstrap check-cfg

This PR cleanup many custom `check-cfg` in bootstrap that have been accumulated over the years.

As well as updating some outdated comments.
2024-06-30 22:27:29 +00:00
DianQK
da81d0d940
Update LLVM submodule 2024-07-01 06:03:08 +08:00
bors
6868c831a1 Auto merge of #127174 - matthiaskrgr:rollup-q87j6cn, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #126018 (Remove the `box_pointers` lint.)
 - #126895 (Fix simd_gather documentation)
 - #126981 (Replace some magic booleans in match-lowering with enums)
 - #127038 (Update test comment)
 - #127053 (Update the LoongArch target documentation)
 - #127069 (small correction to fmt::Pointer impl)
 - #127157 (coverage: Avoid getting extra unexpansion info when we don't need it)
 - #127160 (Add a regression test for #123630)
 - #127161 (Improve `run-make-support` library `args` API)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-30 20:14:40 +00:00
Daniel Huang
af3d7f869b
Update ip_addr.rs 2024-06-30 14:54:05 -04:00
Boxy
552794410a add rustc_dump_def_parents attribute 2024-06-30 19:31:21 +01:00
Scott McMurray
f6942112eb Add a GVN test for 127089 that doesn't optimize to a constant 2024-06-30 11:30:54 -07:00
bjorn3
8127461b0e Move -Zprint-type-sizes and -Zprint-vtable-sizes into codegen_and_build_linker 2024-06-30 18:01:55 +00:00
Deadbeef
daff015314 Migrate tests to use -Znext-solver 2024-06-30 17:08:45 +00:00
Deadbeef
34ae56de35 Make feature(effects) require -Znext-solver 2024-06-30 17:08:10 +00:00
Matthias Krüger
4037197353
Rollup merge of #127161 - GuillaumeGomez:improve-run-make-args, r=Kobzol
Improve `run-make-support` library `args` API

It allows to pass both `Vec` and slices, which makes it much better (for me at least 😉).

r? ``@Kobzol``
2024-06-30 18:25:35 +02:00
Matthias Krüger
6335b83703
Rollup merge of #127160 - pacak:123630-test, r=Nadrieril
Add a regression test for #123630

Fixes #123630

compiler should not suggest nonsensical signatures, original suggestion was

```
error[E0308]: mismatched types
 --> src/lib.rs:3:31
  |
3 | fn select<F, I>(filter: F) -> Select<F, I> {
  |    ------                     ^^^^^^^^^^^^ expected `Select<F, I>`, found `()`
  |    |
  |    implicitly returns `()` as its body has no tail or `return` expression
  |
  = note: expected struct `Select<F, I>`
          found unit type `()`

error[E0282]: type annotations needed for `Select<{closure@src/lib.rs:8:22: 8:25}, I>`
 --> src/lib.rs:8:9
  |
8 |     let lit = select(|x| match x {
  |         ^^^
  |
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
  |
8 |     let lit: Select<{closure@src/lib.rs:8:22: 8:25}, I> = select(|x| match x {
  |            ++++++++++++++++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0282, E0308. For more information about an error, try `rustc --explain E0282`.
```
2024-06-30 18:25:35 +02:00
Matthias Krüger
b2aebc1b76
Rollup merge of #127157 - Zalathar:unexpand, r=cjgillot
coverage: Avoid getting extra unexpansion info when we don't need it

Several callers of `unexpand_into_body_span_with_visible_macro` would immediately discard the additional macro-related information, which is wasteful. We can avoid this by having them instead call a simpler method that just returns the span they care about.

This PR also moves the relevant functions out of `coverage::spans::from_mir` and into a new submodule `coverage::unexpand`, so that calling them from `coverage::mappings` is less awkward.

There should be no actual changes to coverage-instrumentation output, as demonstrated by the absence of test updates.
2024-06-30 18:25:34 +02:00
Matthias Krüger
7a43417c36
Rollup merge of #127069 - Sky9x:fmt-pointer-use-addr, r=Nilstrieb
small correction to fmt::Pointer impl

~~The `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance`.~~
`expose_provenance` does not require `T: Sized`.
2024-06-30 18:25:34 +02:00
Matthias Krüger
7e05bc3854
Rollup merge of #127053 - xen0n:update-loong-docs, r=Nilstrieb,heiher
Update the LoongArch target documentation

The docs for the LoongArch targets are a bit dated since their introduction, and the prose has some room for improvement as well. Streamline a bit, referring to the neighboring targets' docs, and provide up-to-date information as much as I can come up with.

cc fellow target maintainer `@heiher` for review of target-specific bits
2024-06-30 18:25:33 +02:00
Matthias Krüger
1fac8de919
Rollup merge of #127038 - BoxyUwU:reword_comment, r=camelid
Update test comment

r? `@camelid`

Rewrote this comment since it mixed up a/b in one place and was generally a bit confusing
2024-06-30 18:25:33 +02:00
Matthias Krüger
d404ce7015
Rollup merge of #126981 - Zalathar:enums, r=Nadrieril
Replace some magic booleans in match-lowering with enums

This PR takes some boolean arguments used by the match-lowering code, and replaces them with dedicated enums that more clearly express their effect, while also making it much easier to find how each value is ultimately used.
2024-06-30 18:25:32 +02:00
Matthias Krüger
5f43a89815
Rollup merge of #126895 - betelgeuse:improve_simd_gather_documentation, r=Amanieu
Fix simd_gather documentation

There is no idx in the function signature.
2024-06-30 18:25:32 +02:00
Matthias Krüger
6f5765599e
Rollup merge of #126018 - nnethercote:rm-box_pointers-lint, r=lcnr
Remove the `box_pointers` lint.

As the comment says, this lint "is mostly historical, and not particularly useful". It's not worth keeping it around.

r? ``@estebank``
2024-06-30 18:25:31 +02:00
bors
ef3d6fd700 Auto merge of #127162 - bjorn3:sync_cg_clif-2024-06-30, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlight this time is support for arm64 macOS in cg_clif. A future PR will enable distributing it as rustup component.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-06-30 16:23:04 +00:00
Boxy
f79bf19a7a Update test comment 2024-06-30 15:16:11 +01:00
bors
6c3485512f Auto merge of #127156 - matthiaskrgr:rollup-jjfd464, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #126705 (Updated docs on `#[panic_handler]` in `library/core/src/lib.rs`)
 - #126876 (Add `.ignore` file to make `config.toml` searchable in vscode)
 - #126906 (Small fixme in core now that split_first has no codegen issues)
 - #127023 (CI: rename Rust for Linux CI job)
 - #127131 (Remove unused `rustc_trait_selection` dependencies)
 - #127134 (Print `TypeId` as a `u128` for `Debug`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-30 13:22:17 +00:00
bjorn3
9ec6a02ab3 Merge commit '49cd5dd454d0115cfbe9e39102a8b3ba4616aa40' into sync_cg_clif-2024-06-30 2024-06-30 11:28:14 +00:00
bjorn3
49cd5dd454 Rustup to rustc 1.81.0-nightly (ba1d7f4a0 2024-06-29) 2024-06-30 11:20:49 +00:00