Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/db.rs')
-rw-r--r--crates/hir-expand/src/db.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/hir-expand/src/db.rs b/crates/hir-expand/src/db.rs
index 5c517e671b..40d44cd1db 100644
--- a/crates/hir-expand/src/db.rs
+++ b/crates/hir-expand/src/db.rs
@@ -237,7 +237,8 @@ pub fn expand_speculative(
span,
DocCommentDesugarMode::ProcMacro,
);
- *tree.top_subtree_delimiter_mut() = tt::Delimiter::invisible_spanned(span);
+ tree.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
+ tree.set_top_subtree_delimiter_span(tt::DelimSpan::from_single(span));
tree
},
)
@@ -255,7 +256,7 @@ pub fn expand_speculative(
span,
DocCommentDesugarMode::ProcMacro,
);
- attr_arg.top_subtree_delimiter_mut().kind = tt::DelimiterKind::Invisible;
+ attr_arg.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
Some(attr_arg)
}
_ => None,
@@ -270,7 +271,8 @@ pub fn expand_speculative(
let mut speculative_expansion = match loc.def.kind {
MacroDefKind::ProcMacro(ast, expander, _) => {
let span = db.proc_macro_span(ast);
- *tt.top_subtree_delimiter_mut() = tt::Delimiter::invisible_spanned(span);
+ tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
+ tt.set_top_subtree_delimiter_span(tt::DelimSpan::from_single(span));
expander.expand(
db,
loc.def.krate,
@@ -430,7 +432,7 @@ fn macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult {
(
Arc::new(tt::TopSubtree::from_token_trees(
tt::Delimiter { open: span, close: span, kind },
- tt::TokenTreesView::new(&[]),
+ tt::TokenTreesView::empty(),
)),
SyntaxFixupUndoInfo::default(),
span,
@@ -478,7 +480,7 @@ fn macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult {
);
if loc.def.is_proc_macro() {
// proc macros expect their inputs without parentheses, MBEs expect it with them included
- tt.top_subtree_delimiter_mut().kind = tt::DelimiterKind::Invisible;
+ tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
}
return (Arc::new(tt), SyntaxFixupUndoInfo::NONE, span);
}
@@ -512,7 +514,7 @@ fn macro_arg(db: &dyn ExpandDatabase, id: MacroCallId) -> MacroArgResult {
if loc.def.is_proc_macro() {
// proc macros expect their inputs without parentheses, MBEs expect it with them included
- tt.top_subtree_delimiter_mut().kind = tt::DelimiterKind::Invisible;
+ tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
}
(Arc::new(tt), undo_info, span)