Open
Description
This is a tracking issue for making and stabilizing type_name
as const fn
. It is not clear whether this is sound. Needs some T-lang discussion probably, too.
Steps needed:
- Implementation (essentially add
const
and#[rustc_const_unstable(feature = "const_type_name")
to the function and add tests showing that it works at compile-time. - fix
type_name
depends on-Zverbose
flag #94187 - check if
TypeId
exposes equality-by-subtyping vs normal-form-syntactic-equality unsoundness. #97156 replicates fortype_name
, too - Stabilization
- Note that stabilization isn't happening any time soon. This function can change its output between rustc compilations and allows breaking referential transparency. Doing so at compile-time has not been discussed fully and has various points that are problematic.
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are considered "small" or self-containedLibs issues that are tracked on the team's project board.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Relevant to the language team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.