Skip to content

Commit eb7d47c

Browse files
committed
fix incorrect assert
1 parent 5db665b commit eb7d47c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libsyntax/ext/tt/transcribe.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ pub fn transcribe(
7171
interp: &FxHashMap<Ident, Rc<NamedMatch>>,
7272
src: Vec<quoted::TokenTree>,
7373
) -> TokenStream {
74-
assert!(src.len() > 0);
74+
// Nothing for us to transcribe...
75+
if src.is_empty() {
76+
return TokenStream::empty();
77+
}
7578

7679
// We descend into the RHS (`src`), expanding things as we go. This stack contains the things
7780
// we have yet to expand/are still expanding. We start the stack off with the whole RHS.

0 commit comments

Comments
 (0)