allow rustfmt to reorder imports

This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway
This commit is contained in:
Aleksey Kladov 2019-07-04 23:05:17 +03:00
parent 2b2cd829b0
commit 1834bae5b8
166 changed files with 798 additions and 814 deletions

View file

@ -41,14 +41,8 @@ pub enum ExpandError {
}
pub use crate::syntax_bridge::{
ast_to_token_tree,
token_tree_to_ast_item_list,
syntax_node_to_token_tree,
token_tree_to_expr,
token_tree_to_pat,
token_tree_to_ty,
token_tree_to_macro_items,
token_tree_to_macro_stmts,
ast_to_token_tree, syntax_node_to_token_tree, token_tree_to_ast_item_list, token_tree_to_expr,
token_tree_to_macro_items, token_tree_to_macro_stmts, token_tree_to_pat, token_tree_to_ty,
};
/// This struct contains AST for a single `macro_rules` definition. What might

View file

@ -1,12 +1,12 @@
use ra_syntax::SmolStr;
/// This module takes a (parsed) definition of `macro_rules` invocation, a
/// `tt::TokenTree` representing an argument of macro invocation, and produces a
/// `tt::TokenTree` for the result of the expansion.
use rustc_hash::FxHashMap;
use ra_syntax::SmolStr;
use tt::TokenId;
use crate::ExpandError;
use crate::tt_cursor::TtCursor;
use crate::ExpandError;
pub(crate) fn expand(
rules: &crate::MacroRules,

View file

@ -1,8 +1,8 @@
use crate::tt_cursor::TtCursor;
/// This module parses a raw `tt::TokenStream` into macro-by-example token
/// stream. This is a *mostly* identify function, expect for handling of
/// `$var:tt_kind` and `$(repeat),*` constructs.
use crate::ParseError;
use crate::tt_cursor::TtCursor;
pub(crate) fn parse(tt: &tt::Subtree) -> Result<crate::MacroRules, ParseError> {
let mut parser = TtCursor::new(tt);

View file

@ -1,8 +1,8 @@
use crate::subtree_source::SubtreeTokenSource;
use ra_parser::{TokenSource, TreeSink};
use ra_syntax::{SyntaxKind};
use tt::buffer::{TokenBuffer, Cursor};
use ra_syntax::SyntaxKind;
use tt::buffer::{Cursor, TokenBuffer};
struct OffsetTokenSink<'a> {
cursor: Cursor<'a>,

View file

@ -1,7 +1,7 @@
use ra_parser::{TokenSource, Token};
use ra_parser::{Token, TokenSource};
use ra_syntax::{classify_literal, SmolStr, SyntaxKind, SyntaxKind::*, T};
use std::cell::{RefCell, Cell};
use tt::buffer::{TokenBuffer, Cursor};
use std::cell::{Cell, RefCell};
use tt::buffer::{Cursor, TokenBuffer};
#[derive(Debug, Clone, Eq, PartialEq)]
struct TtToken {

View file

@ -1,11 +1,11 @@
use ra_parser::{TreeSink, ParseError};
use ra_syntax::{
AstNode, SyntaxNode, TextRange, SyntaxKind, SmolStr, SyntaxTreeBuilder, TreeArc, SyntaxElement,
ast, SyntaxKind::*, TextUnit, T
};
use tt::buffer::{TokenBuffer, Cursor};
use crate::subtree_source::{SubtreeTokenSource};
use crate::subtree_source::SubtreeTokenSource;
use crate::ExpandError;
use ra_parser::{ParseError, TreeSink};
use ra_syntax::{
ast, AstNode, SmolStr, SyntaxElement, SyntaxKind, SyntaxKind::*, SyntaxNode, SyntaxTreeBuilder,
TextRange, TextUnit, TreeArc, T,
};
use tt::buffer::{Cursor, TokenBuffer};
/// Maps `tt::TokenId` to the relative range of the original token.
#[derive(Default)]
@ -367,7 +367,7 @@ impl<'a> TreeSink for TtTreeSink<'a> {
#[cfg(test)]
mod tests {
use super::*;
use crate::tests::{expand, create_rules};
use crate::tests::{create_rules, expand};
use ra_parser::TokenSource;
#[test]

View file

@ -1,6 +1,6 @@
use crate::ParseError;
use crate::subtree_parser::Parser;
use smallvec::{SmallVec, smallvec};
use crate::ParseError;
use smallvec::{smallvec, SmallVec};
#[derive(Debug, Clone)]
pub(crate) struct TtCursor<'a> {