Skip to content

Check type alignment is <= type size in data layout parser - #165090

Open
beetrees wants to merge 2 commits into
rust-lang:mainfrom
beetrees:data-layout-check-align
Open

beetrees wants to merge 2 commits into
rust-lang:mainfrom
beetrees:data-layout-check-align

Conversation

@beetrees

@beetrees beetrees commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Rust requires that types have an alignment that is <= their size, so this PR checks this is the case in the data layout parser. As i1_align and i8_align must always have an alignment of 1, I've also removed those two fields from TargetDataLayout in the second commit and replaced any uses with Align::ONE.

@rustbot

rustbot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in cfg and check-cfg configuration

cc @Urgau

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 28, 2026
@rustbot

rustbot commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 77 candidates
  • Random selection from 19 candidates

@asquared31415

Copy link
Copy Markdown
Contributor

Your PR title and description have two different conditions listed. The title says align <= size (this is correct i think?) and the description says size <= align.

@beetrees

Copy link
Copy Markdown
Contributor Author

Thanks, fixed.

@rust-bors

This comment has been minimized.

@beetrees
beetrees force-pushed the data-layout-check-align branch from 3c15274 to f9df966 Compare November 1, 2026 17:42
@rustbot

rustbot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants