Can references inside an enum transiently set an invalid enum discriminant?

Đang mở
#621 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Start by reading the referenced unsafe-code-guidelines issue comment and the discussion around rust-lang/rust pull request 161452. Determine whether the stated temporary-invalid-value rule applies to niche-optimized enum discriminants, then document the agreed semantic conclusion in the relevant guidelines discussion.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

disposition-merge finished-final-comment-period S-waiting-on-review T-opsem to-announce

Per https://github.com/rust-lang/unsafe-code-guidelines/issues/414#issuecomment-4096685918, opsem consensus appeared to be that a &mut T can write an invalid value of T "temporarily", so long as it's restored to a valid form before returning into safe code. Does this also mean that, for a T with niches, it is valid to overwrite the discriminant of a wrapping enum (e.g. could a &mut NonNull<T> transiently write 0 or uninit even if the said NonNull was part of an Option<NonNull<T>>)?

Relevant to https://github.com/rust-lang/rust/pull/161452

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
760
Fork
68
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-lang/unsafe-code-guidelines

Tất cả issue của rust-lang/unsafe-code-guidelines

Issue tương tự

Thêm issue về Compilers

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.