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 #137284

Merged
merged 25 commits into from
Feb 19, 2025
Merged

Rollup of 9 pull requests #137284

merged 25 commits into from
Feb 19, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

DaniPopes and others added 25 commits January 1, 2025 15:25
Const-stabilizes `slice::as_flattened{,_mut}`:
```rust
// core::slice
impl<T, const N: usize> [[T; N]] {
    pub const fn as_flattened(&self) -> &[T];
    pub const fn as_flattened_mut(&mut self) -> &mut [T];
}
```

Tracking issue: rust-lang#95629

Requires separate libs-api FCP, as per rust-lang#95629 (comment).

Closes rust-lang#95629.
* Order IDEs alphabetically so that manually searching for an IDE
  is easier, both when running `./x setup` and when editing the
  source code behind `./x setup`
* Prepare for IDEs with spaces in their names
* Allow explicitly typing 'none' for the IDE
* Change capitalization of `Vscode` to the more standard `VsCode`
* Make minor efficiency improvements
* Add `'static` annotations where they apply
Unless `try_trait_v2` is enabled, don't mention that `FromResidual` isn't implemented for a specific type when the implicit `From` conversion of a `?` fails. For the end user on stable, `?` might as well be a compiler intrinsic, so we remove that note to avoid further confusion and allowing other parts of the error to be more prominent.

```
error[E0277]: `?` couldn't convert the error to `u8`
  --> $DIR/bad-interconversion.rs:4:20
   |
LL | fn result_to_result() -> Result<u64, u8> {
   |                          --------------- expected `u8` because of this
LL |     Ok(Err(123_i32)?)
   |        ------------^ the trait `From<i32>` is not implemented for `u8`
   |        |
   |        this can't be annotated with `?` because it has type `Result<_, i32>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             `u8` implements `From<Char>`
             `u8` implements `From<bool>`
```
It turns out that this visitor doesn't actually need `nested_filter::All` to
handle nested items; it just needs to override `visit_nested_item` and look up
the item's span.
Co-authored-by: Amanieu d'Antras <[email protected]>
Added project-specific Zed IDE settings

This repository currently has project-specific VS Code IDE settings in `.vscode` and `compiler/rustc_codegen_cranelift/.vscode`. Now there are equivalent project-specific Zed IDE settings alongside those.

This fixes `rust-analyzer` not being able to properly handle this project.

Note that:

1. The contents of `src/tools/rust-analyzer/.vscode` could not be translated to Zed, as they aren't basic IDE settings.
2. One of the VS Code settings in `.vscode` has no corresponding setting in Zed, and so this has been noted like this:

    ```json
      "_settings_only_in_vs_code_not_yet_in_zed": {
        "git.detectSubmodulesLimit": 20
      },
    ```
…en, r=Amanieu

Stabilize const_slice_flatten

Const-stabilizes `slice::as_flattened{,_mut}`:
```rust
// core::slice
impl<T, const N: usize> [[T; N]] {
    pub const fn as_flattened(&self) -> &[T];
    pub const fn as_flattened_mut(&mut self) -> &mut [T];
}
```

Tracking issue: rust-lang#95629

Requires separate FCP, as per rust-lang#95629 (comment).

Closes rust-lang#95629.

`````@rustbot````` modify labels: +T-libs-api

Happy new year!
Improve instant docs

This should be enough to close rust-lang#79881.
Add a bullet point to `std::fs::copy`

I needed to copy a file but I got the following error:
```
Os { code: 2, kind: NotFound, message: "No such file or directory" }
```
After read the documentation, I though the error was generated by the `from` parameter, forgetting the `to` part. Anyway, I got the error because the parent folder of `to` didn't exist.
Even if the documentation explicitly saying `but is not limited to just these cases`, I would like to add this case because I spent 3 hours around it.

This PR just wants to put a mention about it.
…r=tgross35

x86_win64 ABI: do not use xmm0 with softfloat ABI

This adjusts rust-lang#134290 to not apply the new logic to targets marked as "softfloat". That fixes most instances of the issue brought up [here](rust-lang#116558 (comment)).

r? `@tgross35`
…er-errors

docs(dev): Update the feature-gate instructions

`features_untracked` was removed in rust-lang#114723

features are now functions as of  rust-lang#132027
…rochenkov

Don't mention `FromResidual` on bad `?`

Unless `try_trait_v2` is enabled, don't mention that `FromResidual` isn't implemented for a specific type when the implicit `From` conversion of a `?` fails. For the end user on stable, `?` might as well be a compiler intrinsic, so we remove that note to avoid further confusion and allowing other parts of the error to be more prominent.

```
error[E0277]: `?` couldn't convert the error to `u8`
  --> $DIR/bad-interconversion.rs:4:20
   |
LL | fn result_to_result() -> Result<u64, u8> {
   |                          --------------- expected `u8` because of this
LL |     Ok(Err(123_i32)?)
   |        ------------^ the trait `From<i32>` is not implemented for `u8`
   |        |
   |        this can't be annotated with `?` because it has type `Result<_, i32>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             `u8` implements `From<Char>`
             `u8` implements `From<bool>`
```
coverage: Get hole spans from nested items without fully visiting them

This is a small simplification to the code that collects the spans of nested items within a function, so that those spans can be treated as “holes” to be avoided by the current function's coverage mappings.

The old code was using `nested_filter::All` to ensure that the visitor would see nested items. But we don't need the actual items themselves; we just need their spans, which we can obtain via a custom implementation of `visit_nested_item`.

This avoids the more expansive queries required by `nested_filter::All`.
@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide 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. labels Feb 19, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Feb 19, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 19, 2025

📌 Commit 3fc6dfd 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 19, 2025
@bors
Copy link
Contributor

bors commented Feb 19, 2025

⌛ Testing commit 3fc6dfd with merge f280acf...

@bors
Copy link
Contributor

bors commented Feb 19, 2025

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#127793 Added project-specific Zed IDE settings e88cb37f205373e7b5e8c2d87583226e90f5b399 (link)
#134995 Stabilize const_slice_flatten ad1716ba21256d37e17a3899cfeddaffb14c3da2 (link)
#136301 Improve instant docs 389b7a9e83bcd5289193adb11131058769284fde (link)
#136347 Add a bullet point to std::fs::copy 570a435fdaeafa094de296a6f1a09ab8076a2a13 (link)
#136794 Stabilize file_lock 45d5e0e3478a5ac3bdd95d454e537cc76c5dec10 (link)
#137094 x86_win64 ABI: do not use xmm0 with softfloat ABI 158166a4894092a1cad494d30fc5856d61b1b48a (link)
#137227 docs(dev): Update the feature-gate instructions b9d4044b52c793ceb70243380ee9b7b7347e00f5 (link)
#137232 Don't mention FromResidual on bad ? daed1431c6d881889af655e7b193336d64f027d7 (link)
#137251 coverage: Get hole spans from nested items without fully vi… 7191e0409a769bf328149665c51f196147a3a16d (link)

previous master: ed49386d3a

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

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (primary -4.1%)

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)
-4.1% [-5.7%, -1.9%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.1% [-5.7%, -1.9%] 6

Binary size

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

Bootstrap: 773.063s -> 774.416s (0.18%)
Artifact size: 362.34 MiB -> 362.35 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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-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.