Commit Graph

270824 Commits

Author SHA1 Message Date
Laurențiu Nicola
c2ffafdc9a
Merge pull request #18482 from regexident/hir_trait_supertraits_accessors
internal: Add public `direct_supertraits(…)` & `all_supertraits(…)` accessor methods to `hir::Trait`
2024-11-11 06:58:17 +00:00
Ralf Jung
2c7f3badcf target_features: explain what exacty 'implied' means here 2024-11-11 07:33:39 +01:00
bors
3a258d1cf9 Auto merge of #132854 - RalfJung:query-key-limit, r=compiler-errors
query/plumbing: adjust comment to reality

The limit for the query key size got changed recently in f51ec110a7 but the comment was not updated.

Though maybe it is time to intern `CanonicalTypeOpAscribeUserTypeGoal` rather than copying it everywhere?

r? `@lcnr`
2024-11-11 05:17:13 +00:00
Henry Jiang
405017ac35 refactor flags 2024-11-10 21:52:18 -05:00
bors
fbcdd728ed Auto merge of #132885 - jhpratt:rollup-4ddd31p, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - #131080 (Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features)
 - #132871 (add regression test for #85763)
 - #132878 (triagebot: Assign rustdoc tests to T-rustdoc.)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-11 02:31:12 +00:00
Jacob Pratt
8253484854
Rollup merge of #132878 - aDotInTheVoid:less-pings-for-mark, r=GuillaumeGomez
triagebot: Assign rustdoc tests to T-rustdoc.

Should avoid situations like #132871, which got assigned to mark (via fallback) despite being a rustdoc change.

For now, I've assigned all our testsuites to the rustdoc group (whoever from T-Rustdoc is on review rotation), except the json one which is assigned to me.

CC `@rust-lang/rustdoc`

r? `@GuillaumeGomez`
2024-11-10 19:12:26 -05:00
Jacob Pratt
5742e2255e
Rollup merge of #132871 - lolbinarycat:rustdoc-heterogeneous-first-paragraph-85763, r=aDotInTheVoid
add regression test for #85763

closes #85763
2024-11-10 19:12:26 -05:00
Jacob Pratt
7c53b5d206
Rollup merge of #131080 - alexcrichton:stabilize-more-wasm-target-features, r=petrochenkov
Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features

For the `multivalue` and `reference-types` features this commit is
similar to https://github.com/rust-lang/rust/pull/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 19:12:25 -05:00
bors
42b2496320 Auto merge of #126597 - estebank:unicode-output, r=fmease
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.

In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in.

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
  |   ^^^^^^^^
```

After:

![rustc output with unicode box drawing characters](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25)

Before:
![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-11 00:00:58 +00:00
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
Laiho
3855cb8048 vectorize slice::is_sorted 2024-11-11 00:23:51 +02: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