Change syntax of rc macro

This commit is contained in:
greg 2017-09-13 22:47:25 -07:00
parent 1d9e5edfba
commit 1a3076a949
1 changed files with 2 additions and 2 deletions

View File

@ -648,7 +648,7 @@ mod parse_tests {
use super::ParseError;
macro_rules! rc {
($string:expr) => { Rc::new($string.to_string()) }
($string:tt) => { Rc::new(stringify!($string).to_string()) }
}
macro_rules! parse_test {
@ -707,6 +707,6 @@ mod parse_tests {
#[test]
fn parsing_types() {
parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!("Yolo"), TypeBody(vec![Variant::Singleton(rc!("Yolo"))])))]));
parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!(Yolo), TypeBody(vec![Variant::Singleton(rc!(Yolo))])))]));
}
}