rust-lang / rust-lang/compiler-team

Document layout guarantee of TypeId

Open
#941 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

meeting-proposal
Dominant language
HTML
Stars
433
Forks
73
Avg merge
1m
Merged PRs (30d)
1

Description

Meeting proposal info

  • Title: Document layout guarantee of TypeId
  • Type: technical

Summary

A TypeId represents a globally unique identifier for a type.

Stabilizing and documenting its layout is useful for FFI use-cases where a TypeId may be stored within a foreign data structure or buffer.

The initial proposal is to set a fixed size of 16 bytes. Preliminary discussion from T-compiler pointed out (comment) that a more flexible solution supporting more architectures.

Stakeholders / interested parties

RfL (Rust for Linux) for example would benefit from that, see discussion on the LKML, cc: @dakr @darksonn

Project Bevy chimed in as well with some thoughts, see comment, backlink to Bevy Discord (login required) cc @alice-i-cecile

Requirements for the meeting to happen
  • T-lang should decide on a threat-model (see discussion)
  • T-libs seems to defer T-compiler for a decision, see comment
Expected outcome of the meeting

Agreement about the layout and size of TypeId, an actionable to write documentation.

Meeting proposal date(s)

TODO

Relevant links

About this issue

This issue corresponds to a meeting proposal for the compiler team
steering meeting. It corresponds to a possible topic of
discussion. You can read more about the steering meeting procedure
here
.

Comment policy

These issues are meant to be used as an "announcements channel"
regarding the proposal, and not as a place to discuss the technical
details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision.
In the meantime, if you have questions or ideas, ping the proposers
on Zulip (or elsewhere).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the TypeId documentation and linked PR #148265 first, then review the cited compiler and library discussions to understand the unresolved layout and threat-model decisions. Done means an agreed TypeId layout and size, followed by a clear actionable documentation task.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.