Merge hir::IsAuto into ast::IsAuto.

This commit is contained in:
Camille GILLOT 2019-11-09 18:28:03 +01:00
parent cb233f5420
commit 738faadc31
3 changed files with 3 additions and 16 deletions

View File

@ -449,7 +449,7 @@ fn lower_item_kind(
.map(|item| self.lower_trait_item_ref(item))
.collect();
hir::ItemKind::Trait(
self.lower_is_auto(is_auto),
is_auto,
unsafety,
self.lower_generics(generics, ImplTraitContext::disallowed()),
bounds,
@ -1275,13 +1275,6 @@ fn lower_method_sig(
(generics, hir::FnSig { header, decl })
}
fn lower_is_auto(&mut self, a: IsAuto) -> hir::IsAuto {
match a {
IsAuto::Yes => hir::IsAuto::Yes,
IsAuto::No => hir::IsAuto::No,
}
}
fn lower_fn_header(&mut self, h: FnHeader) -> hir::FnHeader {
hir::FnHeader {
unsafety: h.unsafety,

View File

@ -21,7 +21,7 @@
use syntax::source_map::Spanned;
use syntax::ast::{self, CrateSugar, Ident, Name, NodeId, AsmDialect};
use syntax::ast::{Attribute, Label, LitKind, StrStyle, FloatTy, IntTy, UintTy};
pub use syntax::ast::{Mutability, Constness, Unsafety, Movability, CaptureBy};
pub use syntax::ast::{Mutability, Constness, Unsafety, Movability, CaptureBy, IsAuto};
use syntax::attr::{InlineAttr, OptimizeAttr};
use syntax::symbol::{Symbol, kw};
use syntax::tokenstream::TokenStream;
@ -2122,13 +2122,6 @@ pub fn has_implicit_self(&self) -> bool {
}
}
/// Is the trait definition an auto trait?
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
pub enum IsAuto {
Yes,
No
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, HashStable,
Ord, RustcEncodable, RustcDecodable, Debug)]
pub enum IsAsync {

View File

@ -170,6 +170,7 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
impl_stable_hash_for!(enum ::syntax::ast::AttrStyle { Outer, Inner });
impl_stable_hash_for!(enum ::syntax::ast::Movability { Static, Movable });
impl_stable_hash_for!(enum ::syntax::ast::CaptureBy { Value, Ref });
impl_stable_hash_for!(enum ::syntax::ast::IsAuto { Yes, No });
impl<'a> HashStable<StableHashingContext<'a>> for [ast::Attribute] {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {