No subobject provenance for arrays/slices
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
- 30/100
Hướng nghiên cứu
Start by reviewing the example and the related unsafe-code-guidelines issue 419, then read the Reference wording in pull request 2338. The work is complete when the provenance policy is resolved and Miri no longer reports the demonstrated array or slice accesses as undefined behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
https://github.com/rust-lang/unsafe-code-guidelines/issues/419 is a big topic, but there is one specific form of subobject provenance which is violated particularly often: using a reference to one element of an array/slice to access another. Even C allows this, so IMO we should commit to also allowing this in Rust.
Concretely, this means the following code has no UB:
fn main() {
let x = &mut [1, 2, 3];
let ptr = &mut x[0] as *mut i32;
unsafe { ptr.add(1).write(5) };
let ptr = &x[1] as *const i32;
let _val = unsafe { ptr.sub(1).read() };
}
This is based on the observation that violations of such subobject provenance are the major kind of Stacked Borrows UB that Miri finds. I'd like to make Miri stop report this as UB, and for this I'd like to be sure that indeed we don't want to make this UB.
See https://github.com/rust-lang/reference/pull/2338 for Reference-level wording of this.
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/unsafe-code-guidelines
-
I-opsem-nominated
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rust-lang/unsafe-code-guidelines#634 · 5 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
rust-lang/unsafe-code-guidelines#632 · 8 bình luận · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
rust-lang/unsafe-code-guidelines#631 · 7 bình luận ·
-
I-opsem-nominated
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
rust-lang/unsafe-code-guidelines#630 · 1 reaction ·
Tất cả issue của rust-lang/unsafe-code-guidelines
Issue tương tự
-
bug core-lang
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Call-argument syntax diagnostic needs example spacing and removal of confusing trailing sentenceĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mw00/project-maya#1368 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
test(bind-json): legacy Solidity fixture requires an unavailable solc on Linux ARM64Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
foundry-rs/foundry#18828 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày