Declare "trivial ABI" arguments as entirely irrelevant for the ABI?
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
- 38/100
Hướng nghiên cứu
Read the ABI compatibility rules introduced by rust-lang/rust#157973, then trace how PassMode::Ignore appears in generated LLVM IR and how captureless closures become function pointers. Compare the proposed general trivial-ABI filtering with Miri's current special case and the stated CFI considerations. Done means the compatibility rule and its implications are agreed and documented.
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/rust/pull/157973 will hopefully soon land, fixing our current ABI compatibility rules. As part of that we are introducing a new concept, that of types with "trivial ABI".
This provides a nice opportunity to go further: we could declare that arguments with "trivial ABI" can be entirely filtered out of the signature before comparing the caller and callee view of the call. So for instance, the caller could use signature fn(i32, ()) and the callee could use fn(MyZst, i32), and we'd still consider this to be ABI-compatible.
I think this has several benefits:
- It is already how the compiler works: arguments with
PassMode::Ignoreat not even present in the generated LLVM IR, and "trivial ABI" is pretty much the surface level term for "types that are guaranteed to usePassMode::Ignore". We are therefore not making any assumptions about what LLVM does here, or about any target-specific ABIs; we are only making promises about things that are fully under the contol of rustc. "Trivial ABI" is also carefully designed to only apply to types that are "owned" by Rust, i.e., we are fully in control of what we want their ABI to be. - The compiler in fact already internally relies on this when turning a captureless closure into a function pointer: the underlying function has type
fn(self, args...) -> retbut the function pointer has typefn(args...) -> ret. This works becauseselfof a captureless closure has trivial ABI. But because we don't have a general rule for this, we currently need awkward special reasoning in the compiler that relies on this, and awkward special treatment in Miri to allow this special case without allowing the general case. - It is something people already often assume to be true, and it's good to align reality with people's expectations if we can cheaply do so.
Given that these arguments are already not present in LLVM, I think this is also fine from a CFI perspective (Cc @Darksonn @rcvalle) -- the sanitizer already today doesn't even know that these arguments exist.
- 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