Commit Graph

261496 Commits

Author SHA1 Message Date
onur-ozkan
0636293fb7 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.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-20 12:13:29 +03:00
bors
1afc5fd042 Auto merge of #127998 - matthiaskrgr:rollup-ykp0h5r, r=matthiaskrgr
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-20 08:27:20 +00:00
bors
41ff460889 Auto merge of #127003 - GrigorenkoPV:107975, r=SparrowLii
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-20 06:05:18 +00:00
Matthias Krüger
89798e9064
Rollup merge of #127987 - estebank:impl-trait-sugg, r=cjgillot
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-20 07:13:46 +02:00
Matthias Krüger
40cfc8837a
Rollup merge of #127984 - nyurik:src-refs, r=onur-ozkan
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-20 07:13:45 +02:00
Matthias Krüger
cd8c5f78ec
Rollup merge of #127980 - nyurik:compiler-refs, r=oli-obk
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-20 07:13:45 +02:00
Matthias Krüger
767b3cb54b
Rollup merge of #127948 - surechen:fix_127915, r=compiler-errors
fixes panic error `index out of bounds` in conflicting error

fixes #127915
2024-07-20 07:13:44 +02:00
Matthias Krüger
4da2869bc7
Rollup merge of #127918 - ChrisDenton:thread-name-string, r=joboet
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-20 07:13:43 +02:00
Matthias Krüger
4f20ee51e1
Rollup merge of #127866 - alexcrichton:disable-wasm-component-ld-by-default, 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-20 07:13:43 +02:00
Matthias Krüger
aa6ae4beca
Rollup merge of #127693 - Rejyr:migrate-crate-hash-rustc-version-rmake, 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-20 07:13:42 +02:00
Matthias Krüger
dfee7ed13f
Rollup merge of #127556 - Zalathar:autoref, r=Nadrieril
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-20 07:13:41 +02:00
Matthias Krüger
bc86893a1a
Rollup merge of #123196 - Ayush1325:uefi-process, r=joboet
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-20 07:13:41 +02:00
Zalathar
239037ecde Inline finalize_or_candidate 2024-07-20 13:29:03 +10:00
Zalathar
886668cc2e Improve test_remaining_match_pairs_after_or 2024-07-20 13:29:03 +10:00
Zalathar
e60c5c1a77 Split out test_remaining_match_pairs_after_or
Only the last candidate can possibly have more match pairs, so this can be
separate from the main or-candidate postprocessing loop.
2024-07-20 12:45:12 +10:00
Zalathar
e091c356fa Improve merge_trivial_subcandidates 2024-07-20 12:45:11 +10:00
Zalathar
3b7e4bc77a Split out remove_never_subcandidates 2024-07-20 12:45:11 +10:00
Caio
b8d4e4d1b3 Allow concat in repetitions 2024-07-19 21:00:46 -03:00
Weihang Lo
3ed80a8c30
Update cargo 2024-07-19 17:59:44 -04:00
bors
9057c3ffec Auto merge of #127968 - fmease:upd-jsondocck-directive-style, r=GuillaumeGomez
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-19 21:07:48 +00:00
Oneirical
2192a916d4 rewrite compiler-lookup-paths-2 to rmake 2024-07-19 16:48:21 -04:00
Jubilee Young
e9b3e9c7f4 std: forbid unwrapped unsafe in unsupported_backslash 2024-07-19 13:46:06 -07:00
Jubilee Young
1d83da8847 kmc-solid: forbid(unsafe_op_in_unsafe_fn) 2024-07-19 13:46:06 -07:00
Pavel Grigorenko
2b089147ab Add a bunch of tests for #107975 2024-07-19 23:27:42 +03:00
Yuri Astrakhan
8bcf0b4a37 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.
2024-07-19 16:08:53 -04:00
Esteban Küber
3ff758877f 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-19 19:39:37 +00:00
Guillaume Gomez
eec3c3db88 Add GUI test for trait bounds display 2024-07-19 21:31:30 +02:00
Guillaume Gomez
590c01a5c5 Reduce width to ensure that the name is wider and thus still triggering the scroll 2024-07-19 21:31:30 +02:00
Yuri Astrakhan
aef0e346de 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.
2024-07-19 14:52:07 -04:00
Guillaume Gomez
063ed0f958 Improve display of trait bounds when there are more than two 2024-07-19 20:41:40 +02:00
bors
ff4b39867e Auto merge of #127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgr
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
2024-07-19 18:40:33 +00:00
Oneirical
27334943ed rewrite c-unwind-abi-catch-panic to rmake 2024-07-19 14:39:42 -04:00
Oneirical
7b19389d58 rewrite test-benches to rmake 2024-07-19 14:05:09 -04:00
Matthias Krüger
e28be0d168
Rollup merge of #127978 - nyurik:lib-refs, r=workingjubilee
Avoid ref when using format! for perf

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-19 20:03:58 +02:00
Matthias Krüger
115b086850
Rollup merge of #127976 - fmease:lta-cyclic-bivariant-param-better-err, r=compiler-errors
Lazy type aliases: Diagostics: Detect bivariant ty params that are only used recursively

Follow-up to errs's #127871. Extends the logic to cover LTAs, too, not just ADTs.
This change only takes effect with the next-gen solver enabled as cycle errors like
the one we have here are fatal in the old solver. That's my explanation anyways.

r? compiler-errors
2024-07-19 20:03:58 +02:00
Matthias Krüger
a2c99cf87c
Rollup merge of #127966 - oli-obk:structured_diag, r=compiler-errors
Use structured suggestions for unconstrained generic parameters on impl blocks

I did not deduplicate with `UnusedGenericParameter`, because in contrast to type declarations, just using a generic parameter in an impl isn't enough, it must be used with the right variance and not just as part of a projection.
2024-07-19 20:03:57 +02:00
Matthias Krüger
41d3cb6dbe
Rollup merge of #127949 - princess-entrapta:master, r=tgross35
fix: explain E0120 better cover cases when its raised

Fixes https://github.com/rust-lang/rust/issues/98996

Wording change on the explain of E0120 as requested
2024-07-19 20:03:56 +02:00
Matthias Krüger
3b20150b48
Rollup merge of #127814 - folkertdev:c-cmse-nonsecure-call-error-messages, r=oli-obk
`C-cmse-nonsecure-call`: improved error messages

tracking issue: #81391
issue for the error messages (partially implemented by this PR): #81347
related, in that it also deals with CMSE: https://github.com/rust-lang/rust/pull/127766

When using the `C-cmse-nonsecure-call` ABI, both the arguments and return value must be passed via registers. Previously, when violating this constraint, an ugly LLVM error would be shown. Now, the rust compiler itself will print a pretty message and link to more information.
2024-07-19 20:03:56 +02:00
Matthias Krüger
6ae6f8bb27
Rollup merge of #127295 - maurer:default-impl-cfi, r=estebank
CFI: Support provided methods on traits

Provided methods currently don't get type erasure performed on them because they are not in an `impl` block. If we are instantiating a method that is an associated item, but *not* in an impl block, treat it as a provided method instead.
2024-07-19 20:03:55 +02:00
Alex Crichton
006c884480 Fix two new failing tests
The updated wasi-sdk has debuginfo by default so be sure to strip the
debuginfo by default when testing the size of new executables.
2024-07-19 10:27:14 -07:00
Alex Crichton
5b0b4ff03c Update wasi-sdk in CI to latest release
This commit updates the `wasi-sdk` download used by the `wasm32-wasi*`
targets. The motivation for this commit is generally just "keep things
up to date" and is not intended to cause any issues or differences from
before, just a routine update.
2024-07-19 10:06:30 -07:00
León Orell Valerian Liehr
756459ed85
LTA: Diag: Detect bivariant ty params that are only used recursively 2024-07-19 18:53:40 +02:00
Oneirical
fdc8d62c96 rewrite pass-non-c-like-enum-to-c to rmake 2024-07-19 12:27:47 -04:00
Oneirical
1f976b43da rewrite linkage-attr-on-static to rmake 2024-07-19 12:27:47 -04:00
Oneirical
db8398db6f rewrite lto-no-link-whole-rlib to rmake 2024-07-19 12:27:47 -04:00
Oneirical
01c7118fa9 rewrite extern-fn-with-union to rmake 2024-07-19 12:27:47 -04:00
Oneirical
8a09f2231d rewrite extern-fn-generic to rmake 2024-07-19 12:27:47 -04:00
Oneirical
1a4fba5eb0 rewrite c-static-rlib to rmake 2024-07-19 12:27:47 -04:00
Oneirical
1ae1ab8215 rewrite c-static-dylib to rmake 2024-07-19 12:27:47 -04:00
Oneirical
5e55f07cc0 rewrite and rename issue-28595 to rmake 2024-07-19 12:27:46 -04:00