-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Rollup of 10 pull requests #137397
Conversation
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.)
…r=tgross35 Stabilise `os_str_display` Closes rust-lang#120048.
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.
@bors r+ rollup=never p=1 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 71e06b9c59 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (794c124): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis 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. CyclesResults (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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 773.873s -> 774s (0.02%) |
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
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
Successful merges:
TypeId
s. #136148 (Optionally add type names toTypeId
s.)IpAddr::as_octets()
#136609 (libcore/net:IpAddr::as_octets()
)os_str_display
#137336 (Stabiliseos_str_display
)read_buf
for WASI stdin #137353 (Implementread_buf
for WASI stdin)OperandRef::extract_field
to prep for MCP838 #137361 (RefactorOperandRef::extract_field
to prep for MCP838)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup