rust/library
Jonathan Brouwer 16da3ab2ea
Rollup merge of #152381 - oli-obk:non_static_reflection, r=Mark-Simulacrum
Do not require `'static` for obtaining reflection information.

tracking issue rust-lang/rust#142577

This does not affect the stable `TypeId::of`, as that has its own `'static` bound.

But it will allow obtaining `TypeId`s for non-static types via the reflection API. To obtain such a `TypeId` for any type, just use `Type::of::<(T,)>().kind` to extract the first field of a tuple.

This effectively reintroduces rust-lang/rust#41875, which @rust-lang/lang decided against allowing back in 2018 due to lack of sound use cases. We will thus need to have a T-lang meeting specifically about `TypeId` for non-static types before *stabilizing* any part of reflection (in addition to T-lang meetings about reflection in general). I'm adding an explicit point about this to the tracking issue.

cc @scottmcm @joshtriplett @9SonSteroids @SpriteOvO @izagawd @BD103
2026-02-14 22:11:53 +01:00
..
alloc Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann 2026-02-13 13:34:58 +01:00
alloctests Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum 2026-02-14 22:11:52 +01:00
backtrace@28ec93b503 Update backtrace 2026-01-26 10:57:35 +00:00
compiler-builtins libm: Fix tests for lgamma 2026-02-09 04:32:04 -06:00
core Rollup merge of #152381 - oli-obk:non_static_reflection, r=Mark-Simulacrum 2026-02-14 22:11:53 +01:00
coretests Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00
panic_abort Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
panic_unwind Remove unused features in library 2026-02-13 09:25:50 +08:00
portable-simd Merge commit 'd9aae8cc54' into sync-from-portable-simd-2026-01-28 2026-01-28 00:56:52 -05:00
proc_macro inline SameThread and CrossThread 2026-02-13 11:24:50 +00:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
rustc-std-workspace-core Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
rustc-std-workspace-std Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
std Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann 2026-02-13 13:34:58 +01:00
std_detect Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00
stdarch Merge pull request #2020 from Snehal-Reddy/main 2026-02-11 20:40:14 +00:00
sysroot compiler-builtins: Remove the no-f16-f128 feature 2026-01-11 07:02:27 -06:00
test Remove unused features in library 2026-02-13 09:25:50 +08:00
unwind Remove unused features in library 2026-02-13 09:25:50 +08:00
windows_link Update windows bindings in std 2026-01-26 10:59:16 +00:00
Cargo.lock Rollup merge of #151660 - fmease:bump-backtrace-demangler-alt, r=tgross35 2026-01-28 21:10:51 +01:00
Cargo.toml Update windows bindings in std 2026-01-26 10:59:16 +00:00