Skip to content

Commit

Permalink
chore: apply AST HasAttrs->AstLike changes
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Apr 3, 2021
1 parent 83cbdf6 commit a1dc57a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ version = "709.0.0"
package = "rustc-ap-rustc_ast_pretty"
version = "709.0.0"

[dependencies.rustc_attr]
package = "rustc-ap-rustc_attr"
version = "708.0.0"
# [dependencies.rustc_attr]
# package = "rustc-ap-rustc_attr"
# version = "708.0.0"

[dependencies.rustc_data_structures]
package = "rustc-ap-rustc_data_structures"
Expand Down
2 changes: 1 addition & 1 deletion src/attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Format attributes and meta items.
use rustc_ast::ast;
use rustc_ast::attr::HasAttrs;
use rustc_ast::AstLike;
use rustc_span::{symbol::sym, Span, Symbol};

use self::doc_comment::DocCommentFormatter;
Expand Down
2 changes: 1 addition & 1 deletion src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use std::io::{self, Write};
use std::time::{Duration, Instant};

use rustc_ast::ast;
use rustc_ast::{ast, AstLike};
use rustc_span::Span;

use self::newline_style::apply_newline_style;
Expand Down
4 changes: 2 additions & 2 deletions src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::BTreeMap;
use std::path::{Path, PathBuf};

use rustc_ast::ast;
use rustc_ast::attr::HasAttrs;
use rustc_ast::visit::Visitor;
use rustc_ast::AstLike;
use rustc_span::symbol::{self, sym, Symbol};
use rustc_span::Span;
use thiserror::Error;
Expand Down Expand Up @@ -54,7 +54,7 @@ impl<'a> Module<'a> {
}
}

impl<'a> HasAttrs for Module<'a> {
impl<'a> AstLike for Module<'a> {
fn attrs(&self) -> &[ast::Attribute] {
&self.inner_attr
}
Expand Down
2 changes: 1 addition & 1 deletion src/visitor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::cell::{Cell, RefCell};
use std::rc::Rc;

use rustc_ast::{ast, attr::HasAttrs, token::DelimToken, visit};
use rustc_ast::{ast, token::DelimToken, visit, AstLike};
use rustc_span::{symbol, BytePos, Pos, Span, DUMMY_SP};

use crate::attr::*;
Expand Down

0 comments on commit a1dc57a

Please sign in to comment.