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 8 pull requests #136905

Merged
merged 22 commits into from
Feb 12, 2025
Merged

Rollup of 8 pull requests #136905

merged 22 commits into from
Feb 12, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 22 commits February 3, 2025 19:51
When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified.

This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible:

```
error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>`
  --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9
   |
LL |     let y = Err(x);
   |         ^   ------ type must be known at this point
   |
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified
   |
LL |     let y: Result<T, _> = Err(x);
   |          ++++++++++++++
```
These currently point to rust-lang#26179, which is nearly a decade
old and has a lot of outdated discussion. Move these features to a new
tracking issue specifically for the recently added API.

New tracking issue: rust-lang#136873
…ler-errors

Document some safety constraints and use more safe wrappers

Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
In "specify type" suggestion, skip type params that are already known

When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified.

This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible:

```
error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>`
  --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9
   |
LL |     let y = Err(x);
   |         ^   ------ type must be known at this point
   |
help: consider giving `y` an explicit type, where the type for type parameter `T` is specified
   |
LL |     let y: Result<T, _> = Err(x);
   |          ++++++++++++++
```

Fix rust-lang#135919.
…=chenyukang

Implement pattern type ffi checks

Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe).

best reviewed commit by commit.
Add a TyPat in the AST to reuse the generic arg lowering logic

This simplifies ast lowering significantly with little cost to the pattern types parser.

Also fixes any problems we've had with generic args (well, pushes any problems onto the `generic_const_exprs` feature gate)

follow-up to rust-lang#136284 (comment)

r? ``@BoxyUwU``
… r=jhpratt

Change the issue number for `likely_unlikely` and `cold_path`

These currently point to rust-lang#26179, which is nearly a decade old and has a lot of outdated discussion. Move these features to a new tracking issue specifically for the recently added API.

New tracking issue: rust-lang#136873
Lower fn items as ZST valtrees and delay a bug

Lower it as a ZST instead of a const error, which we can handle mostly fine. Delay a bug so we don't accidentally support it tho.

r? BoxyUwU

Fixes rust-lang#136855
Fixes rust-lang#136853
Fixes rust-lang#136854
Fixes rust-lang#136337

Only added one test bc that's really the crux of the issue (fn item in array length position).
…=jieyouxu

i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change

As per ``@maurer's`` [comment](rust-lang#136495 (comment)), this shouldn't actually change anything since we anyway add a bunch of extensions that bump things up way beyond Pentium 4. But Pentium 4 is consistent with the other i686 targets and I don't know enough about the exact sequence of CPU generations to be confident with more than this. ;)
…-lt, r=lqd

Check sig for errors before checking for unconstrained anonymous lifetime

Fixes rust-lang#136841
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Feb 12, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 12, 2025

📌 Commit 77a1d6b 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 Feb 12, 2025
@bors
Copy link
Contributor

bors commented Feb 12, 2025

⌛ Testing commit 77a1d6b with merge 33d92df...

@bors
Copy link
Contributor

bors commented Feb 12, 2025

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#135549 Document some safety constraints and use more safe wrappers 24998d5768f66f8cde34a03e3b616fa8edd756c1 (link)
#135965 In "specify type" suggestion, skip type params that are alr… 46e442352ae8caa253169cbb781317cb3449f3d6 (link)
#136193 Implement pattern type ffi checks 550bcbd199edab0d42ccb222981cbd2b2f4d5faa (link)
#136646 Add a TyPat in the AST to reuse the generic arg lowering lo… aad75b172d31bd6fda93e62b60e44aa38e201f09 (link)
#136874 Change the issue number for likely_unlikely and `cold_pat… 3efc29cf84ae7e56608ac9ab6632ff70cf1522f2 (link)
#136884 Lower fn items as ZST valtrees and delay a bug 94f59205e3e48e2c188ba962591fa4ffbf467af9 (link)
#136885 i686-linux-android: increase CPU baseline to Pentium 4 (wit… 6373ac26ff403eac8ce78e85d853d5af78ad9597 (link)
#136891 Check sig for errors before checking for unconstrained anon… f7c7b5b5c46cd943469a0250b22c40397b38e14a (link)

previous master: 672e3aaf28

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 (33d92df): comparison URL.

Overall result: ✅ 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.3%, secondary -1.8%)

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)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
-2.3% [-2.9%, -2.0%] 5
Improvements ✅
(secondary)
-2.6% [-4.1%, -2.1%] 7
All ❌✅ (primary) -2.3% [-2.9%, -2.0%] 5

Cycles

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

Binary size

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

Bootstrap: 788.722s -> 790.14s (0.18%)
Artifact size: 347.63 MiB -> 347.71 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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-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.

9 participants