Commit Graph

260949 Commits

Author SHA1 Message Date
Esteban Küber
67ec1326ee Fix ICE in suggestion caused by being recovered as ==
The second suggestion shown here would previously incorrectly assume that the span corresponding to `⩵` was 2 bytes wide composed by 2 1 byte wide chars, so a span pointing at `==` could point only at one of the `=` to remove it. Instead, we now replace the whole thing (as we should have the whole time):

```
error: unknown start of token: \u{2a75}
  --> $DIR/unicode-double-equals-recovery.rs:1:16
   |
LL | const A: usize ⩵ 2;
   |                ^
   |
help: Unicode character '⩵' (Two Consecutive Equals Signs) looks like '==' (Double Equals Sign), but it is not
   |
LL | const A: usize == 2;
   |                ~~

error: unexpected `==`
  --> $DIR/unicode-double-equals-recovery.rs:1:16
   |
LL | const A: usize ⩵ 2;
   |                ^
   |
help: try using `=` instead
   |
LL | const A: usize = 2;
   |                ~
```
2024-07-18 17:47:31 +00:00
bors
e35364a521 Auto merge of #127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #125042 (Use ordinal number in argument error)
 - #127229 (rustdoc: click target for sidebar items flush left)
 - #127337 (Move a few intrinsics to Rust abi)
 - #127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`)
 - #127579 (Solve a error `.clone()` suggestion when moving a mutable reference)
 - #127769 (Don't use implicit features in `Cargo.toml` in `compiler/`)
 - #127844 (Remove invalid further restricting suggestion for type bound)
 - #127855 (Add myself to review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-17 21:52:29 +00:00
bors
fcc325f1bc Auto merge of #125942 - timokroeger:windows-once-futex, r=ChrisDenton
Windows: Use futex implementation for `Once`

Keep the queue implementation for win7.
Inspired by PR #121956

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
2024-07-17 19:28:24 +00:00
bors
f00f850919 Auto merge of #127760 - jieyouxu:rmake-support-reorganize, r=Kobzol
Reorganize the `run-make-support` library

The `run_make_support` library has a kitchen sink `lib.rs` that make discovery/learning very difficult. Let's try to improve that by breaking up `lib.rs` into smaller more organized modules. This is a precursor to improving the documentation and learnability of the `run_make_support` library.

### Changes

- Breakup `lib.rs` into smaller modules according to functionality
- Rename `recursive_diff` -> `assert_dirs_are_equal`
- Rename one of the `read_dir` with callback interface as `read_dir_entries`
- Coalesced fs-related stuff onto a `fs` module, re-exported to tests as `rfs`
- Minor doc improvements / fixes in a few places (I have a follow-up documentation PR planned)

This PR is best reviewed commit-by-commit.

r? `@Kobzol` (or Mark, or T-compiler or T-bootstrap)

try-job: x86_64-msvc
try-job: aarch64-apple
try-job: test-various
try-job: armhf-gnu
try-job: dist-x86_64-linux
2024-07-17 15:52:03 +00:00
Matthias Krüger
2ea21cfd42
Rollup merge of #127855 - chenyukang:yukang-add-triagebot, r=jieyouxu
Add myself to review rotation

r? `@wesleywiser`
2024-07-17 16:22:33 +02:00
Matthias Krüger
1e1e64f10f
Rollup merge of #127844 - chenyukang:yukang-fix-type-bound-127555, r=jieyouxu
Remove invalid further restricting suggestion for type bound

This PR partially addresses #127555, it will remove the obvious error suggestion:

```console
   |                      ^^^^ required by this bound in `<Baz as Foo>::bar`
help: consider further restricting this bound
   |
12 |         F: FnMut() + Send + std::marker::Send,
   |                           +++++++++++++++++++
```

I may create another PR to get a better diagnostic for `impl has stricter requirements than trait` scenario.
2024-07-17 16:22:32 +02:00
Matthias Krüger
9db57bf0c9
Rollup merge of #127769 - compiler-errors:ed-2024-dep, r=oli-obk
Don't use implicit features in `Cargo.toml` in `compiler/`

Fixes compiler crates to stop using implicit features (https://github.com/rust-lang/cargo/issues/12826) which are denied in in edition 2024.
2024-07-17 16:22:31 +02:00
Matthias Krüger
23dd3a099c
Rollup merge of #127579 - surechen:fix_127285, r=lcnr
Solve a error `.clone()` suggestion when moving a mutable reference

If the moved value is a mut reference, it is used in a generic function and it's type is a generic param, suggest it can be reborrowed to avoid moving.

for example:

```rust
struct Y(u32);
// x's type is '& mut Y' and it is used in `fn generic<T>(x: T) {}`.
fn generic<T>(x: T) {}
```

fixes #127285
2024-07-17 16:22:29 +02:00
Matthias Krüger
c98487e3be
Rollup merge of #127472 - Zalathar:block-and-unit, r=fmease
MIR building: Stop using `unpack!` for `BlockAnd<()>`

This is a subset of #127416, containing only the parts related to `BlockAnd<()>`.

The first patch removes the non-assigning form of the `unpack!` macro, because it is frustratingly inconsistent with the main form. We can replace it with an ordinary method that discards the `()` and returns the block.

The second patch then finds all of the remaining code that was using `unpack!` with `BlockAnd<()>`, and updates it to use that new method instead.

---

Changes since original review of #127416:
- Renamed `fn unpack_block` → `fn into_block`
- Removed `fn unpack_discard`, replacing it with `let _: BlockAnd<()> = ...` (2 occurrences)
- Tweaked `arm_end_blocks` to unpack earlier and build `Vec<BasicBlock>` instead of `Vec<BlockAnd<()>>`
2024-07-17 16:22:28 +02:00
Matthias Krüger
3ddfd97198
Rollup merge of #127337 - celinval:intrinsics-fallback, r=oli-obk
Move a few intrinsics to Rust abi

Move a few more intrinsic functions to the convention added in #121192. In the second commit, I added documentation about their safety requirements. Let me know if you would like me to move the second commit to a different PR.

Note: I kept the same signature of `pref_align_of`, but I was wondering why this function is considered unsafe?
2024-07-17 16:22:28 +02:00
Matthias Krüger
0472b2a09f
Rollup merge of #127229 - notriddle:notriddle/mile-wide-bar, r=GuillaumeGomez
rustdoc: click target for sidebar items flush left

This change adjusts the clickable area of sidebar links to touch the leftmost edge of the canvas, making them [much easier](https://www.nngroup.com/articles/fitts-law/) to click (when the browser window is maximized or tiled left, but those cases are common enough to matter).

[Screencast from 2024-07-15 15-31-07.webm](https://github.com/user-attachments/assets/1e952d3a-e9e7-476b-b211-44a17c190b38)

<details><summary>old screencast</summary>

[Screencast from 2024-07-01 17-23-34.webm](https://github.com/rust-lang/rust/assets/1593513/dc6f9c2e-5904-403d-b353-d233e6e1afbc)

</details>
2024-07-17 16:22:26 +02:00
Matthias Krüger
2b34490da6
Rollup merge of #125042 - long-long-float:suggest-move-arg-outside, r=fmease
Use ordinal number in argument error

Add an ordinal number to two argument errors ("unexpected" and "missing") for ease of understanding error.

```
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
  --> test.rs:11:5
   |
11 |     f(42, 'a');
   |     ^     --- 2nd argument of type `f32` is missing
   |
(snip)

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> test.rs:12:5
   |
12 |     f(42, 42, 1.0, 'a');
   |     ^   ----
   |         | |
   |         | unexpected 2nd argument of type `{integer}`
   |         help: remove the extra argument
```

To get an ordinal number, I copied `ordinalize` from other crate `rustc_resolve` because I think it is too much to link `rustc_resolve` for this small function. Please let me know if there is a better way.
2024-07-17 16:22:26 +02:00
许杰友 Jieyou Xu (Joe)
d69cc1ccbf tests: update for rfs rename 2024-07-17 13:34:18 +00:00
许杰友 Jieyou Xu (Joe)
1f1bf4c71b run_make_support: use fs internally, but rfs to tests 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
a00b860bfc tests: update rustdoc test for renamed assert_dirs_are_equal 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
30bdc4a309 run_make_support: rename assert_recursive_eq to assert_dirs_are_equal 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
57a2f76557 run_make_support: moved some helpers into string module 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
0dfecb3855 run_make_support: move some helpers from assertion to path 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
636be91cc0 tests: update for renamed fs module in run_make_support 2024-07-17 13:32:29 +00:00
许杰友 Jieyou Xu (Joe)
e1569fde3e run_make_support: coalesce fs helpers into single fs module
There were *two* `read_dir` helpers, one being a simple
`std::fs::read_dir` wrapper, the other has a different callback-based
signature. We also rename the callback-based `read_dir` as
`read_dir_entries`.

Also don't top-level re-export most `fs::*` helpers.
2024-07-17 13:32:28 +00:00
bors
08cdc2fa1a Auto merge of #127851 - tgross35:rollup-i39um74, r=tgross35
Rollup of 4 pull requests

Successful merges:

 - #127763 (Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`)
 - #127813 (Prevent double reference in generic futex)
 - #127847 (Reviewer on vacation)
 - #127850 (bootstrap: open `llvm-config` as r+w)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-17 13:20:54 +00:00
许杰友 Jieyou Xu (Joe)
13a1751061 run_make_support: rename cygpath_windows to get_windows_path and move under external_deps as private 2024-07-17 12:48:23 +00:00
许杰友 Jieyou Xu (Joe)
a443dc4ecd run_make_support: rename env_checked -> env 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
b7f7205212 run_make_support: move build_native_static_lib under external_deps
And fix some `ar`-related rebase mishaps.
2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
aadd08576d run_make_support: make set_host_rpath private and move into util 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
e956808c6c run_make_support: move handle_failed_output into util module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
88fd1df017 run_make_support: move assert_recursive_eq into assertion_helpers 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
56cbfa8749 tests: update rustdoc test for renamed assert_recursive_eq 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
230804dc3a run_make_support: rename recursive_diff to assert_recursive_eq 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
f66d3d33e4 run_make_support: move assertions and helpers into own module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
66cef19d11 run_make_support: move run_in_tmpdir and test_while_readonly to scoped_run module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
17212abd1a run_make_support: move fs helpers to own module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
dc9531533c run_make_support: move path-related helpers into own module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
483328d401 run_make_support: move artifact name helpers into artifact_names module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
439c6f60c7 run_make_support: move ar into own module 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
f042e72d1e run_make_support: cleanup and document some lib.rs reexports 2024-07-17 12:48:22 +00:00
许杰友 Jieyou Xu (Joe)
288c572745 run_make_support: move external deps to external_deps module 2024-07-17 12:48:21 +00:00
许杰友 Jieyou Xu (Joe)
a02008edac run_make_support: move env_var{,_os} into env_checked module 2024-07-17 12:48:21 +00:00
许杰友 Jieyou Xu (Joe)
544dda3828 run_make_support: move target checks into targets module 2024-07-17 12:48:21 +00:00
许杰友 Jieyou Xu (Joe)
427cf94106 run_make_support: move impl_common_helpers into own macros module 2024-07-17 12:48:21 +00:00
yukang
2c2ef6ce9d add chenyukang to review rotation 2024-07-17 19:12:05 +08:00
yukang
40e07a3ab1 Remove invalid further restricting for type bound 2024-07-17 19:08:37 +08:00
bors
3de0a7c716 Auto merge of #127602 - onur-ozkan:calling-order, r=Kobzol
maintain the given order on step execution

Previously step execution disregarded the CLI order and this change executes the given steps in the order specified on CLI.

For example, running `x $kind a b c` will execute `$kind` step for `a`, then `b`, then `c` crates in the specified order.

Fixes #126165
cc `@matthiaskrgr`
2024-07-17 10:57:17 +00:00
onur-ozkan
4ad753af91 maintain the given order on step execution
Previously step execution disregarded the CLI order and this change executes the given
steps in the order specified on CLI.

For example, running `x $kind a b c` will execute `$kind` step for `a`, then `b`, then `c` crates
in the specified order.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-17 12:37:36 +03:00
Trevor Gross
f99f61b272
Rollup merge of #127850 - jieyouxu:bootstrap-llvm-config, r=onur-ozkan
bootstrap: open `llvm-config` as r+w

This previously failed on Windows and prevented building on Windows for compiler stuff because the `llvm-config` file was open as read-only.

Tested locally on a Windows machine.

Fixes #127849.
2024-07-17 04:06:01 -05:00
Trevor Gross
5d7466efb8
Rollup merge of #127847 - ChrisDenton:vacation, r=jhpratt
Reviewer on vacation

``@jhpratt`` asked to be set as on vacation
2024-07-17 04:06:00 -05:00
Trevor Gross
599d32414b
Rollup merge of #127813 - ChrisDenton:win-futex, r=joboet
Prevent double reference in generic futex

In the Windows futex implementation we were a little lax at allowing references to references (i.e. `&&`) which can lead to deadlocks due to reading the wrong memory address. This uses a trait to tighten the constraints and ensure this doesn't happen.

r? libs
2024-07-17 04:05:59 -05:00
Trevor Gross
56f95559da
Rollup merge of #127763 - ChrisDenton:safe-unsafe-unsafe, r=tgross35
Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`

As part of #127747, I've evaluated some more Windows functions and added `unsafe` blocks where necessary. Some are just trivial wrappers that "inherit" the full unsafety of their function, but for others I've added some safety comments. A few functions weren't actually unsafe at all. I think they were just using `unsafe fn` to avoid an `unsafe {}` block.

I'm not touching `c.rs` yet because that is partially being addressed by another PR and also I have plans to further reduce the number of wrapper functions we have in there.

r? libs
2024-07-17 04:05:59 -05:00
许杰友 Jieyou Xu (Joe)
3bee50736d bootstrap: open llvm_config as r+w
This previously failed on Windows because the `llvm_config` file was
open as read-only.
2024-07-17 17:00:06 +08:00
Chris Denton
a216a34ef3
jhpratt on vacation 2024-07-17 07:53:02 +00:00