Skip to content

Conversation

Shourya742
Copy link
Contributor

Update PathInterner::intern to use FileId::MAX for id range checks, ensuring FileId MAX invariant.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 27, 2025
@Shourya742
Copy link
Contributor Author

I am curious why we don't use u32::MAX?

@Shourya742
Copy link
Contributor Author

cc: @ShoyuVanilla apologies to tag, just looking for a quick review on this.

@lnicola
Copy link
Member

lnicola commented Oct 7, 2025

I am curious why we don't use u32::MAX?

The file id bits are OR-ed with 8 edition bits and a reserved one and get passed to proc macros as a single EditionedFileId.

What I'm wondering is why EditionedFileId::MAX_FILE_ID is 0x007F_FFFF while FileId::MAX is 0x7FFF_FFFF.

@Shourya742
Copy link
Contributor Author

Shourya742 commented Oct 7, 2025

I am curious why we don't use u32::MAX?

The file id bits are OR-ed with 8 edition bits and a reserved one and get passed to proc macros as a single EditionedFileId.

What I'm wondering is why EditionedFileId::MAX_FILE_ID is 0x007F_FFFF while FileId::MAX is 0x7FFF_FFFF.

It’s interesting that FileId reserves one bit but doesn’t include any edition bits. Since FileId is expected to accommodate editions as well, the mask 0x7FFF_FFFF appears incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants