chore: apply AST HasAttrs->AstLike changes

This commit is contained in:
Caleb Cartwright 2021-03-14 13:44:02 -05:00 committed by Caleb Cartwright
parent 83cbdf64be
commit a1dc57ace1
6 changed files with 8 additions and 9 deletions

1
Cargo.lock generated
View File

@ -1285,7 +1285,6 @@ dependencies = [
"regex",
"rustc-ap-rustc_ast",
"rustc-ap-rustc_ast_pretty",
"rustc-ap-rustc_attr",
"rustc-ap-rustc_data_structures",
"rustc-ap-rustc_errors",
"rustc-ap-rustc_expand",

View File

@ -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"

View File

@ -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;

View File

@ -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;

View File

@ -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;
@ -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
}

View File

@ -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::*;