Skip to content

Commit 47e9ab6

Browse files
committed
Introduce ast::proto_bare
Issue rust-lang#1022
1 parent 0e50b3e commit 47e9ab6

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

src/comp/metadata/tyencode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ fn enc_proto(w: io::writer, proto: proto) {
197197
proto_iter. { w.write_char('W'); }
198198
proto_fn. { w.write_char('F'); }
199199
proto_block. { w.write_char('B'); }
200+
proto_bare. { w.write_char('R'); }
200201
}
201202
}
202203

src/comp/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ mod write {
478478
// has iter type and block has block type. This may end up changing.
479479
fn proto_to_ty_proto(proto: ast::proto) -> ast::proto {
480480
ret alt proto {
481-
ast::proto_iter. | ast::proto_block. { proto }
481+
ast::proto_iter. | ast::proto_block. | ast::proto_bare. { proto }
482482
_ { ast::proto_fn }
483483
};
484484
}

src/comp/syntax/ast.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,15 @@ tag kind { kind_pinned; kind_shared; kind_unique; }
102102

103103
tag _auth { auth_unsafe; }
104104

105-
tag proto { proto_iter; proto_fn; proto_block; proto_closure; }
105+
tag proto {
106+
proto_iter;
107+
proto_fn;
108+
proto_block;
109+
proto_closure;
110+
// Functions without an environment. Eventually, this will
111+
// merge with proto_fn.
112+
proto_bare;
113+
}
106114

107115
tag binop {
108116
add;

src/comp/syntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ fn parse_auth(p: parser) -> ast::_auth {
21292129
fn parse_fn_proto(p: parser) -> ast::proto {
21302130
if p.peek() == token::POUND {
21312131
p.bump();
2132-
ast::proto_fn
2132+
ast::proto_bare
21332133
} else {
21342134
ast::proto_fn
21352135
}

src/comp/syntax/print/pprust.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ fn proto_to_str(p: ast::proto) -> str {
16431643
ast::proto_iter. { "iter" }
16441644
ast::proto_block. { "block" }
16451645
ast::proto_closure. { "lambda" }
1646+
ast::proto_bare. { "fn#" }
16461647
};
16471648
}
16481649

0 commit comments

Comments
 (0)