Commit Graph

239931 Commits

Author SHA1 Message Date
Takayuki Maeda 465c4c9885
Rollup merge of #118358 - RalfJung:const-tests, r=WaffleLapkin
make const tests independent of std debug assertions

Fixes some fallout from https://github.com/rust-lang/rust/pull/110303: `ignore-debug` is bad since it makes it very annoying to develop rustc with debug assertions enabled.

These tests do not really provide any interesting test coverage, we already got plenty of other tests that check that we detect invalid enums. So we can just remove them.
2023-11-27 22:38:24 +09:00
Takayuki Maeda 3dc807ca07
Rollup merge of #118340 - compiler-errors:tweaks, r=lqd
Use helper functions in `pretty.rs` instead of accessing the `Cell`s manually

Pulled this out of another PR that I never landed.
2023-11-27 22:38:24 +09:00
Takayuki Maeda 7b4eb52041
Rollup merge of #118095 - ferrocene:apply-cortex-a53-fix, r=davidtwco
Enable the Arm Cortex-A53 errata mitigation on aarch64-unknown-none

Arm Cortex-A53 CPUs have an errata related to a specific sequence of instructions - errata number 843419 (https://documentation-service.arm.com/static/5fa29fddb209f547eebd361d). There is a mitigation that can be applied at link-time which detects the when sequence of instructions exists at a specific alignment. When detected, the linker re-writes those instructions and either changes an ADRP to an ADR, or bounces to a veneer to break the sequence.

The linker argument to enable the mitigation is "--fix-cortex-a53-843419", and this is supported by GNU ld and LLVM lld. The gcc argument to enable the flag is "-mfix-cortex-a53-843419".

Because the aarch64-unknown-none target uses rust-lld directly, this patch causes rustc to emit the "--fix-cortex-a53-843419" argument when calling the linker, just like aarch64-linux-gnu-gcc on Ubuntu 22.04 does.

Failure to enable this mitigation in the linker can cause the production of instruction sequences that do not execute correctly on Arm Cortex-A53.
2023-11-27 22:38:23 +09:00
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
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 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 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
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 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
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
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
clubby789 4d9344d26e Fix Rustdoc search docs link 2023-11-26 16:22:43 +00:00
onur-ozkan 1017042575 give dev-friendly error message for incorrect config profiles
before this change, an incorrect profile would result in the following error:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    with open(include_path) as included_toml:
         ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml'
```

with this change, the error message is now:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults"
Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options.
```

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-26 19:05:02 +03: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