Commit Graph

270814 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
acf6344b42
Address review comments 2024-11-10 23:57:18 +01:00
Esteban Küber
1d78004575
Add Unicode block-drawing compiler output support
Add nightly-only theming support to rustc output using Unicode box
drawing characters instead of ASCII-art to draw the terminal UI:

After:

```
error: foo
  ╭▸ test.rs:3:3
  │
3 │       X0 Y0 Z0
  │   ┌───╿──│──┘
  │  ┌│───│──┘
  │ ┏││━━━┙
  │ ┃││
4 │ ┃││   X1 Y1 Z1
5 │ ┃││   X2 Y2 Z2
  │ ┃│└────╿──│──┘ `Z` label
  │ ┃└─────│──┤
  │ ┗━━━━━━┥  `Y` is a good letter too
  │        `X` is a good letter
  ╰╴
note: bar
  ╭▸ test.rs:4:3
  │
4 │ ┏   X1 Y1 Z1
5 │ ┃   X2 Y2 Z2
6 │ ┃   X3 Y3 Z3
  │ ┗━━━━━━━━━━┛
  ├ note: bar
  ╰ note: baz
note: qux
  ╭▸ test.rs:4:3
  │
4 │   X1 Y1 Z1
  ╰╴  ━━━━━━━━
```

Before:

```
error: foo
 --> test.rs:3:3
  |
3 |       X0 Y0 Z0
  |    ___^__-__-
  |   |___|__|
  |  ||___|
  | |||
4 | |||   X1 Y1 Z1
5 | |||   X2 Y2 Z2
  | |||____^__-__- `Z` label
  | ||_____|__|
  | |______|  `Y` is a good letter too
  |        `X` is a good letter
  |
note: bar
 --> test.rs:4:3
  |
4 | /   X1 Y1 Z1
5 | |   X2 Y2 Z2
6 | |   X3 Y3 Z3
  | |__________^
  = note: bar
  = note: baz
note: qux
 --> test.rs:4:3
  |
4 |   X1 Y1 Z1
  |   ^^^^^^^^
```
2024-11-10 23:57:18 +01:00
Alona Enraght-Moony
bab112c2b8 triagebot: Autolabel rustdoc book 2024-11-10 22:05:07 +00:00
Alona Enraght-Moony
7e9c46b883 triagebot: Assign rustdoc tests to T-rustdoc. 2024-11-10 21:44:28 +00:00
bors
143ce0920a Auto merge of #132877 - matthiaskrgr:rollup-hbxg7p0, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #131781 (Stabilize Arm64EC inline assembly)
 - #132426 (Prefer `pub(super)` in `unreachable_pub` lint suggestion)
 - #132866 (Break from review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-10 21:37:52 +00:00
Matthias Krüger
bf6271784e
Rollup merge of #132866 - jieyouxu:review-rotation-break, r=jieyouxu
Break from review rotation

Spending ~a week to focus on:

- Digesting remaining `Makefile`s (so close yet so far).
- 2024 Q3 T-compiler P-high issues review pre-triage.
- Some docs for rustc-dev-guide.

r? `@ghost`
2024-11-10 22:20:35 +01:00
Matthias Krüger
54cb1f7fe6
Rollup merge of #132426 - Urgau:unreach_pub-super, r=petrochenkov
Prefer `pub(super)` in `unreachable_pub` lint suggestion

This PR updates the `unreachable_pub` lint suggestion to prefer `pub(super)` instead of `pub(crate)` when possible.

cc `@petrochenkov`
r? `@nnethercote`
2024-11-10 22:20:35 +01:00
Matthias Krüger
cdb76c77ac
Rollup merge of #131781 - taiki-e:arm64ec-stabilize-asm, r=Amanieu,traviscross
Stabilize Arm64EC inline assembly

This stabilizes inline assembly for Arm64EC ("Emulation Compatible").

Corresponding reference PR: https://github.com/rust-lang/reference/pull/1653

---

From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335

> Each architecture needs to be reviewed before stabilization:

> - It must have clobber_abi.

Done in https://github.com/rust-lang/rust/pull/131332.

> - It must be possible to clobber every register that is normally clobbered by a function call.

This is possible from the time of the initial implementation.

> - Generally review that the exposed register classes make sense.

The registers available in this target are a subset of those available in the AArch64 inline assembly which is already stable.

