diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-08 13:21:18 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-13 09:29:22 +1000 |
| commit | fb084a48e2ca663de41b316dc6ece2dceb93e24e (patch) | |
| tree | b78379f996dceee6039ea4880c66e7fe30b3efad /src/libsyntax/test.rs | |
| parent | 79602c87b561e26fa1a8fe58b9130cca37375f90 (diff) | |
| download | rust-fb084a48e2ca663de41b316dc6ece2dceb93e24e.tar.gz rust-fb084a48e2ca663de41b316dc6ece2dceb93e24e.zip | |
Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.
Diffstat (limited to 'src/libsyntax/test.rs')
| -rw-r--r-- | src/libsyntax/test.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 03d0eff266e..8e5e594ce9a 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -29,7 +29,7 @@ use crate::parse::{token, ParseSess}; use crate::print::pprust; use crate::ast::{self, Ident}; use crate::ptr::P; -use crate::symbol::{self, Symbol, keywords}; +use crate::symbol::{self, Symbol, keywords, sym}; use crate::ThinVec; struct Test { @@ -65,8 +65,7 @@ pub fn modify_for_testing(sess: &ParseSess, // unconditional, so that the attribute is still marked as used in // non-test builds. let reexport_test_harness_main = - attr::first_attr_value_str_by_name(&krate.attrs, - "reexport_test_harness_main"); + attr::first_attr_value_str_by_name(&krate.attrs, sym::reexport_test_harness_main); // Do this here so that the test_runner crate attribute gets marked as used // even in non-test builds @@ -185,7 +184,7 @@ impl MutVisitor for EntryPointCleaner { ident, attrs: attrs.into_iter() .filter(|attr| { - !attr.check_name("main") && !attr.check_name("start") + !attr.check_name(sym::main) && !attr.check_name(sym::start) }) .chain(iter::once(allow_dead_code)) .collect(), @@ -428,11 +427,11 @@ fn visible_path(cx: &TestCtxt<'_>, path: &[Ident]) -> Vec<Ident>{ } fn is_test_case(i: &ast::Item) -> bool { - attr::contains_name(&i.attrs, "rustc_test_marker") + attr::contains_name(&i.attrs, sym::rustc_test_marker) } fn get_test_runner(sd: &errors::Handler, krate: &ast::Crate) -> Option<ast::Path> { - let test_attr = attr::find_by_name(&krate.attrs, "test_runner")?; + let test_attr = attr::find_by_name(&krate.attrs, sym::test_runner)?; test_attr.meta_item_list().map(|meta_list| { if meta_list.len() != 1 { sd.span_fatal(test_attr.span, |
