Skip to content

typeof() in the type language #3228

Closed
Closed

Description

@bblum

I'm not sure if this would be useful in every-day code, but I just wrote some code where it would've been nice to say:

let foo: typeof(earlier_thing) = unsafe::transmute(...);

instead of

let foo: complicated::typename::that_might_change_later = unsafe::transmute(...);

Activity

  1. sanxiyn commented on May 3, 2013

    @sanxiyn
    Contributor

    Nominating for backwards compatible milestone.

  2. graydon commented on Jun 20, 2013

    @graydon
    Contributor

    reserving the keyword at least is required for this to be backwards-compatible; actual feature is later

  3. graydon commented on Jun 20, 2013

    @graydon
    Contributor

    accepted for backwards-compatible milestone

  4. emberian commented on Aug 5, 2013

    @emberian
    Contributor

    This would be very nice.

  5. thestinger commented on May 10, 2014

    @thestinger
    Contributor

    This is the kind of thing we really need to go through the new formal RFC process. There's never going to be enough discussion here. It's no longer a backwards compatibility issue because typeof is reserved.

  6. added a commit that references this issue on Jul 29, 2024
    dfd05f7
  7. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of Rust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions