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,