Pass a Symbol to check_name, emit_feature_err, and related functions.

This commit is contained in:
Nicholas Nethercote
2019-05-08 13:21:18 +10:00
parent 79602c87b5
commit fb084a48e2
114 changed files with 671 additions and 621 deletions

View File

@@ -23,6 +23,7 @@ extern crate rustc;
use rustc::ty::TyCtxt;
use rustc::hir::def_id::LOCAL_CRATE;
use syntax::symbol::sym;
pub mod link;
pub mod codegen_backend;
@@ -35,7 +36,7 @@ pub mod symbol_names_test;
/// reporting an error.
pub fn check_for_rustc_errors_attr(tcx: TyCtxt<'_, '_, '_>) {
if let Some((def_id, _)) = tcx.entry_fn(LOCAL_CRATE) {
if tcx.has_attr(def_id, "rustc_error") {
if tcx.has_attr(def_id, sym::rustc_error) {
tcx.sess.span_fatal(tcx.def_span(def_id), "compilation successful");
}
}