Skip to content

Commit 21b94d5

Browse files
committed
Change typestate to use visit instead of walk
Typestate was failing to check some code because if it saw an item, it would quit immediately. This was to avoid checking nested items in the same context as the lexically enclosing item, but it was having the wrong effect: not checking the code after the item at all. Fixed by switching to visit and skipping over items in a proper nested fashion. Closes #668.
1 parent 0e59493 commit 21b94d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/test/compile-fail/uninit-after-item.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// error-pattern:Unsatisfied precondition constraint (for example, init(bar
2+
// xfail-stage0
3+
fn main() {
4+
auto bar;
5+
fn baz(int x) { }
6+
bind baz(bar);
7+
}
8+

0 commit comments

Comments
 (0)