`repr(transparent)` ignores fields that do not have "trivial ABI"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read the linked PRs #157973 and #155984 to understand the trivial ABI change and the stalled implementation. Then trace how repr(transparent) determines which fields it ignores and inspect the related compiler tests. Done means transparent representation ignores only fields with trivial ABI, with regression coverage for the two zero-sized array fields shown in the issue.
索引モデルが issue の本文から書いたものです。
説明
In https://github.com/rust-lang/rust/pull/157973 we introduced the concept of "trivial ABI", and declared that types like [u8; 0] or repr(C) 1-ZST do not have trivial ABI. However, repr(transparent) still ignores such types, so we accept e.g.
#[repr(transparent)]
struct S {
a: [u8; 0],
b: [i8; 0],
}
Since it's not clear which field is being wrapped by S, we basically have to make S ABI-compatible with all its fields, but the two fields are not ABI-compatible so that does not work out. We should therefore transition repr(transparent) to only ignore fields that have "trivial ABI".
@Jules-Bertholet started working on that in https://github.com/rust-lang/rust/pull/155984. However, the work has stalled, so I figured it'd be worth opening an issue to track this. @Jules-Bertholet do you still plan to get back to that PR, or would you be fine with someone else picking up the work?
- 主要言語
- Rust
- スター
- 122k
- フォーク
- 16.7k
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 515
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rust のほかの issue
-
Remove unnecessary parentheses when suggesting to remove '&' from a pattern対応中かも @BartSimpson001 が 1 日前に担当しました。 オープンA-diagnostics D-invalid-suggestion T-compiler
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Windows `File::set_permissions` silently does nothing when clearing `readonly` leaves `FileAttributes == 0`対応中かも @ChrisDenton が 11 日前に担当しました。 オープンA-filesystem C-bug O-windows T-libs
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
A-run-make relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
A-LLVM O-Arm O-UEFI O-x86_64 relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
rust-lang/rust#165504 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
relnotes relnotes-tracking-issue T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
antithesishq/bombadil#473 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
libracoder/kiri#669 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 5 日以内に返信
-
autofixer: follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
tursodatabase/turso#12217 ·
メンテナーはふだん 1 日以内に返信
-
Declare the CMS schema library in the optional recipients extra対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:python in-progress
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
yhay81/pyropdf#1005 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信