Skip to content

erasable const-ness on types and TypeId #14

Open
@lcnr

Description

@lcnr

I have personally wanted for const fn(u32) and fn(u32) to be the same types at codegen once/if we ever add them. This requires const-ness of types to not influence selection.

It also requires TypeId::of::<const fn(u32)>() to error, as you can otherwise cast from fn(u32) to const fn(u32) which would be broken. Doing this would likely require a new bound on TypeId which only works by introducing a new default trait bound. Doing so is very questionable and means we're pretty much forced to treat them as different types.

by @BoxyUwU:

because then you could call a runtime only fn at compile time and thats (?)
well I mean we could error on it when you actually do it [during CTFE] but that feels like we failed in the type system xd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions