mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Formatting
This commit is contained in:
parent
59087840f5
commit
f356628ad8
5 changed files with 8 additions and 14 deletions
|
@ -140,9 +140,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil
|
|||
}
|
||||
builder.leaf(kind, len);
|
||||
}
|
||||
&Event::Error { ref msg } => builder.error(ErrorMsg {
|
||||
msg: msg.clone(),
|
||||
}),
|
||||
&Event::Error { ref msg } => builder.error(ErrorMsg { msg: msg.clone() }),
|
||||
}
|
||||
}
|
||||
builder.finish()
|
||||
|
|
|
@ -94,7 +94,7 @@ fn item(p: &mut Parser) {
|
|||
|
||||
// test unsafe_auto_trait
|
||||
// unsafe auto trait T {}
|
||||
IDENT if p.at_kw("auto") && la == TRAIT_KW => {
|
||||
IDENT if p.at_contextual_kw("auto") && la == TRAIT_KW => {
|
||||
p.bump_remap(AUTO_KW);
|
||||
traits::trait_item(p);
|
||||
TRAIT_ITEM
|
||||
|
@ -109,7 +109,7 @@ fn item(p: &mut Parser) {
|
|||
|
||||
// test unsafe_default_impl
|
||||
// unsafe default impl Foo {}
|
||||
IDENT if p.at_kw("default") && la == IMPL_KW => {
|
||||
IDENT if p.at_contextual_kw("default") && la == IMPL_KW => {
|
||||
p.bump_remap(DEFAULT_KW);
|
||||
traits::impl_item(p);
|
||||
IMPL_ITEM
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use parser::input::{ParserInput, InputPosition};
|
||||
use parser::input::{InputPosition, ParserInput};
|
||||
use parser::event::Event;
|
||||
|
||||
use SyntaxKind;
|
||||
use syntax_kinds::{TOMBSTONE, EOF};
|
||||
use syntax_kinds::{EOF, TOMBSTONE};
|
||||
|
||||
/// Implementation details of `Parser`, extracted
|
||||
/// to a separate struct in order not to pollute
|
||||
|
@ -29,7 +29,6 @@ impl<'t> ParserImpl<'t> {
|
|||
self.events
|
||||
}
|
||||
|
||||
|
||||
pub(super) fn nth(&self, n: u32) -> SyntaxKind {
|
||||
self.inp.kind(self.pos + n)
|
||||
}
|
||||
|
@ -92,9 +91,9 @@ impl<'t> ParserImpl<'t> {
|
|||
if idx == self.events.len() - 1 {
|
||||
match self.events.pop() {
|
||||
Some(Event::Start {
|
||||
kind: TOMBSTONE,
|
||||
forward_parent: None,
|
||||
}) => (),
|
||||
kind: TOMBSTONE,
|
||||
forward_parent: None,
|
||||
}) => (),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +113,6 @@ impl<'t> ParserImpl<'t> {
|
|||
new_pos
|
||||
}
|
||||
|
||||
|
||||
fn event(&mut self, event: Event) {
|
||||
self.events.push(event)
|
||||
}
|
||||
|
|
|
@ -126,7 +126,6 @@ impl Drop for Marker {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
pub(crate) struct CompletedMarker(u32);
|
||||
|
||||
impl CompletedMarker {
|
||||
|
|
|
@ -22,4 +22,3 @@ macro_rules! token_set {
|
|||
token_set!($($t),*)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue