Make sure to be sound in the face of coinductive `unsafe trait` impls

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
rust
領域
security

調査の方向性

Issue にある 2 つの Rust Playground の例から始め、再帰的な auto-trait impl と non-auto-trait impl の動作を比較します。Issue ではリポジトリのファイルやテストは指定されていません。完了には、unsoundness を受け入れるか、制限を定義して実装するかについて maintainer が判断することが必要です。

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

説明

Rust currently has a soundness hole where coinductive unsafe trait impls are unsound, e.g.:

struct NotSend(Rc<()>);

unsafe impl Send for NotSend
where
    NotSend: Send
{}

Note that this only holds for auto traits. In particular, recursive impls for non-auto traits are considered unsatisfied:

error[E0275]: overflow evaluating the requirement `NotSend: Foo`
  --> src/lib.rs:11:5
   |
11 |     NotSend: Foo
   |     ^^^^^^^^^^^^
   |
   = help: see issue #48214

We need to figure out whether we're okay saying "we're unsound because Rust itself is unsound" or whether we want to try to forbid these somehow.

cc @lcnr

主要言語
Rust
スター
2.6k
フォーク
194
平均マージ
18時間 15分
マージ済み PR(30日)
14

環境構築

はじめの一歩

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

google/zerocopy のほかの issue

google/zerocopy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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