Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

stackable-versioned: Require inner module definitions to have the same visibility as the parent

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

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách xác định triển khai stackable-versioned xử lý các định nghĩa module bên ngoài và bên trong. Thêm bước xác thực để khả năng hiển thị không khớp tạo ra cảnh báo hoặc lỗi, sau đó kiểm tra hành vi dựa trên các ví dụ về module lồng nhau được mô tả trong issue.

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

Mô tả

As discussion with @Techassi, we should warn/error if the visibility of the inner module doesn't match the outer module.

The inner module ends up with the same visibility as the parent anyway, but it is confusing if it is not the same.

#[versioned(version(name = "v1alpha1"))]
pub mod versioned {

    // contents of this mod get merged with the generated `v1alpha` mod.
    // nothing unusual here, pub all the way
	pub mod v1alpha1 {
        pub use v1alpha1_impl::Error;
    }

}

Is equivalent to:

#[versioned(version(name = "v1alpha1"))]
pub mod versioned {

    // contents of this mod get merged with the generated `v1alpha` mod, 
    // with `pub` visibility (because of `pub mod versioned`).
    // 👇
	mod v1alpha1 {
        pub use v1alpha1_impl::Error;
    }

}

However, it appears confusing to the reader. Eg:

How can the pub use be of any use inside a private mod?

... with the answer being oh, the mod is actually pub mod because of pub mod versioned which leads to pub mod v1alpha being generated, which absorbs the contents of the mod v1alpha1 that you see in the source.

Ngôn ngữ chính
Rust
Star
167
Fork
19
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
12

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

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 stackabletech/operator-rs

Tất cả issue của stackabletech/operator-rs

Issue tương tự

Thêm issue về Rust

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.