diff options
| author | Michael Goulet <michael@errs.io> | 2025-05-05 19:44:10 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-05-07 16:36:55 +0000 |
| commit | fd37906477d36968247ddf2db43244af5d54b752 (patch) | |
| tree | 343ac04d06c625989eb05d94b338c96bef7a0c20 /compiler/rustc_middle/src | |
| parent | 3ef8e64ce9f72ee8d600d55bc43b36eed069b252 (diff) | |
| download | rust-fd37906477d36968247ddf2db43244af5d54b752.tar.gz rust-fd37906477d36968247ddf2db43244af5d54b752.zip | |
Only include associated type bounds for Self:Sized associated types if they are provided
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 2165cf186bd..c31ce1bc630 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -723,7 +723,10 @@ impl<'tcx> Ty<'tcx> { repr: DynKind, ) -> Ty<'tcx> { if cfg!(debug_assertions) { - let projection_count = obj.projection_bounds().count(); + let projection_count = obj + .projection_bounds() + .filter(|item| !tcx.generics_require_sized_self(item.item_def_id())) + .count(); let expected_count: usize = obj .principal_def_id() .into_iter() |
