Commit Graph

240279 Commits

Author SHA1 Message Date
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
Hirochika Matsumoto
f4c2bdeec9 Suggest swapping the order of ref and box 2023-11-27 21:38:19 +09:00
bors
aa330518f4 Auto merge of #118365 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`
2023-11-27 12:22:37 +00:00
Deadbeef
dd3437b718 rename method 2023-11-27 11:45:36 +00:00
León Orell Valerian Liehr
16c164fea3
Detect and reject malformed repr(Rust) hints 2023-11-27 12:29:21 +01:00
Laurențiu Nicola
d036daadda Remove instant from EXCEPTIONS_RUST_ANALYZER 2023-11-27 12:54:24 +02:00
Laurențiu Nicola
0c962520fd Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-ra 2023-11-27 12:40:39 +02: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
5ba6480f02 Auto merge of #11877 - samueltardieu:doc-fix, r=flip1995
`TypeckResults::node_type()` can be used inside of bodies

Doc fix.

changelog: none
2023-11-27 09:09:17 +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
Ralf Jung
8892d29282 make const tests independent of std debug assertions 2023-11-27 09:15:40 +01: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
9b8119dc21 Auto merge of #3193 - rust-lang:rustup-2023-11-27, r=RalfJung
Automatic Rustup
2023-11-27 07:13:04 +00: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
The Miri Conjob Bot
fa6ecc9f67 Merge from rustc 2023-11-27 05:03:31 +00:00
The Miri Conjob Bot
1293a6a281 Preparing for merge from rustc 2023-11-27 04:56:43 +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
Mark Rousskov
1487bd6a17 Cut code size for feature hashing
This locally cuts ~32 kB of .text instructions.
2023-11-26 22:34:17 -05: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
Michael Goulet
8490b8ec63 Dont suggest ! for path in function call if it has generic args 2023-11-27 01:02:37 +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
Mark Rousskov
8375fe4710 Simplify indenting in THIR printing
This cuts >100kb from a local librustc_driver.so build, and seems just
obviously simpler.
2023-11-26 18:44:16 -05:00
Michael Goulet
0eb85ff03f Use helpers 2023-11-26 23:24:53 +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
f30a859ae3 Auto merge of #11867 - y21:implied_bounds_in_impls_complexity, r=Jarcho
Move `implied_bounds_in_impls` back to complexity

This lint was originally in the complexity category when I PR'd it. It was then moved to nursery by me due to a number of issues (a false positive, an invalid suggestion and an ICE), but that was probably an overreaction and all of the issues were fixed quickly after.
This is a useful lint imo and there hasn't been any issues with it in a few months, so I say we should give it another try and move it back to complexity.

I did a lintcheck run on the top 400 crates and all of them are legitimate, with 18 warnings. Most of them are from anstyle having a `impl Display + Copy + Clone` return type, or the bitvec crate with a return type like `impl Iterator + DoubleEndedIterator`.

changelog: Move [`implied_bounds_in_impls`] to `complexity` (Now warn-by-default)
[#11867](https://github.com/rust-lang/rust-clippy/pull/11867)
2023-11-26 22:28:13 +00:00
bors
2c56b4f800 Auto merge of #11875 - samueltardieu:fix-11868, r=Jarcho
Fix `box_default` behaviour with empty `vec![]` coming from macro arg

Fix #11868

changelog: [`box_default`]: do not warn on `Box::new(vec![])` if the `vec![]` comes from a macro argument
2023-11-26 22:00:02 +00: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
Samuel Tardieu
0d09cb0a6b manual_try_fold: check that fold is really Iterator::fold 2023-11-26 22:46:13 +01:00
Samuel Tardieu
a7c59aba20 TypeckResults::node_type() can be used inside of bodies 2023-11-26 22:30:16 +01: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
Ryan Mehri
ee96a7a288
move comment about local trait 2023-11-26 10:09:25 -08: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
Ryan Mehri
af6b84aaab
don't add redundant help for object safety violations 2023-11-26 09:53:58 -08: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
Samuel Tardieu
23d533264f Fix box_default behaviour with empty vec![] coming from macro arg 2023-11-26 18:40:50 +01:00
Waffle Maybe
41a97888c7
Add my work email to the mailmap 2023-11-26 18:39:38 +01:00
The 8472
bc7dd5fa6d unify read_to_end and io::copy impls for reading into a Vec 2023-11-26 18:13:36 +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