Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #136041

Merged
merged 19 commits into from
Jan 25, 2025
Merged

Rollup of 9 pull requests #136041

merged 19 commits into from
Jan 25, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 19 commits January 24, 2025 04:07
The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`
This also suppresses an irrelevant warning, to avoid having to re-bless the
output snapshot.
Replace `pthread_set_name_np` with `pthread_setname_np` for NuttX in the `set_name` function,
this change aligns the implementation with the correct API available on NuttX

This patch ensures thread naming works correctly on NuttX platforms.

Signed-off-by: Huang Qi <[email protected]>
```
error[E0382]: use of moved value: `x`
  --> bay.rs:14:14
   |
12 | fn foo(x: D) {
   |        - move occurs because `x` has type `(((..., ..., ..., ...), ..., ..., ...), ..., ..., ...)`, which does not implement the `Copy` trait
13 |     let _a = x;
   |              - value moved here
14 |     let _b = x; //~ ERROR use of moved value
   |              ^ value used here after move
   |
   = note: the full type name has been written to 'bay.long-type-14349227078439097973.txt'
   = note: consider using `--verbose` to print the full type name to the console
help: consider cloning the value if the performance cost is acceptable
   |
13 |     let _a = x.clone();
   |               ++++++++
```
Do not suggest

```
help: use parentheses to call these
  |
5 |     (callback: Rc<dyn Fn()>)(),
  |     +                      +++
```

Skip all "call function for this binop" suggestions when in a derive context.

Fix rust-lang#135989.
When doing optimized build through opt-dist,
I've often run into errors like `invalid type: null, expected f64`.
This is likely because some f64 fields might actually bet set null.
Unfortunately, serde_json doesn't handle null <-> NaN well.

This commit addresses it by having a custom deserialize method, so
null is always be deserialized to `f64:NAN`.

See:

* https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/opt-dist.3A.20.60invalid.20type.3A.20null.2C.20expect.20f64.60.20failure
* serde-rs/json#202
…=fmease

Properly report error when object type param default references self

I accidentally broke this error for cases where a type parameter references `Self` via a projection (i.e. `trait Foo<Arg = Self::Bar> {}`). This PR fixes that, and also makes the error a bit easier to understand.

Fixes rust-lang#135918
Fix `FormattingOptions` instantiation with `Default`

The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`.

Note that `FormattingOptions` is being released as part of 1.85 (unstable) - so this might warrant a backport to that branch.

Tracking issue: rust-lang#118117

Follow up from rust-lang#118159

CC: ``@EliasHolzmann`` ``@programmerjake``

r? ``@m-ou-se``
Rename test to `unresolvable-upvar-issue-87987.rs` and add some notes

Extracted from rust-lang#135756. I had to figure out what this test was trying to test, so I might as well write it down for future reference.
Fix set_name in thread mod for NuttX

Replace `pthread_set_name_np` with `pthread_setname_np` for NuttX in the `set_name` function, this change aligns the implementation with the correct API available on NuttX

This patch ensures thread naming works correctly on NuttX platforms.

See also:
https://github.com/rust-lang/libc/blob/0f9f8c91adb0365c0d13b34ec27ac8019818cf1f/src/unix/nuttx/mod.rs#L562
https://github.com/apache/nuttx/blob/8f3a2a6f7645dd95b6a7608b9cde3cb693b118c2/include/pthread.h#L511-L514
bootstrap: Handle bootstrap lockfile race condition better

Fixes rust-lang#135972

Tested by:
- Starting one build
- In another terminal, `echo -n '' > build/lock`
- Attempt to invoke bootstrap a second time
Use short ty string for move errors

```
error[E0382]: use of moved value: `x`
  --> bay.rs:14:14
   |
12 | fn foo(x: D) {
   |        - move occurs because `x` has type `(((..., ..., ..., ...), ..., ..., ...), ..., ..., ...)`, which does not implement the `Copy` trait
13 |     let _a = x;
   |              - value moved here
14 |     let _b = x; //~ ERROR use of moved value
   |              ^ value used here after move
   |
   = note: the full type name has been written to 'bay.long-type-14349227078439097973.txt'
   = note: consider using `--verbose` to print the full type name to the console
help: consider cloning the value if the performance cost is acceptable
   |
13 |     let _a = x.clone();
   |               ++++++++
```

Address 4th case in rust-lang#135919.
…errors

Skip suggestions in `derive`d code

Do not suggest

```
help: use parentheses to call these
  |
5 |     (callback: Rc<dyn Fn()>)(),
  |     +                      +++
```

Skip all "call function for this binop" suggestions when in a derive context.

Fix rust-lang#135989.
Bootstrap: Don't move ownership of job object

I've been thinking about this since the last time I looked at bootstrap's use of job objects. We currently pass ownership of the job object to Python. I feel this is unneeded complexity.

The rationale given (in a comment) is that it helps with `ctrl-c` on `x.py`. But using `ctrl-c` when running `x.py` will also cause `bootstrap.exe` to immediately exit so I don't find that convincing.
…ler-errors

fix(bootstrap): deserialize null as `f64::NAN`

When doing optimized build through opt-dist,
I've often run into errors like `invalid type: null, expected f64`.
This is likely because some f64 fields might actually bet set null.
Unfortunately, serde_json doesn't handle null <-> NaN well.

This commit addresses it by having a custom deserialize method, so null is always be deserialized to `f64:NAN`.

See:

* https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/opt-dist.3A.20.60invalid.20type.3A.20null.2C.20expect.20f64.60.20failure
* serde-rs/json#202

r? `@Kobzol`
@rustbot rustbot added A-tidy Area: The tidy tool O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 25, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jan 25, 2025

📌 Commit a330c7e has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2025
@matthiaskrgr
Copy link
Member Author

@bors p=5

@bors
Copy link
Contributor

bors commented Jan 25, 2025

⌛ Testing commit a330c7e with merge f940188...

@bors
Copy link
Contributor

bors commented Jan 25, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing f940188 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 25, 2025
@bors bors merged commit f940188 into rust-lang:master Jan 25, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 25, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135971 Properly report error when object type param default refere… 342bcb15207445b4e26db2bc5310f8bd9bf8bc87 (link)
#135977 Fix FormattingOptions instantiation with Default 7262ee6e87f98b2bf9bd051e20419090ee44dfcb (link)
#135985 Rename test to unresolvable-upvar-issue-87987.rs and add … f25de184529b00281931551e24b765e6923c6c2a (link)
#135991 Fix set_name in thread mod for NuttX 8365f5c99cc4c2e253d95c9c475eab766f2aa624 (link)
#136009 bootstrap: Handle bootstrap lockfile race condition better 04db663130f9067995f46e9922dd1c7aa6035818 (link)
#136018 Use short ty string for move errors 44540d8646b40fb22f291ec52b4621269d52adad (link)
#136027 Skip suggestions in derived code d0f89085471838aa85cb5a8740e6416605965e57 (link)
#136029 Bootstrap: Don't move ownership of job object 50a054157dd145d47861a26094dbf8a12fb2cb55 (link)
#136034 fix(bootstrap): deserialize null as f64::NAN 5954621cfcd9d4ba515e0c84a3b42a8190a779c9 (link)

previous master: 6365178a6b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f940188): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.8%, secondary 3.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [2.6%, 3.4%] 3
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Cycles

Results (primary -1.3%, secondary -1.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.3% [-1.6%, -1.1%] 2
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) -1.3% [-1.6%, -1.1%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 771.261s -> 771.063s (-0.03%)
Artifact size: 325.82 MiB -> 325.77 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.