diff options
| author | bors <bors@rust-lang.org> | 2021-02-27 07:52:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-27 07:52:11 +0000 |
| commit | 8e863eb59a10fb0900d7377524a0dc7bf44b9ae3 (patch) | |
| tree | 3e21f786845776476c5960608e53edec8efbe82a /compiler/rustc_lint/src | |
| parent | 0846043440b480e4bbf36ac19db3948f0c835bb1 (diff) | |
| parent | fb5fec017b2f24b88c1f51980f7d81a02e7468d9 (diff) | |
| download | rust-8e863eb59a10fb0900d7377524a0dc7bf44b9ae3.tar.gz rust-8e863eb59a10fb0900d7377524a0dc7bf44b9ae3.zip | |
Auto merge of #82448 - Aaron1011:merge-hastokens-hasattrs, r=petrochenkov
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.
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/early.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 71017fcde87..4258a4b4237 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -24,7 +24,7 @@ use crate::{ types::{transparent_newtype_field, CItemKind}, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext, }; -use rustc_ast::attr::{self, HasAttrs}; +use rustc_ast::attr; use rustc_ast::tokenstream::{TokenStream, TokenTree}; use rustc_ast::visit::{FnCtxt, FnKind}; use rustc_ast::{self as ast, *}; diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs index cc3bf4095fd..0c7b843831a 100644 --- a/compiler/rustc_lint/src/early.rs +++ b/compiler/rustc_lint/src/early.rs @@ -18,7 +18,7 @@ use crate::context::{EarlyContext, LintContext, LintStore}; use crate::passes::{EarlyLintPass, EarlyLintPassObject}; use rustc_ast as ast; use rustc_ast::visit as ast_visit; -use rustc_attr::HasAttrs; +use rustc_ast::AstLike; use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass}; use rustc_session::Session; use rustc_span::symbol::Ident; |
