Merge hir::Constness into ast::Constness.
This commit is contained in:
parent
ed640c6a27
commit
1f21c080eb
2 changed files with 3 additions and 16 deletions
|
|
@ -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<Constness>) -> 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,
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue