Const blocks in fns with trivially unsatisifiable clauses can render addition of trait impls a post-monomorphization breaking change
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
Start with the const evaluation and trait obligation handling discussed in the linked issue #165153 and PR #142293; the payload does not name Rust compiler files or tests. Reproduce the downstream const { panic!() } case with and without the upstream trait impl, then trace why evaluation changes after monomorphization. Done means the compiler behavior and the compatibility implications are understood and addressed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Back in closed PR #142293 after [@]BoxyUwU pointed out the issues with suppressing const eval if there are trivially unsatisfiable clauses in scope in the context of GCI (now tracked in issue https://github.com/rust-lang/rust/issues/165153), it made me realize (CC https://github.com/rust-lang/rust/pull/142293#issuecomment-3229975360 (from 2025)) that const blocks are affected by this problem.
Reproducer
Upstream crate upstream:
pub trait Trait {}
// NOTE: Adding this impl breaks downstream.
//impl Trait for () {}
Downstream crate downstream:
fn scope()
where
for<'_delay> (): upstream::Trait,
{
const { panic!() } // NOTE: panics at comptime post-mono if upstream adds the impl
}
Of course, due to the existence of 1IR ("one-impl rule"), the addition of trait impls is already breaking (pre-mono even).
Moreover, at the time of writing two unstable features are affected by this issue (also pre-mono), namely GCI (https://github.com/rust-lang/rust/issues/165153) and DFV (https://github.com/rust-lang/rust/issues/165152) meaning this mistake is easy to make by rustc devs.
However, by posting https://github.com/rust-lang/rust/issues/165152#issuecomment-6722673316 @theemathas made me realize that we should probably track this in a GH issue.
- Ngôn ngữ chính
- Rust
- Star
- 121k
- Fork
- 17.3k
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 529
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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
-
Windows `File::set_permissions` silently does nothing when clearing `readonly` leaves `FileAttributes == 0`Có thể đã có người làm @ChrisDenton đã nhận 1 ngày trước. Đang mởA-filesystem C-bug O-windows T-libs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-run-make relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-libs
Độ khó 1/5 Dưới một 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
-
A-LLVM O-Arm O-UEFI O-x86_64 relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
rust-lang/rust#165504 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
relnotes relnotes-tracking-issue T-libs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rust
Issue tương tự
-
agent-self
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
yologdev/yoyo-evolve#1176 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Richard-Zhang1019/Crossbow#431 ·
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 86/100
saschanaz/jxl-winthumb#69 ·
-
ready
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
TusanHomichi/PSIV#504 ·
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 75/100
Maintainer thường phản hồi trong vòng 1 ngày