Commit Graph

239688 Commits

Author SHA1 Message Date
Hirochika Matsumoto
acec70de9b Change help message to make some sense in broader context 2023-11-27 22:18:03 +09:00
Hirochika Matsumoto
730d299354 Address review feedbacks
Also addressed merge conflicts upon rebasing.
2023-11-27 22:06:42 +09:00
Hirochika Matsumoto
61c3e4d56e Make tidy test happy 2023-11-27 21:48:10 +09:00
Hirochika Matsumoto
e65c060d78 Detect Python-like slicing and suggest how to fix
Fix #108215
2023-11-27 21:48:10 +09:00
bors
b29a1e00f8 Auto merge of #118352 - Zalathar:llvm-hash, r=onur-ozkan
bootstrap: Memoize the LLVM rebuild hash to avoid very slow `x check`

Recently I've encountered a massive regression in the performance of re-running `x check` after making no changes.

It used to take around 2 seconds, and now it takes 20-30 seconds. That's quite a hassle when r-a runs it every time I save.

After some poking around, what I've found is that each individual call to `generate_smart_stamp_hash` doesn't take a particularly long time (around 0.5 sec), but it gets called dozens of times during `x check`, and that seems to be what's adding up to 20-30 seconds.

---

https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Massive.20regression.20in.20no-op.20.60x.20check.60

cc `@onur-ozkan`
2023-11-27 10:22:08 +00:00
bors
cc1130732d Auto merge of #118353 - matthiaskrgr:rollup-sf1booi, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #118322 (skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only`)
 - #118325 (Fix Rustdoc search docs link)
 - #118338 (Backticks fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-27 08:16:56 +00:00
Zalathar
4f1cf0b5da bootstrap: Memoize the LLVM rebuild hash to avoid very slow x check 2023-11-27 18:21:19 +11:00
Matthias Krüger
96cd028b24
Rollup merge of #118338 - nnethercote:backticks, r=compiler-errors
Backticks fixes

r? `@lqd`
2023-11-27 08:21:19 +01:00
Matthias Krüger
828db2860f
Rollup merge of #118325 - clubby789:rustdoc-search-link, r=fmease
Fix Rustdoc search docs link

This link has been outdated since #112725 moved the search docs to their own page
2023-11-27 08:21:19 +01:00
Matthias Krüger
8946bf56c6
Rollup merge of #118322 - onur-ozkan:if-only-doctests-skip-compiletest, r=clubby789
skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only`

As use of `--doc` with `x test` is intended for running doc-tests only, executing compiletest, tidy or rustdoc-gui based tests considered as an incorrect behavior from bootstrap. This change fixes that.
2023-11-27 08:21:18 +01:00
bors
a19161043a Auto merge of #118321 - WaffleLapkin:unspace-fn-pointer-fake-variadic, r=notriddle
rustdoc: Remove space from fake-variadic fn ptr impls

before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`

I don't think we usually have spaces there, so it looks weird.

cc `@notriddle` since you added the space in https://github.com/rust-lang/rust/pull/98180 (or rather, added the feature with a space included).
2023-11-27 06:16:15 +00:00
bors
601a42713c Auto merge of #118313 - WaffleLapkin:fixup_comments_in_some_nonzero_ops, r=thomcc
Improve some comments for non-zero ops

This makes them a bit more explicit/correct.
2023-11-27 04:18:54 +00:00
bors
48cfbe0cdf Auto merge of #118327 - WaffleLapkin:mailmap-wl-tsk, r=Mark-Simulacrum
Add my work email to the mailmap

(my employer asks me to commit upstreaming under my work email)
2023-11-27 02:02:47 +00:00
bors
ac9b308133 Auto merge of #117584 - bjorn3:eager_output_filenames, r=b-naber
Eagerly compute output_filenames

It can be computed before creating TyCtxt. Previously the query would also write the dep info file, which meant that the output filenames couldn't be accessed before macro expansion is done. The dep info file writing is now done as a separate non-query function. The old query was always executed again anyways due to depending on the HIR.

Also encode the output_filenames in rlink files to ensure `#![crate_name]` affects the linking stage when doing separate compiling and linking using `-Zno-link`/`-Zlink-only`.
2023-11-27 00:03:51 +00:00
Nicholas Nethercote
566df2722a Fix some backticks in comments. 2023-11-27 09:38:58 +11:00
Nicholas Nethercote
f1eee2843f Put backticks around some attributes in doc comments.
Without backticks they cause some "unresolved link to `foo`" warnings.
2023-11-27 09:37:01 +11:00
bors
6cf088810f Auto merge of #118316 - Mark-Simulacrum:delete-copy-to-upvars, r=cjgillot
Remove borrowck Upvar duplication

