Skip to content

[pull] master from rust-lang:master #12

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

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 27, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Zalathar and others added 24 commits May 6, 2025 11:58
Fix `-Zremap-path-scope` rmeta handling

This PR fixes the conditional remapping (`-Zremap-path-scope`) of rmeta file paths ~~by using the `debuginfo` scope~~ by conditionally embedding the local path in addition to the remapped path.

Fixes #139217
Consistent trait bounds for ExtractIf Debug impls

Closes #137654. Refer to that issue for a table of the **4** different impl signatures we previously had in the standard library for Debug impls of various ExtractIf iterator types.

The one we are standardizing on is the one so far only used by `alloc::collections::linked_list::ExtractIf`, which is _no_ `F: Debug` bound, _no_ `F: FnMut` bound, only `T: Debug` bound.

This PR applies the following signature changes:

```diff
/* alloc::collections::btree_map */

    pub struct ExtractIf<'a, K, V, F, A = Global>
    where
-       F: 'a + FnMut(&K, &mut V) -> bool,
        Allocator + Clone,

    impl Debug for ExtractIf<'a, K, V, F,
+       A,
    >
    where
        K: Debug,
        V: Debug,
-       F: FnMut(&K, &mut V) -> bool,
+       A: Allocator + Clone,
```

```diff
/* alloc::collections::btree_set */

    pub struct ExtractIf<'a, T, F, A = Global>
    where
-       T: 'a,
-       F: 'a + FnMut(&T) -> bool,
        Allocator + Clone,

    impl Debug for ExtractIf<'a, T, F, A>
    where
        T: Debug,
-       F: FnMut(&T) -> bool,
        A: Allocator + Clone,
```

```diff
/* alloc::collections::linked_list */

    impl Debug for ExtractIf<'a, T, F,
+       A,
    >
    where
        T: Debug,
+       A: Allocator,
```

```diff
/* alloc::vec */

    impl Debug for ExtractIf<'a, T, F, A>
    where
        T: Debug,
-       F: Debug,
        A: Allocator,
-       A: Debug,
```

```diff
/* std::collections::hash_map */

    pub struct ExtractIf<'a, K, V, F>
    where
-       F: FnMut(&K, &mut V) -> bool,

    impl Debug for ExtractIf<'a, K, V, F>
    where
+       K: Debug,
+       V: Debug,
-       F: FnMut(&K, &mut V) -> bool,
```

```diff
/* std::collections::hash_set */

    pub struct ExtractIf<'a, T, F>
    where
-       F: FnMut(&T) -> bool,

    impl Debug for ExtractIf<'a, T, F>
    where
+       T: Debug,
-       F: FnMut(&T) -> bool,
```

I have made the following changes to bring these types into better alignment with one another.

- Delete `F: Debug` bounds. These are especially problematic because Rust closures do not come with a Debug impl, rendering the impl useless.

- Delete `A: Debug` bounds. Allocator parameters are unstable for now, but in the future this would become an API commitment that we do not debug-print a representation of the allocator when printing an iterator.

- Delete `F: FnMut` bounds. Requires `hashbrown` PR: rust-lang/hashbrown#616. **API commitment:** we commit to not doing RefCell voodoo inside ExtractIf to have some way for its Debug impl (which takes &amp;self) to call a FnMut closure, if this is even possible.

- Add `T: Debug` bounds (or `K`/`V`), even on Debug impls that do not currently make use of them, but might in the future. **Breaking change.** Must backport into Rust 1.87 (current beta) or do a de-stabilization PR in beta to delay those types by one release.

- Render using `debug_struct` + `finish_non_exhaustive`, instead of `debug_tuple`.

- Do not render the _entire_ underlying collection.

- Show a "peek" field indicating the current position of the iterator.
…bilee

Implement `Iterator::last` for `vec::IntoIter`

Avoid iterating everything when we have random access to the last element.
…ouxu,wesleywiser

Implement RFC 3503: frontmatters

Tracking issue: #136889

Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md).

