Skip to content

Commit ca5c694

Browse files
committed
Pulled walk_fn() into Var mode, extended test
1 parent 1434715 commit ca5c694

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/librustc/middle/check_const.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
251251
b: &'v ast::Block,
252252
s: Span,
253253
fn_id: ast::NodeId) {
254-
self.with_mode(Mode::Var, |v| v.with_euv(Some(fn_id),
255-
|euv| euv.walk_fn(fd, b)));
256-
visit::walk_fn(self, fk, fd, b, s);
254+
self.with_mode(Mode::Var, |v| {
255+
v.with_euv(Some(fn_id), |euv| euv.walk_fn(fd, b));
256+
visit::walk_fn(v, fk, fd, b, s);
257+
})
257258
}
258259

259260
fn visit_pat(&mut self, p: &ast::Pat) {

src/test/run-pass/issue-25180.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212

1313
const x: &'static Fn() = &|| println!("ICE here");
1414

15-
fn main() {}
15+
fn main() {
16+
x()
17+
}
1618

0 commit comments

Comments
 (0)