remove Tt
prefix from TokenType variants
[breaking change]
This commit is contained in:
parent
1be3f9f602
commit
fcc7067904
15 changed files with 219 additions and 209 deletions
|
@ -54,7 +54,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
|
|||
token_tree: &[TokenTree])
|
||||
-> Box<MacResult+'cx> {
|
||||
let code = match (token_tree.len(), token_tree.get(0)) {
|
||||
(1, Some(&ast::TtToken(_, token::Ident(code, _)))) => code,
|
||||
(1, Some(&TokenTree::Token(_, token::Ident(code, _)))) => code,
|
||||
_ => unreachable!()
|
||||
};
|
||||
|
||||
|
@ -92,12 +92,12 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
|
|||
token_tree.get(1),
|
||||
token_tree.get(2)
|
||||
) {
|
||||
(1, Some(&ast::TtToken(_, token::Ident(ref code, _))), None, None) => {
|
||||
(1, Some(&TokenTree::Token(_, token::Ident(ref code, _))), None, None) => {
|
||||
(code, None)
|
||||
},
|
||||
(3, Some(&ast::TtToken(_, token::Ident(ref code, _))),
|
||||
Some(&ast::TtToken(_, token::Comma)),
|
||||
Some(&ast::TtToken(_, token::Literal(token::StrRaw(description, _), None)))) => {
|
||||
(3, Some(&TokenTree::Token(_, token::Ident(ref code, _))),
|
||||
Some(&TokenTree::Token(_, token::Comma)),
|
||||
Some(&TokenTree::Token(_, token::Literal(token::StrRaw(description, _), None)))) => {
|
||||
(code, Some(description))
|
||||
}
|
||||
_ => unreachable!()
|
||||
|
@ -160,9 +160,9 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
|
|||
let (crate_name, name) = match (&token_tree[0], &token_tree[2]) {
|
||||
(
|
||||
// Crate name.
|
||||
&ast::TtToken(_, token::Ident(ref crate_name, _)),
|
||||
&TokenTree::Token(_, token::Ident(ref crate_name, _)),
|
||||
// DIAGNOSTICS ident.
|
||||
&ast::TtToken(_, token::Ident(ref name, _))
|
||||
&TokenTree::Token(_, token::Ident(ref name, _))
|
||||
) => (*&crate_name, name),
|
||||
_ => unreachable!()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue