current_where_predicate: Option<&'ast WherePredicate>,
current_type_path: Option<&'ast Ty>,
+
+ /// The current impl items (used to suggest).
+ current_impl_items: Option<&'ast [P<AssocItem>]>,
}
struct LateResolutionVisitor<'a, 'b, 'ast> {
items: ref impl_items,
..
}) => {
+ self.diagnostic_metadata.current_impl_items = Some(impl_items);
self.resolve_implementation(generics, of_trait, &self_ty, item.id, impl_items);
+ self.diagnostic_metadata.current_impl_items = None;
}
ItemKind::Trait(box Trait { ref generics, ref bounds, ref items, .. }) => {
def_id,
instead,
suggestion,
+ path: path.into(),
});
}
def_id,
instead: false,
suggestion: None,
+ path: path.into(),
});
} else {
err.cancel();
);
}
+ fn resolve_inline_const(&mut self, constant: &'ast AnonConst) {
+ debug!("resolve_anon_const {constant:?}");
+ self.with_constant_rib(IsRepeatExpr::No, HasGenericParams::Yes, None, |this| {
+ visit::walk_anon_const(this, constant);
+ });
+ }
+
fn resolve_expr(&mut self, expr: &'ast Expr, parent: Option<&'ast Expr>) {
// First, record candidate traits for this expression if it could
// result in the invocation of a method call.
});
}
ExprKind::ConstBlock(ref ct) => {
- self.resolve_anon_const(ct, IsRepeatExpr::No);
+ self.resolve_inline_const(ct);
}
ExprKind::Index(ref elem, ref idx) => {
self.resolve_expr(elem, Some(expr));