Support passing attributes on the command line
Maintainer thường phản hồi trong vòng 1 ngày
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
- 35/100
Hướng nghiên cứu
Bắt đầu bằng việc xem xét các tùy chọn dòng lệnh của bindgen và đường dẫn tạo kiểu dẫn xuất; issue không nêu tên tệp nào trong repository hoặc test nào. Xác định cách một flag sẽ thêm các thuộc tính zerocopy vào các kiểu được tạo, bao gồm các derives vô điều kiện được yêu cầu và hành vi của on_error, sau đó thêm coverage cho thấy các bindings được tạo có thể biên dịch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Seems like this has been discussed in various places, but I'm not sure if there's a single issue that tracks this. Feel free to close in favor of one of those.
In https://github.com/google/zerocopy/pull/2982, we're adding a #[zerocopy(on_error = skip/fail)] attribute that would allow code to compile even if a type derives a trait which it can't implement, e.g.:
use zerocopy::*;
// Can't be `FromBytes` because `bool: !FromBytes`
#[derive(IntoBytes, FromBytes)]
#[zerocopy(on_error = skip)]
struct Foo(bool);
This is especially useful in conjunction with bindgen. Many zerocopy users add zerocopy derives to bindgen-generated types, but need to jump through significant hoops (such as the hoops that Fuchsia jumps through) in order to avoid adding #[derive(Xxx)] on a type that can't support the trait being derived.
Once this attribute is supported, they can unconditionally add all zerocopy traits and add #[zerocopy(on_error = skip)] to ensure everything compiles regardless of which traits are supported.
Currently, bindgen doesn't support a flag to automatically add attributes to derived types, so this would have to be done as a post-processing step. It'd be great if such a flag were supported. Note that this is a soft blocker for the Linux kernel to be able to use zerocopy.
- Ngôn ngữ chính
- Rust
- Star
- 5.3k
- Fork
- 846
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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/rust-bindgen
-
--enable-cxx-namespaces panics on namespace [[deprecated]] { ("[" is not a valid Ident)Có thể đã có người làm @lwz23 đã nhận 49 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
rust-lang/rust-bindgen#3485 ·
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
rust-lang/rust-bindgen#3483 ·
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 64/100
rust-lang/rust-bindgen#3370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
rust-lang/rust-bindgen#3363 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
rust-lang/rust-bindgen#3540 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rust-bindgen
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ci javascript tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jonathanong/no-mistakes#3258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add to bmi docsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
eWaterCycle/bmi-rust#2 ·
-
area: cpu-engines area: fuzzer good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
hffgzktbcc-blip/ounce-core#402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compiler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
HerringtonDarkholme/hd-lang#1699 ·
Maintainer thường phản hồi trong vòng 1 ngày