about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorMark Mansi <markm@cs.wisc.edu>2019-05-08 13:34:23 -0500
committerMark Mansi <markm@cs.wisc.edu>2019-05-08 13:34:23 -0500
commiteb7d47cba90ac716c84fe720418e58c6eb84ac4e (patch)
treee4d4ba7c8ec3636e2bcaee161bfbb554a9fd8005 /src/libsyntax/ext
parent5db665b972f7c9578fe0fd2bdb9c7aef6f6db3db (diff)
downloadrust-eb7d47cba90ac716c84fe720418e58c6eb84ac4e.tar.gz
rust-eb7d47cba90ac716c84fe720418e58c6eb84ac4e.zip
fix incorrect assert
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index 3a40e8403cc..0cefcf1ce03 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -71,7 +71,10 @@ pub fn transcribe(
     interp: &FxHashMap<Ident, Rc<NamedMatch>>,
     src: Vec<quoted::TokenTree>,
 ) -> TokenStream {
-    assert!(src.len() > 0);
+    // Nothing for us to transcribe...
+    if src.is_empty() {
+        return TokenStream::empty();
+    }
 
     // We descend into the RHS (`src`), expanding things as we go. This stack contains the things
     // we have yet to expand/are still expanding. We start the stack off with the whole RHS.