Revert "Create const block DefIds in typeck instead of ast lowering"
This reverts commit ddc5f9b6c1
.
This commit is contained in:
parent
92c54db22f
commit
cbee17d502
39 changed files with 190 additions and 168 deletions
|
@ -340,6 +340,16 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
|
|||
ExprKind::Gen(_, _, _) => {
|
||||
self.create_def(expr.id, kw::Empty, DefKind::Closure, expr.span)
|
||||
}
|
||||
ExprKind::ConstBlock(ref constant) => {
|
||||
let def = self.create_def(
|
||||
constant.id,
|
||||
kw::Empty,
|
||||
DefKind::InlineConst,
|
||||
constant.value.span,
|
||||
);
|
||||
self.with_parent(def, |this| visit::walk_anon_const(this, constant));
|
||||
return;
|
||||
}
|
||||
_ => self.parent_def,
|
||||
};
|
||||
|
||||
|
|
|
@ -4535,10 +4535,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
self.visit_expr(elem);
|
||||
self.resolve_anon_const(ct, AnonConstKind::ConstArg(IsRepeatExpr::Yes));
|
||||
}
|
||||
ExprKind::ConstBlock(ref expr) => {
|
||||
self.resolve_anon_const_manual(false, AnonConstKind::InlineConst, |this| {
|
||||
this.visit_expr(expr)
|
||||
});
|
||||
ExprKind::ConstBlock(ref ct) => {
|
||||
self.resolve_anon_const(ct, AnonConstKind::InlineConst);
|
||||
}
|
||||
ExprKind::Index(ref elem, ref idx, _) => {
|
||||
self.resolve_expr(elem, Some(expr));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue