Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-HIR-ty-loweringArea: HIR ty lowering (HIR → middle::ty IR)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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions