Reintroduce name resolution check for trying to access locals from an inline const
This commit is contained in:
parent
7717a306b2
commit
bcfefe1c7e
3 changed files with 22 additions and 0 deletions
|
@ -4502,6 +4502,11 @@ 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::Index(ref elem, ref idx, _) => {
|
||||
self.resolve_expr(elem, Some(expr));
|
||||
self.visit_expr(idx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue