Skip to content

Commit 600c18a

Browse files
committed
Do not allocate pvar even in ADT param when annotation is provided
1 parent 83c8b11 commit 600c18a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/refine/template.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,16 @@ where
413413
.build_refined(param_ty.ty)
414414
}
415415
} else {
416-
rty::RefinedType::unrefined(
417-
self.inner
418-
.for_template(self.registry)
419-
.with_scope(&builder)
420-
.build(param_ty.ty),
421-
)
416+
if self.param_refinement.is_some() {
417+
rty::RefinedType::unrefined(self.inner.build(param_ty.ty).vacuous())
418+
} else {
419+
rty::RefinedType::unrefined(
420+
self.inner
421+
.for_template(self.registry)
422+
.with_scope(&builder)
423+
.build(param_ty.ty),
424+
)
425+
}
422426
}
423427
});
424428
let param_rty = if param_ty.mutbl.is_mut() {

0 commit comments

Comments
 (0)