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 10 pull requests #137397

Merged
merged 22 commits into from
Feb 21, 2025
Merged

Rollup of 10 pull requests #137397

merged 22 commits into from
Feb 21, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

kpreid and others added 22 commits February 11, 2025 18:42
This feature is intended to provide expensive but thorough help for
developers who have an unexpected `TypeId` value and need to determine
what type it actually is. It causes `impl Debug for TypeId` to print
the type name in addition to the opaque ID hash, and in order to do so,
adds a name field to `TypeId`. The cost of this is the increased size of
`TypeId` and the need to store type names in the binary; therefore, it
is an optional feature.

It may be enabled via `cargo -Zbuild-std -Zbuild-std-features=debug_typeid`.
(Note that `-Zbuild-std-features` disables default features which you
may wish to reenable in addition; see
<https://doc.rust-lang.org/cargo/reference/unstable.html#build-std-features>.)

Example usage and output:

```
fn main() {
    use std::any::{Any, TypeId};
    dbg!(TypeId::of::<usize>(), drop::<usize>.type_id());
}
```

```
TypeId::of::<usize>() = TypeId(0x763d199bccd319899208909ed1a860c6 = usize)
drop::<usize>.type_id() = TypeId(0xe6a34bd13f8c92dd47806da07b8cca9a = core::mem::drop<usize>)
```

Also added feature declarations for the existing `debug_refcell` feature
so it is usable from the `rust.std-features` option of `config.toml`.
Adds `const` `Ip*Addr::as_octets` methods providing reference access to
`Ip*Addr` octets contents.

See rust-lang/libs-team#535 for accepted ACP
with a more detailed justification.
Continuing the work from rust-lang#137162.

Every method gains a `hir_` prefix.
…en-items, r=GuillaumeGomez

rustdoc book: acknowledge --document-hidden-items
Optionally add type names to `TypeId`s.

This feature is intended to provide expensive but thorough help for developers who have an unexpected `TypeId` value and need to determine what type it actually is. It causes `impl Debug for TypeId` to print the type name in addition to the opaque ID hash, and in order to do so, adds a name field to `TypeId`. The cost of this is the increased size of `TypeId` and the need to store type names in the binary; therefore, it is an optional feature. It does not expose any new public API, only change the `Debug` implementation.

It may be enabled via `cargo -Zbuild-std -Zbuild-std-features=debug_typeid`. (Note that `-Zbuild-std-features` disables default features which you may wish to reenable in addition; see
<https://doc.rust-lang.org/cargo/reference/unstable.html#build-std-features>.)

Example usage and output:

```
fn main() {
    use std::any::{Any, TypeId};
    dbg!(TypeId::of::<usize>(), drop::<usize>.type_id());
}
```

```
TypeId::of::<usize>() = TypeId(0x763d199bccd319899208909ed1a860c6 = usize)
drop::<usize>.type_id() = TypeId(0xe6a34bd13f8c92dd47806da07b8cca9a = core::mem::drop<usize>)
```

Also added feature declarations for the existing `debug_refcell` feature so it is usable from the `rust.std-features` option of `config.toml`.

Related issues:

* rust-lang#68379
* rust-lang#61533
libcore/net: `IpAddr::as_octets()`

[ACP](rust-lang/libs-team#535)
[Tracking issue](rust-lang#137259)

Adds `const` `core::net::IpAddr{,v4,v6}::as_octets()` methods to provide reference access to IP address contents.

The concrete usecase for me is allowing the `IpAddr` to provide an extended lifetime in contexts that want a `&[u8]`:

```rust
trait AddrSlice {
    fn addr_slice(&self) -> &[u8];
}

impl AddrSlice for IpAddrV4 {
    fn addr_slice(&self) -> &[u8] {
        // self.octets() doesn't help us here, because we can't return a reference to the owned array.
        // Instead we want the IpAddrV4 to continue owning the memory:
        self.as_octets()
    }
}
```

(Notably, in this case we can't parameterize `AddrSlice` by a `const N: usize` (such that `fn addr_slice(&self) -> [u8; N]`) and maintain object-safety.)
Move methods from Map to TyCtxt, part 3.

A follow-up to rust-lang#137162.

r? `@Zalathar`
…si-stdin, r=alexcrichton

Implement `read_buf` for WASI stdin

`WasiFd::read_buf` already exists. Simply use it in `Stdin`.

cc `@alexcrichton`

Tracked in rust-lang#136756
…errors

Refactor `OperandRef::extract_field` to prep for MCP838

cc rust-lang/compiler-team#838

This still supports exactly the same cases as it did before, just rearranged a bit to better emphasize what doesn't work.
…r=jieyouxu

Do not exempt nonexistent platforms from platform policy

In rust-lang#137324 I approved the change of the i586-pc-qnx platform to i686 with this extra line included. I noticed it but thought it was a bootstrap problem of some sort. Nonetheless, removing this line doesn't seem to change anything.

r? `@Noratrieb`
…_case, r=compiler-errors

Stacker now handles miri using a noop impl itself

Reverts a no longer necessary change from rust-lang#136580.
remove few unused fields

Remove unused field and convert hashmap to hashset in second commit.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-tidy Area: The tidy tool O-wasi Operating system: Wasi, Webassembly System Interface 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 21, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Feb 21, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=1

@bors
Copy link
Contributor

bors commented Feb 21, 2025

📌 Commit cfc2d11 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 21, 2025
@bors
Copy link
Contributor

bors commented Feb 21, 2025

⌛ Testing commit cfc2d11 with merge 794c124...

@bors
Copy link
Contributor

bors commented Feb 21, 2025

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#132876 rustdoc book: acknowledge --document-hidden-items 0572d2b62230127a41512678cbe95ceebd0892da (link)
#136148 Optionally add type names to TypeIds. fe4c3f35c10ff45a4ab364e6e9a0700fc03890e1 (link)
#136609 libcore/net: IpAddr::as_octets() c1a90e41b228fb5c6a02face3dbc0834b4bdcb72 (link)
#137336 Stabilise os_str_display 56db316db5d989d5cf206ea2c6d8e36c828ceb1d (link)
#137350 Move methods from Map to TyCtxt, part 3. e3b7a84e7c51dcf485e090d59c3962603490eca0 (link)
#137353 Implement read_buf for WASI stdin a385768375ce9c0040715c78500f98834eb60e14 (link)
#137361 Refactor OperandRef::extract_field to prep for MCP838 2e116bde4c3cbaf85a41a5cd773e12fd9b538dca (link)
#137367 Do not exempt nonexistent platforms from platform policy e738e96d573dec0adcf5e8d149212cbf2d6d75c3 (link)
#137374 Stacker now handles miri using a noop impl itself edd216b6d258842b6658c865c8161ee5d5b286e5 (link)
#137392 remove few unused fields d8b2ddeb14968d6308371e44339b5b4fd46264d5 (link)

previous master: 71e06b9c59

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 (794c124): 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 1.4%)

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)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [1.4%, 1.4%] 1

Binary size

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

Bootstrap: 773.873s -> 774s (0.02%)
Artifact size: 361.04 MiB -> 361.02 MiB (-0.01%)

remi-delmas-3000 pushed a commit to remi-delmas-3000/kani that referenced this pull request Feb 26, 2025
Changes to attribute parsing and representation
rust-lang/rust#135726

Map methods moved to `TyCtx`
rust-lang/rust#137162
rust-lang/rust#137397

Remove `BackendRepr::Unihabited`
rust-lang/rust#136985
remi-delmas-3000 pushed a commit to remi-delmas-3000/kani that referenced this pull request Feb 26, 2025
Changes to attribute parsing and representation
rust-lang/rust#135726

Map methods moved to `TyCtx`
rust-lang/rust#137162
rust-lang/rust#137397

Remove `BackendRepr::Unihabited`
rust-lang/rust#136985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-tidy Area: The tidy tool merged-by-bors This PR was explicitly merged by bors. O-wasi Operating system: Wasi, Webassembly System Interface 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.