Fix parsing of interpolated paths
This commit is contained in:
parent
371be3c6c4
commit
9bed0ddb0e
@ -566,7 +566,8 @@ impl Parser {
|
||||
self.parse_borrowed_pointee()
|
||||
} else if self.token_is_fn_keyword(self.token) {
|
||||
self.parse_ty_fn(None, None)
|
||||
} else if self.token == token::MOD_SEP || is_ident(self.token) {
|
||||
} else if self.token == token::MOD_SEP
|
||||
|| is_ident_or_path(self.token) {
|
||||
let path = self.parse_path_with_tps(colons_before_params);
|
||||
ty_path(path, self.get_id())
|
||||
} else { self.fatal(~"expected type"); };
|
||||
|
16
src/test/run-pass/macro-path.rs
Normal file
16
src/test/run-pass/macro-path.rs
Normal file
@ -0,0 +1,16 @@
|
||||
mod m {
|
||||
pub type t = int;
|
||||
}
|
||||
|
||||
fn macros() {
|
||||
macro_rules! foo {
|
||||
($p:path) => {
|
||||
fn f() -> $p { 10 }
|
||||
f()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert foo!(m::t) == 10;
|
||||
}
|
Loading…
Reference in New Issue
Block a user