This might break rust-analyzer. Will look into how to fix that.

Suggestions welcome for how to improve diagnostics.
coverage-dump: Resolve global file IDs to filenames

The coverage-dump tool, used by coverage tests, currently includes “global file ID” numbers in its dump output.

This PR adds support for parsing coverage filename information from LLVM assembly `.ll` files, and resolving those file IDs to the corresponding filename, for inclusion in dump output.

This makes dump output more informative, especially for test cases involving multiple files, and will be important for testing expansion region support in the future.

---

The bootstrap changes don't necessarily have to land at the same time (e.g. they could be deferred to after the stage0 redesign if requested), but I would prefer to land them now if possible.
std: get rid of `sys_common::process`

Move the public `CommandEnvs` into the `process` module (and make it a wrapper type for an internal iterator type) and everything else into `sys::process` as per #117276.

Something went wrong with a force push, so I can't reopen #139020. This is unchanged from that PR, apart from a rebase.

r? ```@thomcc```
Fix RustAnalyzer discovery of rustc's `stable_mir` crate

This fixes issues with RustAnalyzer not finding `stable_mir` crate since RA discovery traverses the dependency graph of `rustc_driver` crate.

This change also aligns with the long term architecture plan for these crates, since we are moving towards having stable_mir depend on rustc_smir and not the other way around. See [this doc](https://hackmd.io/jBRkZLqAQL2EVgwIIeNMHg) for more details.

I believe a similar function will come handy eventually for `stable_mir` users, but I'm keeping it as part of `rustc_internal` since its current format initializes the StableMir context and requires `TyCtxt`.

Finally, I added the `rustc_internal` module re-export under a feature since the APIs from this module shall not be stabilized.
Steer docs to `utf8_chunks` and `Iterator::take`

- Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-));
- Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks).

``@rustbot`` label +A-docs
Use more accurate ELF flags on MIPS

Changes the MIPS ELF flags used for metadata objects to be closer to what LLVM uses so the linker doesn't complain
…ddle

Clean rustdoc tests folder

We were starting to have way too many tests in the `tests/rustdoc/` folder so I moved some of them in sub-folders. We now have less than 300 tests at the "top level" so I guess it's good enough for now.

So this PR just moves tests in sub-folders and that's pretty much it. 😃

r? ``@notriddle``
… r=lcnr

Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis

See the writeup in `tests/ui/closures/opaque-upvar.rs`.

TL;DR is that this has to do with the fact that the recursive revealing uses, which have not yet been constrained from the defining use by the time that closure upvar inference is performed, remain as infer vars during upvar analysis. We don't really care, though, since anywhere we structurally match on a type in upvar analysis, we already call `structurally_resolve_type` right before `.kind()`, which would emit a true ambiguity error.

Fixes rust-lang/trait-system-refactor-initiative#197

r? lcnr
Update mdbook to 0.4.49

This is a routine update to pull in some fixes and updates.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0449
Rollup of 12 pull requests

Successful merges:

 - #139550 (Fix `-Zremap-path-scope` rmeta handling)
 - #139764 (Consistent trait bounds for ExtractIf Debug impls)
 - #139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - #140035 (Implement RFC 3503: frontmatters)
 - #140251 (coverage-dump: Resolve global file IDs to filenames)
 - #140393 (std: get rid of `sys_common::process`)
 - #140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - #140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - #140634 (Use more accurate ELF flags on MIPS)
 - #140673 (Clean rustdoc tests folder)
 - #140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - #140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
And also:

- Document test intent.
- Move under `link-native-libs/` instead.
Do not gather local all together at the beginning of typeck

r? lcnr
This also removes some manipulation of the function signature span that only
made sense in the context of merging non-adjacent spans.
Because we no longer merge non-adjacent spans, there is no need to use buckets
to prevent merging across hole spans.
Update examples to no longer avoid iterating arrays for #84513
Unify sidebar buttons to use the same image

Part of #139832.

The source sidebar looks like this with the new image:

![image](https://github.com/user-attachments/assets/df4fee52-fb71-4794-91b7-3afc6d2aab70)

You can test it [here](https://rustdoc.crud.net/imperio/sidebar-images/src/foo/foo.rs.html).

r? `@notriddle`
oyvindln and others added 30 commits May 10, 2025 18:35
Rollup of 7 pull requests

Successful merges:

 - #129334 (Implement (part of) ACP 429: add `DerefMut` to `Lazy[Cell/Lock]`)
 - #139562 (rustdoc: add a handle that makes sidebar resizing more obvious)
 - #140151 (remove intrinsics::drop_in_place)
 - #140660 (remove 'unordered' atomic intrinsics)
 - #140783 (Update documentation of OnceLock::get_or_init.)
 - #140789 (Update hermit-abi to 0.5.1)
 - #140879 (1.87.0 release notes: remove nonsensical `~` operator)

r? `@ghost`
`@rustbot` modify labels: rollup
Fix download of GCC from CI on non-nightly channels

Fixes the download failure on beta (#140897 (comment)).

r? `@onur-ozkan`
…m,traviscross,tgross35

Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
…r=petrochenkov

Prefer to suggest stable candidates rather than unstable ones

Fixes #140240

The logic is to replace unstable suggestions if we meet a new stable one, and do nothing if any other situation. In old logic, we just use the first candidate we meet as the suggestion for the same items.

E.g., `std::range::legacy::Range` vs `std::ops::Range`, `legacy` in the former is unstable, we prefer to suggest use the latter.
Make t letter looks like lowercase rather than uppercase

randomly noticed that, took opportunity to fix :D
it was looks like "RusT" now fixed to "Rust"
r? `@jieyouxu`
before
<img src="https://github.com/user-attachments/assets/1ff19891-2e7b-4633-897d-2b2635aff9c6" width="65%" />
now
<img src="https://github.com/user-attachments/assets/d577a2af-6755-411b-8050-2556f0f12e75" width="65%" />
…-errors

Two expand-related cleanups

Minor improvements I found while looking at this code. Best reviewed one commit at a time.

r? `@BoxyUwU`
…BurntSushi

Split duration_constructors to get non-controversial constructors out

This implements #140881
Update deps of bootstrap for Cygwin

This PR just runs
```
cargo update fd-lock xattr libc errno
```
It reduces dependency on `rustix 0.38.40` and updates `libc` & `errno`. Now it compiles successfully on Cygwin:)
test intrinsic fallback bodies with Miri

`@Urgau` noted in #140792 that fallback bodies our backends don't use are untested... which is correct, and it is a problem. So this adds a testing-only flag to Miri to force the use of fallback bodies, and adds a run of the Miri test suite with that flag to CI. This should not take much more than a minute so I hope it's fine? Let's see how long it actually takes.

While at it, I made that test run also enable MIR optimizations. Miri's CI has a run with that, and it has caught mir-opt bugs in the past -- this way we'd see the CI failure earlier.

r? `@scottmcm`
Rollup of 7 pull requests

Successful merges:

 - #140792 (Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations)
 - #140795 (Prefer to suggest stable candidates rather than unstable ones)
 - #140865 (Make t letter looks like lowercase rather than uppercase)
 - #140878 (Two expand-related cleanups)
 - #140882 (Split duration_constructors to get non-controversial constructors out)
 - #140886 (Update deps of bootstrap for Cygwin)
 - #140903 (test intrinsic fallback bodies with Miri)

r? `@ghost`
`@rustbot` modify labels: rollup
…=Amanieu

Partially stabilize LoongArch target features

Stabilization PR for the LoongArch target features. This PR stabilizes some of the target features tracked by #44839.

Specifically, this PR stabilizes the following target features:

* f
* d
* frecipe
* lasx
* lbt
* lsx
* lvz

Docs PR: rust-lang/reference#1707

r? `@Amanieu`
…ations, r=davidtwco

Add T-compiler backports Zulip notifications

This patch make it so, that the triagebot willl send notifications to the Zulip channel [#t-compiler/backports](https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports) when a label `{stable-beta}-nominated` is added to beta or stable backport pull request. Requirement to trigger this notification is that the pull request be labeled `T-compiler`.

Note: Zulip notifications can send notifications also on other events (`message_on_close` and `message_on_reopen`) but I omitted them for now, I am not yet sure we need them.

r? `@davidtwco`
Warn when `#[export_name]` is used with generic functions

Fixes #140742
Enable non-leaf Frame Pointers for Arm64EC Windows

This was enabled for native Arm64 via #140828

r? `@workingjubilee`
…fix, r=oli-obk

Async drop fix for async_drop_in_place<T> layout for unspecified T

Fix for #140423.
Layout of `async_drop_in_place<T>::{closure}` is calculated for unspecified T from dataflow_const_prop `try_make_constant`.

`@oli-obk,` do you think, it may be a better solution to add check like `if !args[0].is_fully_specialized() { return None; }` in `fn async_drop_coroutine_layout`?
And could you, pls, recommend, how to implement `is_fully_specialized()` in a most simple way?
As with `DIBuilderBox`, the "Box" suffix does a better job of communicating
that this is an owning pointer to some borrowable resource.

This also renames the `raw` method to `as_ref`, which is what it would have
been named originally if the `Deref` problem had been known at the time.
Rollup of 3 pull requests

Successful merges:

 - #140397 (Add T-compiler backports Zulip notifications)
 - #140851 (Warn when `#[export_name]` is used with generic functions)
 - #140862 (Enable non-leaf Frame Pointers for Arm64EC Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
Update miniz_oxide dependency of coverage_dump

This was the final subproject that depended on ```miniz_oxide``` 0.7.x after the rest were when updating the ```backtrace-rs``` dependency in in #140705. Older versions of ```miniz_oxide``` got hit by a [serious](#132636) performance regression in rust 1.82 (which has been worked around in more recent versions of the library) so should really be avoided if possible (granted it only affects compression so not sure if it had much impact in practice here, though there have also been some other performance improvements since .)

This also means no longer having to build two versions of miniz_oxide as everything can now use the same version, and no longer needing to build both ```adler``` and ```adler2```
Remove mono item collection strategy override from -Zprint-mono-items

Previously `-Zprint-mono-items` would override the mono item collection
strategy. When debugging one doesn't want to change the behaviour, so
this was counter productive. Additionally, the produced behaviour was
artificial and might never arise without using the option in the first
place (`-Zprint-mono-items=eager` without `-Clink-dead-code`).  Finally,
the option was incorrectly marked as `UNTRACKED`.

Resolve those issues, by turning `-Zprint-mono-items` into a boolean
flag that prints results of mono item collection without changing the
behaviour of mono item collection.

For codegen-units test incorporate `-Zprint-mono-items` flag directly
into compiletest tool.

Test changes are mechanical. `-Zprint-mono-items=lazy` was removed
without additional changes, and `-Zprint-mono-items=eager` was turned
into `-Clink-dead-code`.  Linking dead code disables internalization, so
tests have been updated accordingly.
cg_llvm: Rename `OperandBundleOwned` to `OperandBundleBox`

As with `DIBuilderBox`, the "Box" suffix does a better job of communicating that this is an owning pointer to some borrowable resource.

This also renames the `raw` method to `as_ref`, which is what it would have been named originally if the `Deref` problem (#137603) had been known at the time.

No functional change.
add regression test for 140207

Assembly test for #140207
…ettings, r=onur-ozkan

Silence warning in default compiler bootstrap settings

Fixes #140928
the size of `AsyncStruct`'s destructor depends on whether the configured
panic strategy is 'unwind' or 'abort' so factor that into the test using
conditional compilation

fixes #140939
…petrochenkov

ui/async-drop-initial: factor in panic strategy in destructor size check

the size of `AsyncStruct`'s destructor depends on whether the configured panic strategy is 'unwind' or 'abort' so factor that into the test using conditional compilation

fixes #140939
fixes #140493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.