mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Encode edition within FileId in the hir layer
This commit is contained in:
parent
92268627a8
commit
5264f86242
160 changed files with 1117 additions and 824 deletions
|
@ -469,7 +469,7 @@ impl server::Server for RaSpanServer {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use span::SyntaxContextId;
|
||||
use span::{EditionedFileId, FileId, SyntaxContextId};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
@ -478,7 +478,7 @@ mod tests {
|
|||
let span = Span {
|
||||
range: TextRange::empty(TextSize::new(0)),
|
||||
anchor: span::SpanAnchor {
|
||||
file_id: span::FileId::from_raw(0),
|
||||
file_id: EditionedFileId::current_edition(FileId::from_raw(0)),
|
||||
ast_id: span::ErasedFileAstId::from_raw(0.into()),
|
||||
},
|
||||
ctx: SyntaxContextId::ROOT,
|
||||
|
@ -514,7 +514,7 @@ mod tests {
|
|||
let span = Span {
|
||||
range: TextRange::empty(TextSize::new(0)),
|
||||
anchor: span::SpanAnchor {
|
||||
file_id: span::FileId::from_raw(0),
|
||||
file_id: EditionedFileId::current_edition(FileId::from_raw(0)),
|
||||
ast_id: span::ErasedFileAstId::from_raw(0.into()),
|
||||
},
|
||||
ctx: SyntaxContextId::ROOT,
|
||||
|
|
|
@ -127,7 +127,7 @@ pub(super) mod token_stream {
|
|||
impl<S: Copy + fmt::Debug> TokenStream<S> {
|
||||
pub(crate) fn from_str(src: &str, call_site: S) -> Result<TokenStream<S>, String> {
|
||||
let subtree =
|
||||
mbe::parse_to_token_tree_static_span(span::Edition::CURRENT, call_site, src)
|
||||
mbe::parse_to_token_tree_static_span(span::Edition::CURRENT_FIXME, call_site, src)
|
||||
.ok_or("lexing error")?;
|
||||
|
||||
Ok(TokenStream::with_subtree(subtree))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue