use {ModuleSource, ModuleTranslation};
-const PARTITION_REUSED: &'static str = "rustc_partition_reused";
-const PARTITION_TRANSLATED: &'static str = "rustc_partition_translated";
+use rustc::ich::{ATTR_PARTITION_REUSED, ATTR_PARTITION_TRANSLATED};
const MODULE: &'static str = "module";
const CFG: &'static str = "cfg";
impl<'a, 'tcx> AssertModuleSource<'a, 'tcx> {
fn check_attr(&self, attr: &ast::Attribute) {
- let disposition = if attr.check_name(PARTITION_REUSED) {
+ let disposition = if attr.check_name(ATTR_PARTITION_REUSED) {
Disposition::Reused
- } else if attr.check_name(PARTITION_TRANSLATED) {
+ } else if attr.check_name(ATTR_PARTITION_TRANSLATED) {
Disposition::Translated
} else {
return;
}
fn field(&self, attr: &ast::Attribute, name: &str) -> ast::Name {
- for item in attr.meta_item_list().unwrap_or(&[]) {
+ for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
if item.check_name(name) {
if let Some(value) = item.value_str() {
return value;