Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/attrs.rs')
-rw-r--r--crates/hir-expand/src/attrs.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir-expand/src/attrs.rs b/crates/hir-expand/src/attrs.rs
index 686a3ad192..af3ecdcd5e 100644
--- a/crates/hir-expand/src/attrs.rs
+++ b/crates/hir-expand/src/attrs.rs
@@ -7,7 +7,7 @@ use either::Either;
use intern::Interned;
use mbe::{syntax_node_to_token_tree, DelimiterKind, Punct};
use smallvec::{smallvec, SmallVec};
-use span::Span;
+use span::{Span, SyntaxContextId};
use syntax::{ast, match_ast, AstNode, AstToken, SmolStr, SyntaxNode};
use triomphe::Arc;
@@ -53,7 +53,7 @@ impl RawAttrs {
id,
input: Some(Interned::new(AttrInput::Literal(SmolStr::new(doc)))),
path: Interned::new(ModPath::from(crate::name!(doc))),
- span: span_map.span_for_range(comment.syntax().text_range()),
+ ctxt: span_map.span_for_range(comment.syntax().text_range()).ctx,
}),
});
let entries: Arc<[Attr]> = Arc::from_iter(entries);
@@ -173,7 +173,7 @@ pub struct Attr {
pub id: AttrId,
pub path: Interned<ModPath>,
pub input: Option<Interned<AttrInput>>,
- pub span: Span,
+ pub ctxt: SyntaxContextId,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -219,11 +219,11 @@ impl Attr {
} else {
None
};
- Some(Attr { id, path, input, span })
+ Some(Attr { id, path, input, ctxt: span.ctx })
}
fn from_tt(db: &dyn ExpandDatabase, tt: &[tt::TokenTree], id: AttrId) -> Option<Attr> {
- let span = tt.first()?.first_span();
+ let ctxt = tt.first()?.first_span().ctx;
let path_end = tt
.iter()
.position(|tt| {
@@ -255,7 +255,7 @@ impl Attr {
}
_ => None,
};
- Some(Attr { id, path, input, span })
+ Some(Attr { id, path, input, ctxt })
}
pub fn path(&self) -> &ModPath {