From 738faadc31ea4fdd60cfb81c9c07d7ad499997ab Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 9 Nov 2019 18:28:03 +0100 Subject: [PATCH] Merge hir::IsAuto into ast::IsAuto. --- src/librustc/hir/lowering/item.rs | 9 +-------- src/librustc/hir/mod.rs | 9 +-------- src/librustc/ich/impls_syntax.rs | 1 + 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/librustc/hir/lowering/item.rs b/src/librustc/hir/lowering/item.rs index bf288f271a69..c40834d12de1 100644 --- a/src/librustc/hir/lowering/item.rs +++ b/src/librustc/hir/lowering/item.rs @@ -449,7 +449,7 @@ impl LoweringContext<'_> { .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 @@ impl LoweringContext<'_> { (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, diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 8128beac8415..6f60f7ffdcfc 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -21,7 +21,7 @@ use syntax_pos::{Span, DUMMY_SP, MultiSpan}; 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 @@ impl ImplicitSelfKind { } } -/// 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 { diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index 5919b0454292..075b7409f4f6 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -170,6 +170,7 @@ impl_stable_hash_for!(enum ::syntax::ast::StrStyle { Cooked, Raw(pounds) }); 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> for [ast::Attribute] { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {