-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.F-sized_hierarchy`#![feature(sized_hierarchy)]``#![feature(sized_hierarchy)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The following code compiles successfully:
#![feature(sized_hierarchy)]
fn f<T: std::marker::PointeeSized<(), (), (), Undefined = ()>>() {}
but it should definitely not because PointeeSized
doesn't have any generic params or assoc types.
This happens because of this check:
rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Lines 464 to 466 in 70e2b4a
if self.should_skip_sizedness_bound(hir_bound) { | |
continue; | |
} |
which leads to <dyn HirTyLowering<'_>>::lower_poly_trait_ref
getting skipped which would've performed the necessary generic args validation.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.F-sized_hierarchy`#![feature(sized_hierarchy)]``#![feature(sized_hierarchy)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.