]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ext/quote.rs
Auto merge of #30641 - tsion:match-range, r=eddyb
[rust.git] / src / libsyntax / ext / quote.rs
index 496f6a429a31fd4cf4f09c3478b9f1c78db73bf1..7a1a207a562a1dd23200ef4d0d54d8220bb80b2f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{self, Arg, Arm, Block, Expr, Item, Pat, Path, Stmt, TokenTree, Ty};
+use ast::{self, Arg, Arm, Block, Expr, Item, Pat, Stmt, TokenTree, Ty};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::base;
@@ -33,7 +33,7 @@ pub mod rt {
     use ptr::P;
     use std::rc::Rc;
 
-    use ast::{TokenTree, Expr};
+    use ast::TokenTree;
 
     pub use parse::new_parser_from_tts;
     pub use codemap::{BytePos, Span, dummy_spanned, DUMMY_SP};
@@ -802,7 +802,7 @@ fn parse_arguments_to_quote(cx: &ExtCtxt, tts: &[TokenTree])
 
     let cx_expr = panictry!(p.parse_expr());
     if !panictry!(p.eat(&token::Comma)) {
-        panic!(p.fatal("expected token `,`"));
+        let _ = p.diagnostic().fatal("expected token `,`");
     }
 
     let tts = panictry!(p.parse_all_token_trees());