mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
chore: Remove legacy SyntaxContextId re-export
This commit is contained in:
parent
60cd01864a
commit
02a793bd59
38 changed files with 164 additions and 228 deletions
|
|
@ -21,7 +21,7 @@ mod benchmark;
|
|||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use span::{Edition, Span, SyntaxContextId};
|
||||
use span::{Edition, Span, SyntaxContext};
|
||||
use syntax_bridge::to_parser_input;
|
||||
use tt::iter::TtIter;
|
||||
use tt::DelimSpan;
|
||||
|
|
@ -149,7 +149,7 @@ impl DeclarativeMacro {
|
|||
/// The old, `macro_rules! m {}` flavor.
|
||||
pub fn parse_macro_rules(
|
||||
tt: &tt::TopSubtree<Span>,
|
||||
ctx_edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
ctx_edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
) -> DeclarativeMacro {
|
||||
// Note: this parsing can be implemented using mbe machinery itself, by
|
||||
// matching against `$($lhs:tt => $rhs:tt);*` pattern, but implementing
|
||||
|
|
@ -189,7 +189,7 @@ impl DeclarativeMacro {
|
|||
pub fn parse_macro2(
|
||||
args: Option<&tt::TopSubtree<Span>>,
|
||||
body: &tt::TopSubtree<Span>,
|
||||
ctx_edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
ctx_edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
) -> DeclarativeMacro {
|
||||
let mut rules = Vec::new();
|
||||
let mut err = None;
|
||||
|
|
@ -262,7 +262,7 @@ impl DeclarativeMacro {
|
|||
|
||||
impl Rule {
|
||||
fn parse(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
src: &mut TtIter<'_, Span>,
|
||||
) -> Result<Self, ParseError> {
|
||||
let (_, lhs) =
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::sync::Arc;
|
|||
|
||||
use arrayvec::ArrayVec;
|
||||
use intern::{sym, Symbol};
|
||||
use span::{Edition, Span, SyntaxContextId};
|
||||
use span::{Edition, Span, SyntaxContext};
|
||||
use tt::iter::{TtElement, TtIter};
|
||||
|
||||
use crate::ParseError;
|
||||
|
|
@ -28,14 +28,14 @@ pub(crate) struct MetaTemplate(pub(crate) Box<[Op]>);
|
|||
|
||||
impl MetaTemplate {
|
||||
pub(crate) fn parse_pattern(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
pattern: TtIter<'_, Span>,
|
||||
) -> Result<Self, ParseError> {
|
||||
MetaTemplate::parse(edition, pattern, Mode::Pattern)
|
||||
}
|
||||
|
||||
pub(crate) fn parse_template(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
template: TtIter<'_, Span>,
|
||||
) -> Result<Self, ParseError> {
|
||||
MetaTemplate::parse(edition, template, Mode::Template)
|
||||
|
|
@ -46,7 +46,7 @@ impl MetaTemplate {
|
|||
}
|
||||
|
||||
fn parse(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
mut src: TtIter<'_, Span>,
|
||||
mode: Mode,
|
||||
) -> Result<Self, ParseError> {
|
||||
|
|
@ -179,7 +179,7 @@ enum Mode {
|
|||
}
|
||||
|
||||
fn next_op(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
first_peeked: TtElement<'_, Span>,
|
||||
src: &mut TtIter<'_, Span>,
|
||||
mode: Mode,
|
||||
|
|
@ -287,7 +287,7 @@ fn next_op(
|
|||
}
|
||||
|
||||
fn eat_fragment_kind(
|
||||
edition: impl Copy + Fn(SyntaxContextId) -> Edition,
|
||||
edition: impl Copy + Fn(SyntaxContext) -> Edition,
|
||||
src: &mut TtIter<'_, Span>,
|
||||
mode: Mode,
|
||||
) -> Result<Option<MetaVarKind>, ParseError> {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// FIXME: Move more of the nameres independent tests from
|
||||
// crates\hir-def\src\macro_expansion_tests\mod.rs to this
|
||||
use expect_test::expect;
|
||||
use span::{Edition, EditionedFileId, ErasedFileAstId, FileId, Span, SpanAnchor, SyntaxContextId};
|
||||
use span::{Edition, EditionedFileId, ErasedFileAstId, FileId, Span, SpanAnchor, SyntaxContext};
|
||||
use stdx::format_to;
|
||||
use tt::{TextRange, TextSize};
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ fn check_(
|
|||
file_id: EditionedFileId::new(FileId::from_raw(0), def_edition),
|
||||
ast_id: ErasedFileAstId::from_raw(0),
|
||||
},
|
||||
SyntaxContextId::root(Edition::CURRENT),
|
||||
SyntaxContext::root(Edition::CURRENT),
|
||||
decl,
|
||||
)
|
||||
.unwrap();
|
||||
|
|
@ -42,7 +42,7 @@ fn check_(
|
|||
let arg_tt = syntax_bridge::parse_to_token_tree(
|
||||
call_edition,
|
||||
call_anchor,
|
||||
SyntaxContextId::root(Edition::CURRENT),
|
||||
SyntaxContext::root(Edition::CURRENT),
|
||||
arg,
|
||||
)
|
||||
.unwrap();
|
||||
|
|
@ -52,7 +52,7 @@ fn check_(
|
|||
Span {
|
||||
range: TextRange::up_to(TextSize::of(arg)),
|
||||
anchor: call_anchor,
|
||||
ctx: SyntaxContextId::root(Edition::CURRENT),
|
||||
ctx: SyntaxContext::root(Edition::CURRENT),
|
||||
},
|
||||
def_edition,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue