Add hir::Attribute
This commit is contained in:
@@ -44,20 +44,10 @@ pub mod token;
|
||||
pub mod tokenstream;
|
||||
pub mod visit;
|
||||
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
|
||||
pub use self::ast::*;
|
||||
pub use self::ast_traits::{AstDeref, AstNodeWrapper, HasAttrs, HasNodeId, HasTokens};
|
||||
|
||||
/// Requirements for a `StableHashingContext` to be used in this crate.
|
||||
/// This is a hack to allow using the `HashStable_Generic` derive macro
|
||||
/// instead of implementing everything in `rustc_middle`.
|
||||
pub trait HashStableContext: rustc_span::HashStableContext {
|
||||
fn hash_attr(&mut self, _: &ast::Attribute, hasher: &mut StableHasher);
|
||||
}
|
||||
|
||||
impl<AstCtx: crate::HashStableContext> HashStable<AstCtx> for ast::Attribute {
|
||||
fn hash_stable(&self, hcx: &mut AstCtx, hasher: &mut StableHasher) {
|
||||
hcx.hash_attr(self, hasher)
|
||||
}
|
||||
}
|
||||
pub trait HashStableContext: rustc_span::HashStableContext {}
|
||||
|
||||
Reference in New Issue
Block a user