-// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
//! "Collection" is the process of determining the type and other external
//! details of each item in Rust. Collection is specifically concerned
//! with *interprocedural* things -- for example, for a function
use rustc_target::spec::abi;
use syntax::ast;
-use syntax::ast::MetaItemKind;
+use syntax::ast::{Ident, MetaItemKind};
use syntax::attr::{InlineAttr, list_contains_name, mark_used};
use syntax::source_map::Spanned;
use syntax::feature_gate;
fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
let it = tcx.hir().expect_item(item_id);
- debug!("convert: item {} with id {}", it.name, it.id);
+ debug!("convert: item {} with id {}", it.ident, it.id);
let def_id = tcx.hir().local_def_id(item_id);
match it.node {
// These don't define types.
format!("overflowed on value after {}", prev_discr.unwrap()),
).note(&format!(
"explicitly set `{} = {}` if that is desired outcome",
- variant.node.name, wrapped_discr
+ variant.node.ident, wrapped_discr
))
.emit();
None
fn convert_variant<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
did: DefId,
- name: ast::Name,
+ ident: Ident,
discr: ty::VariantDiscr,
def: &hir::VariantData,
adt_kind: ty::AdtKind,
.collect();
ty::VariantDef::new(tcx,
did,
- name,
+ ident,
discr,
fields,
adt_kind,
CtorKind::from_hir(def),
- attribute_def_id)
+ attribute_def_id
+ )
}
fn adt_def<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx ty::AdtDef {
};
distance_from_explicit += 1;
- convert_variant(tcx, did, v.node.name, discr, &v.node.data, AdtKind::Enum,
+ convert_variant(tcx, did, v.node.ident, discr, &v.node.data, AdtKind::Enum,
did)
})
.collect(),
std::iter::once(convert_variant(
tcx,
ctor_id.unwrap_or(def_id),
- item.name,
+ item.ident,
ty::VariantDiscr::Relative(0),
def,
AdtKind::Struct,
std::iter::once(convert_variant(
tcx,
def_id,
- item.name,
+ item.ident,
ty::VariantDiscr::Relative(0),
def,
AdtKind::Union,
Some("sse4a_target_feature") => rust_features.sse4a_target_feature,
Some("tbm_target_feature") => rust_features.tbm_target_feature,
Some("wasm_target_feature") => rust_features.wasm_target_feature,
+ Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
+ Some("adx_target_feature") => rust_features.adx_target_feature,
Some(name) => bug!("unknown target feature gate {}", name),
None => true,
};