Open
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
which leads to <dyn HirTyLowering<'_>>::lower_poly_trait_ref
getting skipped which would've performed the necessary generic args validation.