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

@ -11,10 +11,6 @@ use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::edition::Edition;
use syntax::feature_gate::UnstableFeatures;
use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName};
use tempfile::Builder as TempFileBuilder;
use testing;
use std::env;
use std::io::prelude::*;
use std::io;
@ -23,6 +19,10 @@ use std::path::PathBuf;
use std::process::Command;
use std::str;
use std::sync::{Arc, Mutex};
use syntax::symbol::sym;
use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName};
use tempfile::Builder as TempFileBuilder;
use testing;
use crate::clean::Attributes;
use crate::config::Options;
@ -137,17 +137,17 @@ fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions {
};
let test_attrs: Vec<_> = krate.attrs.iter()
.filter(|a| a.check_name("doc"))
.filter(|a| a.check_name(sym::doc))
.flat_map(|a| a.meta_item_list().unwrap_or_else(Vec::new))
.filter(|a| a.check_name("test"))
.filter(|a| a.check_name(sym::test))
.collect();
let attrs = test_attrs.iter().flat_map(|a| a.meta_item_list().unwrap_or(&[]));
for attr in attrs {
if attr.check_name("no_crate_inject") {
if attr.check_name(sym::no_crate_inject) {
opts.no_crate_inject = true;
}
if attr.check_name("attr") {
if attr.check_name(sym::attr) {
if let Some(l) = attr.meta_item_list() {
for item in l {
opts.attrs.push(pprust::meta_list_item_to_string(item));