use syntax::attr;
use syntax::source_map::Span;
use syntax::feature_gate::{self, GateIssue};
-use syntax::symbol::{Symbol, sym};
+use syntax::symbol::{kw, sym, Symbol};
use syntax::{span_err, struct_span_err};
pub fn collect(tcx: TyCtxt<'_>) -> Vec<NativeLibrary> {
impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
fn visit_item(&mut self, it: &'tcx hir::Item) {
- let fm = match it.node {
+ let fm = match it.kind {
hir::ItemKind::ForeignMod(ref fm) => fm,
_ => return,
};
impl Collector<'tcx> {
fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLibrary) {
- if lib.name.as_ref().map(|s| s.as_str().is_empty()).unwrap_or(false) {
+ if lib.name.as_ref().map(|&s| s == kw::Invalid).unwrap_or(false) {
match span {
Some(span) => {
struct_span_err!(self.tcx.sess, span, E0454,
sym::link_cfg,
span.unwrap(),
GateIssue::Language,
- "is feature gated");
+ "is unstable");
}
if lib.kind == cstore::NativeStaticNobundle &&
!self.tcx.features().static_nobundle {
sym::static_nobundle,
span.unwrap_or_else(|| syntax_pos::DUMMY_SP),
GateIssue::Language,
- "kind=\"static-nobundle\" is feature gated");
+ "kind=\"static-nobundle\" is unstable");
}
self.libs.push(lib);
}