diff --git a/src/librustc/hir/lowering/item.rs b/src/librustc/hir/lowering/item.rs index 10c2342919ec..2d03e92139e4 100644 --- a/src/librustc/hir/lowering/item.rs +++ b/src/librustc/hir/lowering/item.rs @@ -19,7 +19,7 @@ use smallvec::SmallVec; use syntax::attr; use syntax::ast::*; use syntax::visit::{self, Visitor}; -use syntax::source_map::{respan, DesugaringKind, Spanned}; +use syntax::source_map::{respan, DesugaringKind}; use syntax::symbol::{kw, sym}; use syntax_pos::Span; @@ -1286,7 +1286,7 @@ impl LoweringContext<'_> { hir::FnHeader { unsafety: self.lower_unsafety(h.unsafety), asyncness: self.lower_asyncness(h.asyncness.node), - constness: self.lower_constness(h.constness), + constness: h.constness.node, abi: self.lower_abi(h.abi), } } @@ -1318,13 +1318,6 @@ impl LoweringContext<'_> { } } - fn lower_constness(&mut self, c: Spanned) -> hir::Constness { - match c.node { - Constness::Const => hir::Constness::Const, - Constness::NotConst => hir::Constness::NotConst, - } - } - fn lower_asyncness(&mut self, a: IsAsync) -> hir::IsAsync { match a { IsAsync::Async { .. } => hir::IsAsync::Async, diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 43f1844b9538..63d4ba6d8b75 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -22,7 +22,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; +pub use syntax::ast::{Mutability, Constness}; use syntax::attr::{InlineAttr, OptimizeAttr}; use syntax::symbol::{Symbol, kw}; use syntax::tokenstream::TokenStream; @@ -2170,12 +2170,6 @@ impl Unsafety { } } -#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)] -pub enum Constness { - Const, - NotConst, -} - #[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)] pub enum Defaultness { Default { has_value: bool },