We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 371be3c commit 9bed0ddCopy full SHA for 9bed0dd
src/libsyntax/parse/parser.rs
@@ -566,7 +566,8 @@ impl Parser {
566
self.parse_borrowed_pointee()
567
} else if self.token_is_fn_keyword(self.token) {
568
self.parse_ty_fn(None, None)
569
- } else if self.token == token::MOD_SEP || is_ident(self.token) {
+ } else if self.token == token::MOD_SEP
570
+ || is_ident_or_path(self.token) {
571
let path = self.parse_path_with_tps(colons_before_params);
572
ty_path(path, self.get_id())
573
} else { self.fatal(~"expected type"); };
src/test/run-pass/macro-path.rs
@@ -0,0 +1,16 @@
1
+mod m {
2
+ pub type t = int;
3
+}
4
+
5
+fn macros() {
6
+ macro_rules! foo {
7
+ ($p:path) => {
8
+ fn f() -> $p { 10 }
9
+ f()
10
+ }
11
12
13
14
+fn main() {
15
+ assert foo!(m::t) == 10;
16
0 commit comments