1
Fork 0

Plumb dyn trait representation through ty::Dynamic

This commit is contained in:
Eric Holk 2022-04-13 16:11:28 -07:00
parent eff35e59c6
commit 6c01273a15
29 changed files with 110 additions and 57 deletions

View file

@ -544,7 +544,7 @@ pub struct TraitObjectVisitor(pub FxHashSet<DefId>);
impl<'tcx> TypeVisitor<'tcx> for TraitObjectVisitor {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
match t.kind() {
ty::Dynamic(preds, re) if re.is_static() => {
ty::Dynamic(preds, re, _) if re.is_static() => {
if let Some(def_id) = preds.principal_def_id() {
self.0.insert(def_id);
}