Skip to content

Sized hierarchy: PointeeSized bounds aren't fully validated during HIR ty lowering #142718

Open
@fmease

Description

@fmease

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:

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 systemC-bugCategory: This is a bug.F-sized_hierarchy`#![feature(sized_hierarchy)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions