Skip to content

Migrate away from u32 as an offset/length type #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 3 tasks
saethlin opened this issue Jul 1, 2023 · 2 comments
Closed
1 of 3 tasks

Migrate away from u32 as an offset/length type #647

saethlin opened this issue Jul 1, 2023 · 2 comments
Labels
major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@saethlin
Copy link
Member

saethlin commented Jul 1, 2023

Proposal

Rustc stores a lot of lengths in u32, which reduces the size of data structures and on-disk formats that contain these lengths. But this strategy imposes an artificial limit on the size of various things, which users can and do hit. This MCP is a general proposal to stop doing this, as opposed to a single strategy to adopt instead of using u32. The right alternative strategy will be determined on a case-by-case basis by experimentation.

Here are the examples I know of where users have reported running into the u32 limitation:

I expect that it is also possible to exceed the u32-based limit on a rustc_index::newtype_index! type, but we do not yet have any reports of those. I wouldn't be surprised if ICEs due to newtype_index! exhaustion are hiding behind the two cases we do have reports for.

Mentors or Reviewers

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@saethlin saethlin added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jul 1, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2023

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jul 1, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jul 6, 2023
@saethlin
Copy link
Member Author

I'm splitting this into two different MCPs. The first half is #666

@saethlin saethlin closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

3 participants