Commit Graph

142856 Commits

Author SHA1 Message Date
Matthias Krüger
849f4f8845
Rollup merge of #113588 - RalfJung:llvm-merge-base, r=albertlarsan68
bootstrap: use git merge-base for LLVM CI download logic

Fixes https://github.com/rust-lang/rust/issues/101907
I tested this with a local branch that has extra merge commits due to Miri, and it worked fine there. But I am sure there are tons of other situations I did not think of...

r? `@jyn514`
2023-08-01 06:55:53 +02:00
Matthias Krüger
02426434e2
Rollup merge of #113394 - joshtriplett:style-edition-snapshot, r=calebcartwright
style-guide: Document style editions, start 2024 style edition

Link to a snapshot for the 2015/2018/2021 style edition.

This is a draft, because I'd like to wait for a few style guide fixes to merge
before snapshotting the 2015/2018/2021 style edition:

- https://github.com/rust-lang/rust/pull/113145
- https://github.com/rust-lang/rust/pull/113380
- https://github.com/rust-lang/rust/pull/113384
- https://github.com/rust-lang/rust/pull/113385
- https://github.com/rust-lang/rust/pull/113386
- https://github.com/rust-lang/rust/pull/113392

I'd like to wait for these for two reasons: to make it easier to see the
differences between the 2015/2018/2021 style edition and the 2024 style
edition (without the noise of guide-wide changes), and to minimize confusion so
that bugfixes to the style guide that we include in the previous edition don't
look like they're only part of the 2024 style edition.

I've used "Miscellaneous `rustfmt` bugfixes" as a starting point for the list
of 2024 changes, for now. We can update that when we add more 2024 changes.

The section added in this PR can then serve as a baseline for our drafts of
2024 style edition changes.

In the meantime, I'd like to get someone from `@rust-lang/style` to review and
approve the text here; I'll update it with a commit hash when the above PRs
have merged.
2023-08-01 06:55:52 +02:00
bors
b484c87811 Auto merge of #114310 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

This is a bit delayed, because I thought it is a difficult conflict resolution and didn't have time for that over the weekend. Turns out, I just used the wrong merge base and it was actually easy... Don't do syncs in the middle of the night (even though I broke this rule with this PR again).
2023-08-01 01:14:38 +00:00
Josh Triplett
6a0886cdba Link to the Rust edition guide for more information about editions 2023-07-31 17:11:47 -07:00
Josh Triplett
0217565e24 style-guide: Document style editions, start 2024 style edition
Link to a snapshot for the 2015/2018/2021 style edition.
2023-07-31 17:11:47 -07:00
bors
706a4d9a4e Auto merge of #114308 - matthiaskrgr:rollup-m64bkm7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #109318 (Make `Debug` representations of `[Lazy, Once]*[Cell, Lock]` consistent with `Mutex` and `RwLock`)
 - #113701 (Re-export core::ffi::FromBytesUntilNulError in std::ffi)
 - #113804 (Resolve correct archive version name in `opt-dist`)
 - #114165 (Add missing rvalues to smir)
 - #114182 (clean up after 113312)
 - #114193 (Update lexer emoji diagnostics to Unicode 15.0)
 - #114200 (Detect trait upcasting through struct tail unsizing in new solver select)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-31 23:30:28 +00:00
Philipp Krones
53f09d95eb
Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyup 2023-07-31 23:53:53 +02:00
Matthias Krüger
57c57a555b
Rollup merge of #114193 - crlf0710:lexer_unicode15, r=Manishearth
Update lexer emoji diagnostics to Unicode 15.0

This replaces the `unic-emoji-char` dep tree (which hasn't been updated for a while) with `unicode-properties` crate which contains Unicode 15.0 data.

Improves diagnostics for added emoji characters in recent years. (See tests).

cc #101840

cc ``@Manishearth``
2023-07-31 22:51:15 +02:00
Matthias Krüger
756da76814
Rollup merge of #113804 - Kobzol:opt-dist-version, r=Mark-Simulacrum
Resolve correct archive version name in `opt-dist`

Should resolve the master part of https://github.com/rust-lang/rust/issues/113784.

r? `@Mark-Simulacrum`
2023-07-31 22:51:13 +02:00
Matthias Krüger
82c50ce97f
Rollup merge of #113906 - notriddle:notriddle/cargo-extra-env, r=Mark-Simulacrum
etc: add `RUSTC_BOOTSTRAP` to rust-analyzer config

Fixes the problem reported in https://github.com/rust-lang/rust/issues/112391#issuecomment-1597224941
2023-07-31 22:49:50 +02:00
Matthias Krüger
58f963fb65
Rollup merge of #113717 - cuishuang:master, r=Nilstrieb
remove repetitive words
2023-07-31 22:49:47 +02:00
Matthias Krüger
d0ae0b31a8
Rollup merge of #112858 - chriswailes:riscv64-android, r=Mark-Simulacrum
Update Android system definitions and add riscv-linux-android as tier 3 target

This PR includes the following:
* Corrected Android system definitions for some types
* Support for the riscv64-linux-android target

The authoritative types for the system definitions can be found here: https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/stat.h

Fixes rust-lang/compiler-team#640
2023-07-31 22:49:46 +02:00
Ralf Jung
314fe5dd01
apply nit
Co-authored-by: Albert Larsan <albertlarsan@unbon.cafe>
2023-07-31 18:39:41 +02:00
bors
b3df56a65f Auto merge of #114294 - matthiaskrgr:rollup-yk78pvd, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #114111 (Improve test case for experimental API remove_matches)
 - #114169 (refactor builtin unsize handling, extend comments)
 - #114182 (clean up after 113312)
 - #114193 (Update lexer emoji diagnostics to Unicode 15.0)
 - #114200 (Detect trait upcasting through struct tail unsizing in new solver select)
 - #114228 (Check lazy type aliases for well-formedness)
 - #114267 (Map RPITIT's opaque type bounds back from projections to opaques)
 - #114269 (Migrate GUI colors test to original CSS color format)
 - #114286 (Add missing feature gate in multiple_supertrait_upcastable doc)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-31 16:29:54 +00:00
Matthias Krüger
95b7116d70
Rollup merge of #114228 - fmease:wf-lazy-ty-aliases, r=oli-obk
Check lazy type aliases for well-formedness

Previously we didn't check if `T: Mul` holds given lazy `type Alias<T> = <T as Mul>::Output;`.
Now we do. It only makes sense.

`@rustbot` label F-lazy_type_alias

r? `@oli-obk`
2023-07-31 16:57:54 +02:00
bors
3114eb1fa5 Auto merge of #113592 - Kobzol:pgo-script-bolt, r=Mark-Simulacrum
Move BOLT from `bootstrap` to `opt-dist`

Currently, we use BOLT to optimize LLVM for x64 Linux. The BOLT instrumentation and optimization step is implemented in `bootstrap`, but it was always quite hacky, because BOLT works quite differently than PGO. Rather than building an instrumented artifact, it takes an already built artifact and instruments it in-place. This is not a good fit for the bootstrap caching mechanism, and it meant that we had to run BOLT "on-the-fly" when packaging LLVM artifacts into the created sysroot.

The BOLT code was also really only used by the PGO script (now called `opt-dist`) and nothing else, so it was quite hardcoded for this one single usage. And even if someone wanted to use the `--llvm-bolt-profile-[use/generate]` bootstrap flags outside of the PGO script, they would also need to implement profile gathering, as this is not performed by bootstrap anyway.

I think that it could be more practical to move the BOLT logic to the `opt-dist` tool instead. This simplifies bootstrap, removes unneeded implementation of BOLT caching (we will now do it exactly once - no need to check if it has been performed already when bootstrap copies `libLLVM.so` around multiple times) and removes two BOLT-specific bootstrap flags, and also one special case for building LLVM (instead I pass the linker flags with `--set llvm.ldflags` from `opt-dist` now).

There are also a few disadvantages to this new approach:
- We have to guess/find the path to the built `libLLVM.so` file (but currently this is quite easy, it's just in `stage2/lib`).
- We have to provide the BOLT profile externally to bootstrap, so that it is packaged into the reproducible artifacts archive. Doesn't seem like a big deal to me.
- We are depending on some inner behavior of boostrap in `opt-dist` (namely, that `libLLVM.so` is hardlinked). But we do that for many other things in the `opt-dist` tool anyway, it's tied quite closely to bootstrap.

I would like to go back to my attempts to also use BOLT for `librustc_driver.so`, and I think that it might be a bit simpler if I also do it from the `opt-dist` tool, so this is the first step towards that.

Anyway, let me know what you think about this. It's just a refactoring in a way, no big deal.

r? bootstrap
2023-07-31 14:36:09 +00:00
bors
b321edd1b2 Auto merge of #114277 - weihanglo:update-cargo, r=weihanglo
Update cargo

14 commits in 7ac9416d82cd4fc5e707c9ec3574d22dff6466e5..c91a693e7977e33a1064b63a5daf5fb689f01651
2023-07-24 14:29:38 +0000 to 2023-07-31 00:26:46 +0000
- fix: align `cargo --help` text (rust-lang/cargo#12418)
- fix: normalize relative git submodule urls with `ssh://` (rust-lang/cargo#12411)
- test: relax help text assertion (rust-lang/cargo#12416)
- test: relax assertions of panic handler message format (rust-lang/cargo#12413)
- fix(package): Recognize and normalize `cargo.toml` (rust-lang/cargo#12399)
- Clarify `lto` setting passing `-Clinker-plugin-lto` (rust-lang/cargo#12407)
- doc: add missing reference to `CARGO_PROFILE_&lt;name&gt;_STRIP` in environment variables docs (rust-lang/cargo#12408)
- Update curl-sys to pull in curl 8.2.1 (rust-lang/cargo#12406)
- docs: raise awareness of resolver used inside workspace (rust-lang/cargo#12388)
- chore: update `home` to 0.5.7 (rust-lang/cargo#12401)
- Update curl-sys to pull in curl 8.2.0 (rust-lang/cargo#12400)
- test(cli): Track --help output (rust-lang/cargo#11912)
- refactor(test): Move cargo-config into a dir (rust-lang/cargo#12398)
- refactor(tests): Name init ui tests more consistently (rust-lang/cargo#12397)

r? `@ghost`
2023-07-31 10:13:09 +00:00
cui fliter
88c7b16e03 remove repetitive words
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-31 16:13:02 +08:00
Weihang Lo
00a774774b
Update cargo 2023-07-31 09:09:20 +01:00
Jakub Beránek
142995f15f
Pass BOLT profile to bootstrap to be included in the reproducible artifacts archive 2023-07-31 08:54:47 +02:00
Jakub Beránek
78403f4e13
Remove BOLT from bootstrap 2023-07-31 08:54:47 +02:00
Jakub Beránek
a16925d5f3
Implement BOLT optimization in the opt-dist tool 2023-07-31 08:52:41 +02:00
Nicholas Nethercote
0ea9950ede Document -Zno-parallel-llvm.
Because it's usefulness wasn't clear to me, and I initially wondered if
it could be removed. The text is based on the text in #50972, the PR
that added the flag.
2023-07-31 16:21:02 +10:00
bors
d9feb02e8d Auto merge of #114126 - ozkanonur:stage-support-for-clean, r=ozkanonur
clean stage-specific artifacts using `x clean --stage`

fixes #109313
2023-07-31 00:45:33 +00:00
bors
d4145eeef4 Auto merge of #112843 - chenyukang:yukang-more-on-backtrace, r=workingjubilee
Print omitted frames count for short backtrace mode

Fixes #111730
2023-07-30 22:31:52 +00:00
ozkanonur
78326cdb35 remove stage-specific artifacts when --stage is used
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-07-30 23:12:34 +03:00
ozkanonur
25268638aa support --stage for x clean
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-07-30 23:12:12 +03:00
bors
a8be6e070f Auto merge of #114204 - GuillaumeGomez:remove-unneeded-clone-calls, r=notriddle
[rustdoc] Remove unneeded `clone()` calls for `derive_id`

I realized we were cloning values before passing them to `derive_id` where they are cloned again, which isn't great. Since they'll be cloned anyway, let's allow to pass both by reference and by value.

r? `@notriddle`
2023-07-30 18:11:08 +00:00
bors
89acdae9f2 Auto merge of #114250 - matthiaskrgr:rollup-0r0dhrr, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #110056 (Fix the example in document for WaitTimeoutResult::timed_out)
 - #112655 (Mark `map_or` as `#[must_use]`)
 - #114018 (Make `--error-format human-annotate-rs` handle multiple files)
 - #114068 (inline format!() args up to and including rustc_middle (2))
 - #114223 (Documentation: Fix Stilted Language in Vec->Indexing)
 - #114227 (Add tidy check for stray rustfix files)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-30 13:59:25 +00:00
Matthias Krüger
b9f17f1e78
Rollup merge of #114227 - asquared31415:tidy_check_fixed, r=albertlarsan68
Add tidy check for stray rustfix files

`x.fixed` files that don't correspond to a test file now emit a tidy error.
2023-07-30 14:25:10 +02:00
Matthias Krüger
e3bf088fb5
Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
Mark `map_or` as `#[must_use]`

I don't know what else to say.

r? libs
2023-07-30 14:25:08 +02:00
Guillaume Gomez
148a0c1673 Remove some unneeded clone() calls 2023-07-30 13:26:36 +02:00
Maybe Waffle
90f9640528 Mark map_or as #[must_use] 2023-07-30 10:22:23 +00:00
Matthias Krüger
a0503a83d0 bootstrap: inline format!() args 2023-07-30 11:46:14 +02:00
León Orell Valerian Liehr
0ca432844c
Check lazy type aliases for well-formedness 2023-07-30 11:24:15 +02:00
asquared31415
6850a00bd0 add tidy check for stray rustfix files 2023-07-29 23:49:04 +00:00
Matthias Krüger
fa94851b07
Rollup merge of #114129 - GuillaumeGomez:rustdoc-cleanup, r=notriddle
Rustdoc small cleanups

Each commit does some little cleanups:

 * We had some `Res` comparisons in multiple places (and still do, but unless we use a macro, it's not possible to "merge" any further) so I moved it into a function.
 * It was weird to have some utils function used everywhere in `visit_ast` so I instead moved it into `clean/utils.rs`.
 * In HTML rendering, we had some write "issues":
   * Multiple calls that could be merged into one.
   * Some `write!` that could be `write_str`.
   * We didn't use the new `format!` args much.

r? `@notriddle`
2023-07-30 01:22:42 +02:00
bors
32303b219d Auto merge of #114211 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-07-29 20:41:45 +00:00
bors
70757fbdd7 Auto merge of #2993 - Vanille-N:tb-protector, r=RalfJung
TB: Redefine trigger condition for protectors

The Coq formalization revealed that as currently implemented, read accesses did not always commute.
Indeed starting from a lazily initialized `Active` protected tag, applying a foreign read then a child read produces `Frozen`, but child read then foreign read triggers UB (because the child read initializes _before_ the `Active -> Frozen`).

This reformulation of when protectors trigger fixes that issue:
- instead of `Active + foreign read -> Frozen` and `Active -> Frozen` when protected is UB
- we do `Active + foreign read -> if protected { Disabled } else { Frozen }`

There is already precedent for transitions being dependent on the presence of a protector (`Reserved + foreign read -> if protected { Frozen } else { Reserved }`), and this has the nice side-effect of simplifying the protector trigger condition to just an equality check against `Disabled` since now there is protector UB iff a protected tag becomes `Disabled`.

In order not to introduce an extra `if`, it was decided that `Disabled -> Disabled` would be UB when protected, which was not the case previously. This is merely a theoretical for now because a protected `Disabled` is unreachable in the first place.

The extra test is not directly related to this modification, but also checks things related to protectors and lazy initialization.
2023-07-29 16:59:45 +00:00
Neven Villani
53f0cb4b8a
doc comment suggestions 2023-07-29 18:17:34 +02:00
bors
4c96822796 Auto merge of #114148 - cuviper:drop-llvm-14, r=nikic
Update the minimum external LLVM to 15

With this change, we'll have stable support for LLVM 15 through 17 (pending release).
For reference, the previous increase to LLVM 14 was #107573.
2023-07-29 14:57:47 +00:00
Guillaume Gomez
b7871e5537 Group write calls when possible and use new format args 2023-07-29 14:40:00 +02:00
Guillaume Gomez
82bf232245 Move inherits_doc_hidden and should_ignore_res into clean/utils.rs 2023-07-29 14:39:10 +02:00
Guillaume Gomez
31bb3c0cd1 Move Res check into should_ignore_res 2023-07-29 14:39:10 +02:00
yukang
90db98d074 print omitted frames count for short backtrace mode 2023-07-29 20:36:05 +08:00
bors
f45961b60d Auto merge of #114141 - Kobzol:llvm-bolt-flags, r=lqd
Change LLVM BOLT flags

I talked to the BOLT maintainers about the binary size effect of BOLT. Currently, BOLTing LLVM increases its binary size from ~120 MiB to ~170 MiB, which is not ideal. Now we can track both runtime performance and (rustc, LLVM, ...) artifact sizes in perf.RLO, so I'd like to try experimenting with changing the flags to reduce `libLLVM.so` size without regressing the performance gains of BOLT too much.

r? `@ghost`
2023-07-29 09:37:49 +00:00
bors
04411507be Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstrieb
Rename and allow `cast_ref_to_mut` lint

This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`).

BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged.

r? `@Nilstrieb`
2023-07-29 07:48:44 +00:00
bors
5ed61a4378 Auto merge of #114197 - matthiaskrgr:rollup-iluf7u4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #113773 (Don't attempt to compute layout of type referencing error)
 - #114107 (Prevent people from assigning me as a PR reviewer)
 - #114124 (tests/ui/proc-macro/*: Migrate FIXMEs to check-pass)
 - #114171 (Fix switch-stdout test for none unix/windows platforms)
 - #114172 (Fix issue_15149 test for the SGX target)
 - #114173 (btree/map.rs: remove "Basic usage" text)
 - #114174 (doc: replace wrong punctuation mark)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-29 04:18:46 +00:00
Matthias Krüger
5dee519386
Rollup merge of #113773 - compiler-errors:err-layout-bail, r=cjgillot
Don't attempt to compute layout of type referencing error

Leads to more ICEs and strange diagnostics than are worth it.

Fixes #113760
2023-07-29 06:13:05 +02:00
bors
4734ac0943 Auto merge of #111916 - fee1-dead-contrib:noop-method-call-warn, r=compiler-errors
make `noop_method_call` warn by default

r? `@compiler-errors`
2023-07-29 01:40:50 +00:00