name: i.ident.name,
attrs: lower_attrs(lctx, &i.attrs),
vis: lower_visibility(lctx, i.vis),
+ defaultness: lower_defaultness(lctx, i.defaultness),
node: match i.node {
ImplItemKind::Const(ref ty, ref expr) => {
hir::ImplItemKind::Const(lower_ty(lctx, ty), lower_expr(lctx, expr))
dialect,
expn_id,
}) => hir::ExprInlineAsm(hir::InlineAsm {
- inputs: inputs.iter()
- .map(|&(ref c, ref input)| (c.clone(), lower_expr(lctx, input)))
- .collect(),
+ inputs: inputs.iter().map(|&(ref c, _)| c.clone()).collect(),
outputs: outputs.iter()
.map(|out| {
hir::InlineAsmOutput {
constraint: out.constraint.clone(),
- expr: lower_expr(lctx, &out.expr),
is_rw: out.is_rw,
is_indirect: out.is_indirect,
}
alignstack: alignstack,
dialect: dialect,
expn_id: expn_id,
- }),
+ }, outputs.iter().map(|out| lower_expr(lctx, &out.expr)).collect(),
+ inputs.iter().map(|&(_, ref input)| lower_expr(lctx, input)).collect()),
ExprKind::Struct(ref path, ref fields, ref maybe_expr) => {
hir::ExprStruct(lower_path(lctx, path),
fields.iter().map(|x| lower_field(lctx, x)).collect(),
}
}
+pub fn lower_defaultness(_lctx: &LoweringContext, d: Defaultness) -> hir::Defaultness {
+ match d {
+ Defaultness::Default => hir::Defaultness::Default,
+ Defaultness::Final => hir::Defaultness::Final,
+ }
+}
+
pub fn lower_block_check_mode(lctx: &LoweringContext, b: &BlockCheckMode) -> hir::BlockCheckMode {
match *b {
BlockCheckMode::Default => hir::DefaultBlock,