Skip to content

Commit b173b42

Browse files
refactor: rename libsyntax --> rustc_ast
1 parent c1a66e1 commit b173b42

29 files changed

+70
-70
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ lazy_static = "1.0.0"
6363
# for more information.
6464
rustc-workspace-hack = "1.0.0"
6565

66+
[dependencies.rustc_ast]
67+
package = "rustc-ap-rustc_ast"
68+
version = "650.0.0"
69+
6670
[dependencies.rustc_ast_pretty]
6771
package = "rustc-ap-rustc_ast_pretty"
6872
version = "650.0.0"
@@ -94,7 +98,3 @@ version = "650.0.0"
9498
[dependencies.rustc_target]
9599
package = "rustc-ap-rustc_target"
96100
version = "650.0.0"
97-
98-
[dependencies.syntax]
99-
package = "rustc-ap-rustc_ast"
100-
version = "650.0.0"

src/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Format attributes and meta items.
22
3+
use rustc_ast::ast;
34
use rustc_span::{symbol::sym, BytePos, Span, DUMMY_SP};
4-
use syntax::ast;
55

66
use self::doc_comment::DocCommentFormatter;
77
use crate::comment::{contains_comment, rewrite_doc_comment, CommentStyle};

src/chains.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
use std::borrow::Cow;
5959
use std::cmp::min;
6060

61+
use rustc_ast::{ast, ptr};
6162
use rustc_span::{BytePos, Span};
62-
use syntax::{ast, ptr};
6363

6464
use crate::comment::{rewrite_comment, CharClasses, FullCodeCharKind, RichChar};
6565
use crate::config::IndentStyle;

src/closures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use rustc_ast::{ast, ptr};
12
use rustc_span::Span;
2-
use syntax::{ast, ptr};
33

44
use crate::attr::get_attrs_from_stmt;
55
use crate::config::lists::*;

src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::borrow::Cow;
22
use std::cmp::min;
33

44
use itertools::Itertools;
5+
use rustc_ast::token::{DelimToken, LitKind};
6+
use rustc_ast::{ast, ptr};
57
use rustc_span::{BytePos, Span};
6-
use syntax::token::{DelimToken, LitKind};
7-
use syntax::{ast, ptr};
88

99
use crate::chains::rewrite_chain;
1010
use crate::closures;
@@ -1314,7 +1314,7 @@ pub(crate) fn can_be_overflowed_expr(
13141314
}
13151315
ast::ExprKind::MacCall(ref mac) => {
13161316
match (
1317-
syntax::ast::MacDelimiter::from_token(mac.args.delim()),
1317+
rustc_ast::ast::MacDelimiter::from_token(mac.args.delim()),
13181318
context.config.overflow_delimited_expr(),
13191319
) {
13201320
(Some(ast::MacDelimiter::Bracket), true)

src/formatting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::collections::HashMap;
44
use std::io::{self, Write};
55
use std::time::{Duration, Instant};
66

7+
use rustc_ast::ast;
78
use rustc_span::Span;
8-
use syntax::ast;
99

1010
use self::newline_style::apply_newline_style;
1111
use crate::comment::{CharClasses, FullCodeCharKind};
@@ -29,7 +29,7 @@ impl<'b, T: Write + 'b> Session<'b, T> {
2929
return Err(ErrorKind::VersionMismatch);
3030
}
3131

32-
syntax::with_globals(self.config.edition().to_libsyntax_pos_edition(), || {
32+
rustc_ast::with_globals(self.config.edition().to_libsyntax_pos_edition(), || {
3333
if self.config.disable_all_formatting() {
3434
// When the input is from stdin, echo back the input.
3535
if let Input::Text(ref buf) = input {

src/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::borrow::Cow;
22
use std::cmp::Ordering;
33
use std::fmt;
44

5+
use rustc_ast::ast::{self, UseTreeKind};
56
use rustc_span::{source_map, symbol::sym, BytePos, Span, DUMMY_SP};
6-
use syntax::ast::{self, UseTreeKind};
77

88
use crate::comment::combine_strs_with_missing_comments;
99
use crate::config::lists::*;

src/items.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::borrow::Cow;
44
use std::cmp::{max, min, Ordering};
55

66
use regex::Regex;
7+
use rustc_ast::visit;
8+
use rustc_ast::{ast, ptr};
79
use rustc_span::{source_map, symbol, BytePos, Span, DUMMY_SP};
8-
use syntax::visit;
9-
use syntax::{ast, ptr};
1010

1111
use crate::attr::filter_inline_attrs;
1212
use crate::comment::{
@@ -594,7 +594,7 @@ impl<'a> FmtVisitor<'a> {
594594
self.buffer.clear();
595595
}
596596

597-
fn is_type(ty: &Option<syntax::ptr::P<ast::Ty>>) -> bool {
597+
fn is_type(ty: &Option<rustc_ast::ptr::P<ast::Ty>>) -> bool {
598598
match ty {
599599
None => true,
600600
Some(lty) => match lty.kind.opaque_top_hack() {
@@ -604,7 +604,7 @@ impl<'a> FmtVisitor<'a> {
604604
}
605605
}
606606

607-
fn is_opaque(ty: &Option<syntax::ptr::P<ast::Ty>>) -> bool {
607+
fn is_opaque(ty: &Option<rustc_ast::ptr::P<ast::Ty>>) -> bool {
608608
match ty {
609609
None => false,
610610
Some(lty) => match lty.kind.opaque_top_hack() {
@@ -615,15 +615,15 @@ impl<'a> FmtVisitor<'a> {
615615
}
616616

617617
fn both_type(
618-
a: &Option<syntax::ptr::P<ast::Ty>>,
619-
b: &Option<syntax::ptr::P<ast::Ty>>,
618+
a: &Option<rustc_ast::ptr::P<ast::Ty>>,
619+
b: &Option<rustc_ast::ptr::P<ast::Ty>>,
620620
) -> bool {
621621
is_type(a) && is_type(b)
622622
}
623623

624624
fn both_opaque(
625-
a: &Option<syntax::ptr::P<ast::Ty>>,
626-
b: &Option<syntax::ptr::P<ast::Ty>>,
625+
a: &Option<rustc_ast::ptr::P<ast::Ty>>,
626+
b: &Option<rustc_ast::ptr::P<ast::Ty>>,
627627
) -> bool {
628628
is_opaque(a) && is_opaque(b)
629629
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::rc::Rc;
1919

2020
use failure::Fail;
2121
use ignore;
22-
use syntax::ast;
22+
use rustc_ast::ast;
2323

2424
use crate::comment::LineClasses;
2525
use crate::emitter::Emitter;

src/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
use std::collections::HashMap;
1313
use std::panic::{catch_unwind, AssertUnwindSafe};
1414

15+
use rustc_ast::token::{BinOpToken, DelimToken, Token, TokenKind};
16+
use rustc_ast::tokenstream::{Cursor, TokenStream, TokenTree};
17+
use rustc_ast::{ast, ptr};
1518
use rustc_ast_pretty::pprust;
1619
use rustc_parse::{new_parser_from_tts, parser::Parser};
1720
use rustc_span::{symbol::kw, BytePos, Span, Symbol, DUMMY_SP};
18-
use syntax::token::{BinOpToken, DelimToken, Token, TokenKind};
19-
use syntax::tokenstream::{Cursor, TokenStream, TokenTree};
20-
use syntax::{ast, ptr};
2121

2222
use crate::comment::{
2323
contains_comment, CharClasses, FindUncommented, FullCodeCharKind, LineClasses,

0 commit comments

Comments
 (0)