Skip to content

Commit 1f21c08

Browse files
committed
Merge hir::Constness into ast::Constness.
1 parent ed640c6 commit 1f21c08

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/librustc/hir/lowering/item.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use smallvec::SmallVec;
1919
use syntax::attr;
2020
use syntax::ast::*;
2121
use syntax::visit::{self, Visitor};
22-
use syntax::source_map::{respan, DesugaringKind, Spanned};
22+
use syntax::source_map::{respan, DesugaringKind};
2323
use syntax::symbol::{kw, sym};
2424
use syntax_pos::Span;
2525

@@ -1286,7 +1286,7 @@ impl LoweringContext<'_> {
12861286
hir::FnHeader {
12871287
unsafety: self.lower_unsafety(h.unsafety),
12881288
asyncness: self.lower_asyncness(h.asyncness.node),
1289-
constness: self.lower_constness(h.constness),
1289+
constness: h.constness.node,
12901290
abi: self.lower_abi(h.abi),
12911291
}
12921292
}
@@ -1318,13 +1318,6 @@ impl LoweringContext<'_> {
13181318
}
13191319
}
13201320

1321-
fn lower_constness(&mut self, c: Spanned<Constness>) -> hir::Constness {
1322-
match c.node {
1323-
Constness::Const => hir::Constness::Const,
1324-
Constness::NotConst => hir::Constness::NotConst,
1325-
}
1326-
}
1327-
13281321
fn lower_asyncness(&mut self, a: IsAsync) -> hir::IsAsync {
13291322
match a {
13301323
IsAsync::Async { .. } => hir::IsAsync::Async,

src/librustc/hir/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use syntax_pos::{Span, DUMMY_SP, MultiSpan};
2222
use syntax::source_map::Spanned;
2323
use syntax::ast::{self, CrateSugar, Ident, Name, NodeId, AsmDialect};
2424
use syntax::ast::{Attribute, Label, LitKind, StrStyle, FloatTy, IntTy, UintTy};
25-
pub use syntax::ast::Mutability;
25+
pub use syntax::ast::{Mutability, Constness};
2626
use syntax::attr::{InlineAttr, OptimizeAttr};
2727
use syntax::symbol::{Symbol, kw};
2828
use syntax::tokenstream::TokenStream;
@@ -2170,12 +2170,6 @@ impl Unsafety {
21702170
}
21712171
}
21722172

2173-
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
2174-
pub enum Constness {
2175-
Const,
2176-
NotConst,
2177-
}
2178-
21792173
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
21802174
pub enum Defaultness {
21812175
Default { has_value: bool },

0 commit comments

Comments
 (0)