Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 86b968b

Browse files
committed
Add a check
1 parent b9c5d23 commit 86b968b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/mbe/src/syntax_bridge.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Conversions between [`SyntaxNode`] and [`tt::TokenTree`].
22
33
use rustc_hash::{FxHashMap, FxHashSet};
4-
use stdx::non_empty_vec::NonEmptyVec;
4+
use stdx::{non_empty_vec::NonEmptyVec, always};
55
use syntax::{
66
ast::{self, make::tokens::doc_comment},
77
AstToken, Parse, PreorderWithTokens, SmolStr, SyntaxElement, SyntaxKind,
@@ -30,6 +30,8 @@ pub fn syntax_node_to_token_tree_censored(
3030
let mut c = Convertor::new(node, global_offset, replace, append);
3131
let subtree = convert_tokens(&mut c);
3232
c.id_alloc.map.shrink_to_fit();
33+
always!(c.replace.is_empty());
34+
always!(c.append.is_empty());
3335
(subtree, c.id_alloc.map)
3436
}
3537

0 commit comments

Comments
 (0)