The following registers cannot be used in Arm64EC compared to AArch64:

- `x13`, `x14`, `x23`, `x24`, `x28` (register class: `reg`)
- `v[16-31]` (register class: `vreg`)
- `p[0-15]`, `ffr` (clobber-only register class `preg`)

These are disallowed by the ABI (see also [abi docs](https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170#register-mapping) for `reg`/`vreg` and https://github.com/rust-lang/rust/pull/131332#issuecomment-2401189142 for `preg`).

Although not listed in the above requirements, preserves_flags is also implemented and the same as AArch64.

---

cc `@dpaoliello`

r? `@Amanieu`

`@rustbot` label O-windows O-AArch64 +A-inline-assembly +T-lang -T-compiler +needs-fcp
2024-11-10 22:20:34 +01:00
onur-ozkan
a00fd7a965 warn about "src/bootstrap" on RUSTC_IF_UNCHANGED_ALLOWED_PATHS
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10 23:14:39 +03:00
onur-ozkan
72e63e3ad5 add test coverage for RUSTC_IF_UNCHANGED_ALLOWED_PATHS
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10 23:12:00 +03:00
onur-ozkan
baa95efa7a use allowed "if-unchanged" logic for compiler builds
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10 23:11:47 +03:00
onur-ozkan
469c8baab8 add test coverage for separate clippy prefixes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10 23:07:00 +03:00
onur-ozkan
6643586a1d handle separate prefixes in clippy args
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10 23:06:42 +03:00
binarycat
93ea5bb709 add regression test for #85763 2024-11-10 13:38:41 -06:00
Noratrieb
fc8c16eb82 #[inline] integer parsing functions
This improves the performance of `str::parse` into integers.

Before:
```
compare          fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ std                         │               │               │               │         │
   ├─ 328920585  10.23 ns      │ 24.8 ns       │ 10.34 ns      │ 10.48 ns      │ 100     │ 25600
   ├─ 3255       8.551 ns      │ 8.59 ns       │ 8.551 ns      │ 8.56 ns       │ 100     │ 25600
   ╰─ 5          7.847 ns      │ 7.887 ns      │ 7.847 ns      │ 7.853 ns      │ 100     │ 25600
```

After:
```
compare          fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ std                         │               │               │               │         │
   ├─ 328920585  8.316 ns      │ 23.7 ns       │ 8.355 ns      │ 8.491 ns      │ 100     │ 25600
   ├─ 3255       4.566 ns      │ 4.588 ns      │ 4.586 ns      │ 4.576 ns      │ 100     │ 51200
   ╰─ 5          2.877 ns      │ 3.697 ns      │ 2.896 ns      │ 2.945 ns      │ 100     │ 102400
```

Benchmark:
```rust
fn std(input: &str) -> Result<u64, ParseIntError> {
    input.parse()
}
```
2024-11-10 20:37:13 +01:00
binarycat
ae3c68db34 split up the first paragraph of doc comments for better summaries 2024-11-10 13:22:58 -06:00
Laurențiu Nicola
a11877735c
Merge pull request #18492 from samestep/docs-dev-no-design-label
Replace Design label with C-Architecture
2024-11-10 18:46:57 +00:00
Sam Estep
29f84262a4 Replace with C-Architecture 2024-11-10 13:34:26 -05:00
Jieyou Xu
e49d9173f8 Break from review rotation 2024-11-11 02:27:09 +08:00
bors
2128d8df0e Auto merge of #132863 - matthiaskrgr:rollup-1zbjz5f, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #132675 (coverage: Restrict empty-span expansion to only cover `{` and `}`)
 - #132849 (Miri subtree update)
 - #132858 (Update minifer version to `0.3.2`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-10 18:06:48 +00:00
Matthias Krüger
ba09426968
Rollup merge of #132858 - GuillaumeGomez:update-minifier, r=aDotInTheVoid
Update minifer version to `0.3.2`

This version fixes a few lints but the main change is that it makes `clap` dependency optional since it's only used for the binary.

r? `@notriddle`
2024-11-10 17:43:08 +01:00
Matthias Krüger
2681dcb189
Rollup merge of #132849 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-11-10 17:43:07 +01:00
Matthias Krüger
b95232dabb
Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu
coverage: Restrict empty-span expansion to only cover `{` and `}`

Coverage instrumentation has some tricky code for converting a coverage-relevant `Span` into a set of start/end line/byte-column coordinates that will be embedded in the CGU's coverage metadata.

A big part of this complexity is special code for handling empty spans, which are expanded into non-empty spans (if possible) because LLVM's coverage reporter does not handle empty spans well.

This PR simplifies that code by restricting it to only apply in two specific situations: when the character after the empty span is `{`, or the character before the empty span is `}`.

(As an added benefit, this means that the expanded spans no longer extend awkwardly beyond the end of a physical line, which was common under the previous implementation.)

Along the way, this PR also removes some unhelpful code for dealing with function source code spread across multiple files. Functions currently can't have coverage spans in multiple files, and if that ever changes (e.g. to properly support expansion regions) then this code will need to be completely overhauled anyway.
2024-11-10 17:43:07 +01:00
Alex Crichton
3af91a4cd4 Stabilize WebAssembly multivalue, reference-types, and tail-call target features
For the `multivalue` and `reference-types` features this commit is
similar to #117457 in that it's stabilizing target features specific to
WebAssembly targets. The previous PR left out these two features because
they weren't expected to change much about compiled code so it was
unclear what the rationale was. It has [since been discovered][blog]
that `reference-types` can be useful as it changes the binary format of
the `call_indirect` instruction. Additionally [on Zulip][zulip] there's
a use case of detecting these features at compile time and generating a
compile error to better warn users about features not supported on
engines.

This PR then additionally adds the `tail-call` feature which corresponds
to the [tail-call] proposal to WebAssembly. This feature advanced to
"phase 4" in the WebAssembly CG awhile back and has been supported in
LLVM for quite some time now. Engines are finishing up implementations
or have already shipped implementations, so while this is a bit of a
late addition to Rust itself it reflects the current status of
WebAssembly's state of the feature.

A test has been added here not only for these features but other
WebAssembly features as well to showcase that they're usable without
feature gates in stable Rust.

[blog]: https://blog.rust-lang.org/2024/09/24/webassembly-targets-change-in-default-target-features.html
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/wasm32.20reference-types.20.2F.20multivalue.20in.201.2E82-beta.20not.20enabled/near/473893987
[tail-call]: https://github.com/webassembly/tail-call
2024-11-10 07:45:14 -08:00
Guillaume Gomez
bc1c4be2fd Update minifer version to 0.3.2 2024-11-10 16:32:22 +01:00
bors
f5b62577f7 Auto merge of #132852 - RalfJung:rustc-if-unchanged, r=onur-ozkan
do not trust download-rustc=if-unchanged on CI for now

See https://github.com/rust-lang/rust/issues/131658.

Once https://github.com/rust-lang/rust/pull/131831 lands this will be unnecessary, for until then, better safe than sorry.

r? `@onur-ozkan`
Cc `@rust-lang/bootstrap`
2024-11-10 15:30:33 +00:00
Jieyou Xu
5c9cc0cfbb Re-enable version-verbose-commit-hash run-make test 2024-11-10 16:28:54 +01:00
Ralf Jung
b3c212103b do not trust download-rustc=if-unchanged on CI for now 2024-11-10 16:28:52 +01:00
Ralf Jung
c8058c81bf query/plumbing: adjust comment to reality 2024-11-10 15:13:33 +01:00
chansuke
b496873020 Update the doc comment of ASCII_CASE_MASK 2024-11-10 22:24:06 +09:00
bors
c22887b4d9 Auto merge of #132846 - jieyouxu:revert-132772, r=jieyouxu
Revert #132772 to fix unknown git commit hash

Reverts #132772 to address #132845, we seem to have unintentionally omitted commit hash.

r? `@onur-ozkan`
2024-11-10 12:43:44 +00:00
Jieyou Xu
c4c6d2b8d5 Temporarily disable version-verbose-commit-hash to force revert through 2024-11-10 20:31:18 +08:00
Jieyou Xu
c0cee4e36b Revert "Rollup merge of #132772 - onur-ozkan:download-rustc-default, r=jieyouxu"
This reverts commit c435fa8c4b, reversing
changes made to 88acd493f9.

Seems to have unintentionally omitted commit hash leading to
<https://github.com/rust-lang/rust/pull/132772>.
2024-11-10 20:31:18 +08:00
Ralf Jung
b2d1874dc2 elem_offset / subslice_range: use addr() instead of 'as usize' 2024-11-10 13:03:25 +01:00
Ralf Jung
881f2ec1b0
Merge pull request #4022 from RalfJung/linux-futex
fix linux-futex test being accidentally disabled
2024-11-10 12:01:30 +00:00
Ralf Jung
e8a3ffee49 fix linux-futex test being accidentally disabled 2024-11-10 12:36:40 +01:00
Ralf Jung
23054c5dfc move all mono-time checks into their own folder, and their own query 2024-11-10 12:12:12 +01:00
bjorn3
e8b10297b5 Fix error message for direct usage of sess.opts.crate_types 2024-11-10 10:37:53 +00:00
Ralf Jung
673d9c3e85
Merge pull request #3971 from RalfJung/futex-virtual
store futexes in per-allocation data rather than globally
2024-11-10 10:26:23 +00:00
Ralf Jung
d1a4812164 store futexes in per-allocation data rather than globally 2024-11-10 11:01:57 +01:00
bors
c24e166527 Auto merge of #132840 - matthiaskrgr:rollup-ibarl2r, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - #132136 (ABI compatibility: remove section on target features)
 - #132816 (Dont suggest `use<impl Trait>` when we have an edition-2024-related borrowck issue)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-10 09:31:15 +00:00
Ralf Jung
a839fbf0a1
Merge pull request #4021 from RalfJung/rustup
Rustup
2024-11-10 09:29:44 +00:00
Ralf Jung
e96808162a ensure that all publicly reachable const fn have const stability info 2024-11-10 10:16:26 +01:00
Matthias Krüger
c1f3c7078a
Rollup merge of #132816 - compiler-errors:2024-apit, r=jieyouxu
Dont suggest `use<impl Trait>` when we have an edition-2024-related borrowck issue

#131186 implements some machinery to detect in borrowck when we may have RPIT overcaptures due to edition 2024, and suggests adding `+ use<'a, T>` to go back to the edition 2021 capture rules. However, we weren't filtering out cases when there are APITs in scope.

This PR implements a more sophisticated diagnostic where we will suggest turning any APITs in scope into type parameters, and applies this to both the borrowck error note, and to the `impl_trait_overcaptures` migration lint.

cc #132809
2024-11-10 10:09:52 +01:00
Matthias Krüger
94cc01af15
Rollup merge of #132136 - RalfJung:target-feature-abi-compat, r=Mark-Simulacrum
ABI compatibility: remove section on target features

Once https://github.com/rust-lang/rust/pull/127731 lands, we will properly diagnose ABI issues caused by target feature mismatch (at least on tier 1 targets). So I'd say we can remove the corresponding part of the docs here -- this is now something the compiler can take care of, so programmers don't need to be concerned. For now this is just a lint, but that's just a transition period, like in prior cases where we fix I-unsound bugs by adding a new check that goes through the "future incompatibility" stages. We have decided that it's actually a bug that we have ABI risks around target features, and we shouldn't document that bug as-if it was intended behavior.

Cc `@rust-lang/opsem` `@chorman0773` `@veluca93`
2024-11-10 10:09:52 +01:00
Ralf Jung
a01f37c7f4 Merge from rustc 2024-11-10 10:03:57 +01:00
Ralf Jung
686eeb83e9 honor rustc_const_stable_indirect in non-staged_api crate with -Zforce-unstable-if-unmarked 2024-11-10 10:01:27 +01:00
Ralf Jung
ce7a56072b Preparing for merge from rustc 2024-11-10 10:01:05 +01:00
Taiki Endo
965a2801a0 Stabilize Arm64EC inline assembly 2024-11-10 17:43:46 +09:00
bors
668959740f Auto merge of #132831 - workingjubilee:rollup-6fdif44, r=workingjubilee
Rollup of 6 pull requests

Successful merges:

 - #131258 (Stabilize s390x inline assembly)
 - #132801 (interpret: get_alloc_info: also return mutability)
 - #132823 (require const_impl_trait gate for all conditional and trait const calls)
 - #132824 (Update grammar in wasm-c-abi's compiler flag documentation)
 - #132825 (Exclude relnotes-tracking-issue from needs-triage)
 - #132828 (Additional tests to ensure let is rejected during parsing)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-10 05:54:13 +00:00