Combine HasAttrs and HasTokens into AstLike
When token-based attribute handling is implemeneted in #80689, we will need to access tokens from `HasAttrs` (to perform cfg-stripping), and we will to access attributes from `HasTokens` (to construct a `PreexpTokenStream`). This PR merges the `HasAttrs` and `HasTokens` traits into a new `AstLike` trait. The previous `HasAttrs` impls from `Vec<Attribute>` and `AttrVec` are removed - they aren't attribute targets, so the impls never really made sense.
This commit is contained in:
parent
9fa580b117
commit
fb5fec017b
13 changed files with 264 additions and 206 deletions
|
@ -40,6 +40,7 @@ pub mod util {
|
|||
}
|
||||
|
||||
pub mod ast;
|
||||
pub mod ast_like;
|
||||
pub mod attr;
|
||||
pub mod crate_disambiguator;
|
||||
pub mod entry;
|
||||
|
@ -52,6 +53,7 @@ pub mod tokenstream;
|
|||
pub mod visit;
|
||||
|
||||
pub use self::ast::*;
|
||||
pub use self::ast_like::AstLike;
|
||||
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue