@@ -44,28 +44,29 @@ impl proto_check of proto::visitor<(), (), ()> for ext_ctxt {
44
44
45
45
fn visit_message ( name : ident , _tys : & [ @ast:: ty ] ,
46
46
this : state , next : next_state ) {
47
- alt next {
48
- some( { state: next, tys: next_tys} ) {
49
- let proto = this. proto ;
50
- if !proto. has_state ( next) {
51
- // This should be a span fatal, but then we need to
52
- // track span information.
53
- self . span_err (
54
- empty_span ( ) ,
55
- #fmt ( "message %s steps to undefined state, %s" ,
56
- * name, * next) ) ;
57
- }
58
-
59
- let next = proto. get_state ( next) ;
60
-
61
- if next. ty_params . len ( ) != next_tys. len ( ) {
47
+ alt next {
48
+ some( { state: next, tys: next_tys} ) {
49
+ let proto = this. proto ;
50
+ if !proto. has_state ( next) {
51
+ // This should be a span fatal, but then we need to
52
+ // track span information.
62
53
self . span_err (
63
- empty_span ( ) , // use a real span
64
- #fmt ( "message %s target (%s) \
65
- needs %u type parameters, but got %u",
66
- * name, * next. name ,
67
- next. ty_params . len ( ) ,
68
- next_tys. len ( ) ) ) ;
54
+ empty_span ( ) ,
55
+ #fmt ( "message %s steps to undefined state, %s" ,
56
+ * name, * next) ) ;
57
+ }
58
+ else {
59
+ let next = proto. get_state ( next) ;
60
+
61
+ if next. ty_params . len ( ) != next_tys. len ( ) {
62
+ self . span_err (
63
+ empty_span ( ) , // use a real span
64
+ #fmt ( "message %s target (%s) \
65
+ needs %u type parameters, but got %u",
66
+ * name, * next. name ,
67
+ next. ty_params . len ( ) ,
68
+ next_tys. len ( ) ) ) ;
69
+ }
69
70
}
70
71
}
71
72
none { }
0 commit comments