Declare ptr2int transmutes to be UB

オープン
#630 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
documentation

調査の方向性

This is a design/spec issue in the unsafe-code-guidelines repository; the payload names no files or tests. Start by reading the linked discussions #286 and #328, then locate the guidelines text on pointer provenance and transmutes. Done means a written rule declaring ptr2int transmutes that carry provenance to be UB, with the OOM rationale and a note about zerocopy.

索引モデルが issue の本文から書いたものです。

説明

I-opsem-nominated

We have previously discussed allowing ptr2int transmutes (where the ptr actually has provenance) while just implicitly dropping the provenance. This gives rise to "provenance monotonicity" as originally suggested by @digama0. However, we have since learned that this a major hurdle for the best option that we seem to have that lets us resolve the OOM problem. So to keep the design space open, I think it would be prudent to declare such a transmute UB. If we can figure out a solution to the OOM problem that is compatible with provenance monotonicity, we can take back this UB later, but for now I'd rather be conservative and give us some room to work in this space.

One main motivation for making it not UB was making life easier for zerocopy, so Cc @joshlf.

主要言語
言語のデータがありません
スター
760
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/unsafe-code-guidelines のほかの issue

rust-lang/unsafe-code-guidelines の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。