This cuts out an extra allocation and copying over from the already cached closure capture information.
2023-11-26 21:47:19 +00:00
bors
1bcbb7c93b Auto merge of #117697 - WaffleLapkin:non-null-convenience-ops, r=Amanieu
Non null convenience ops

Based on https://github.com/rust-lang/libs-team/issues/251.

I went through all of the methods on `*mut` and added every method, which does not require additional safety conditions, to `NonNull`. (exceptions: `guaranteed_eq`, `guaranteed_ne`, `with_metadata_of`, it's unclear if they are useful here...)

I'm also not sure what types should the "second pointer parameter" be. `*mut`/`*const` might be more permissible, but given that `NonNull` doesn't coerce to them, it might also be annoying. For now I chose the "use `NonNull` everywhere" path, but I'm not sure it's the correct one...

<sub>I'm eepy, so I probably messed up somewhere while copying...</sub>

cc `@scottmcm`
r? libs-api
2023-11-26 18:41:55 +00:00
Mark Rousskov
d920dd8d38 Remove Upvar duplication
This cuts out an extra allocation and copying over from the already
cached closure capture information.
2023-11-26 13:19:10 -05:00
bjorn3
d7e9a30941 Turn write_dep_info into a regular function
It has side-effects and as such can't be cached.
2023-11-26 18:02:47 +00:00
bjorn3
365a580bc4 Mostly revert "Accept crate name instead of attributes in build_output_filenames" 2023-11-26 18:02:47 +00:00
bjorn3
7ede8e2a59 Ensure macro expansion runs before writing the dep info 2023-11-26 18:02:47 +00:00
bjorn3
4acaa0284e Feed the output filenames into the TyCtxt
Since the introduction of the crate attribute pre-expansion pass we
don't need access to the TyCtxt to compute it.
2023-11-26 18:02:47 +00:00
bjorn3
98a6eaa7f8 Serialize OutputFilenames into rmeta file
This ensures that linking will use the correct crate name even when
`#![crate_name = "..."]` is used to specify the crate name.
2023-11-26 18:02:42 +00:00
bjorn3
eacbe65dfe Accept crate name instead of attributes in build_output_filenames 2023-11-26 17:43:49 +00:00
bjorn3
457dbbfc55 Inline and remove pre_configure 2023-11-26 17:43:49 +00:00
Waffle Maybe
41a97888c7
Add my work email to the mailmap 2023-11-26 18:39:38 +01:00
bors
3bb0171999 Auto merge of #118319 - GuillaumeGomez:rollup-vte50yq, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #118296 (rustdoc: replace `elemIsInParent` with `Node.contains`)
 - #118302 (Clean dead codes)
 - #118311 (merge `DefKind::Coroutine` into `Defkind::Closure`)
 - #118318 (Remove myself from users on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-26 16:42:32 +00:00
clubby789
4d9344d26e Fix Rustdoc search docs link 2023-11-26 16:22:43 +00:00
Maybe Waffle
e1b4e8a257 Add is_aligned{,_to} convenience methods to NonNull 2023-11-26 16:01:31 +00:00
Maybe Waffle
2bcaa9760e Add align_offset convenience method to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
4cc46df98c Add replace and swap convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
4bcdd3bd92 Add offset_from-ish convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
ebdc79497f Add offset-ish convenience methods to NonNull 2023-11-26 16:01:30 +00:00
Maybe Waffle
36a587fb62 Add read/write/copy convenience methods to NonNull 2023-11-26 15:57:01 +00:00
onur-ozkan
1a86482c57 skip {tidy,compiletest,rustdoc-gui} based tests for DocTests::Only
As use of `--doc` with `x test` is intended for running doc-tests only, executing
compiletest, tidy or rustdoc-gui based tests considered as an incorrect behavior
from bootstrap. This change fixes that.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-26 18:18:49 +03:00
Maybe Waffle
1a3c5c40ca rustdoc: Remove space from fake-variadic fn ptr impls
before: `for fn (T₁, T₂, …, Tₙ) -> Ret`
after: `for fn(T₁, T₂, …, Tₙ) -> Ret`
2023-11-26 15:01:42 +00:00
Guillaume Gomez
cb04603af4
Rollup merge of #118318 - WaffleLapkin:unvacation-waffle, r=WaffleLapkin
Remove myself from users on vacation

I think I have some capacity for reviews now and recently there were a few PRs with explicit `r? `@WaffleLapkin`` which I'm actually capable to review, so
2023-11-26 15:44:55 +01:00
Guillaume Gomez
c6d20d70b4
Rollup merge of #118311 - bvanjoi:merge_coroutinue_into_closure, r=petrochenkov
merge `DefKind::Coroutine` into `Defkind::Closure`

Related to #118188

We no longer need to be concerned about the precise type whether it's `DefKind::Closure` or `DefKind::Coroutine`.

Furthermore, thanks for the great work done by `@petrochenkov` on investigating https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Why.20does.20it.20hang.20when.20querying.20.EF.BB.BF.60opt_def_kind.60.3F

r? `@petrochenkov`
2023-11-26 15:44:54 +01:00
Guillaume Gomez
c67613bef9
Rollup merge of #118302 - mu001999:dead_code/clean, r=cjgillot
Clean dead codes

Clean dead codes detected by #118257
2023-11-26 15:44:54 +01:00
Guillaume Gomez
bb5bbbf4ea
Rollup merge of #118296 - notriddle:notriddle/main-dom, r=GuillaumeGomez
rustdoc: replace `elemIsInParent` with `Node.contains`

According to [MDN], this function is compatible with:

* Chrome 16 and Edge 12
* Firefox 9
* Safari 1.1 and iOS Safari 1

These browsers are well within our [support matrix], which requires compatibility with Chrome 118, Firefox 115, Safari 17, and Edge 119.

[MDN]: https://developer.mozilla.org/en-US/docs/Web/API/Node/contains#browser_compatibility
[support matrix]: https://browsersl.ist/#q=last+2+Chrome+versions%2C+last+1+Firefox+version%2C+Firefox+ESR%2C+last+1+Safari+version%2C+last+1+iOS+version%2C+last+1+Edge+version%2C+last+1+UCAndroid+version
2023-11-26 15:44:53 +01:00
bors
3dbb4da042 Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin
Call FileEncoder::finish in rmeta encoding

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

The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out.

I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths.

I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing.

r? `@WaffleLapkin`
2023-11-26 14:43:02 +00:00
Waffle Maybe
4a22b1aa1c
Remove myself from users on vacation 2023-11-26 15:33:34 +01:00
bohan
f23befe6c1 merge DefKind::Coroutine into DefKind::Closure 2023-11-26 21:05:08 +08:00
bors
0b8a61b235 Auto merge of #118267 - compiler-errors:ambiguity-causes, r=spastorino
`AmbiguityCause` should not eagerly format strings

Minor tweak found when working on some coherence diagnostics stuff (towards `-Ztrait-solver=next-coherence` stabilization)
2023-11-26 12:44:38 +00:00
Maybe Waffle
c860ba1994 Improve some comments for non-zero ops 2023-11-26 11:47:08 +00:00
bors
3acb261e21 Auto merge of #118256 - petrochenkov:nohir, r=compiler-errors
rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` cleanup

Noticed this while working on https://github.com/rust-lang/rust/pull/118188.

The history here is that the method was moved from HIR map to tcx in https://github.com/rust-lang/rust/pull/93373 as a part of incremental compilation work, so it's unlikely to go back.
2023-11-26 10:43:41 +00:00
Vadim Petrochenkov
c697927f44 rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
bors
274b5249eb Auto merge of #117880 - lqd:liveness-values, r=cjgillot
Refactor borrowck liveness values

This PR starts cleaning up `rustc_borrowck`, in particular around liveness values:
- refactors simple names that make no sense anymore: either referring to older structures using region elements, or to bitset containers and values.
- improves comments and fixes others
- removes unused return values and unneeded generic arguments

r? `@matthewjasper`
2023-11-26 08:44:28 +00:00
bors
9529a5d265 Auto merge of #110303 - nbdd0121:master, r=Mark-Simulacrum
Add `debug_assert_nounwind` and convert `assert_unsafe_precondition`

`assert_unsafe_precondition` checks non-CTFE-evaluable conditions in runtime and performs no-op in compile time, while many of its current usage can be checked during const eval.
2023-11-26 06:44:03 +00:00