backend: add const to ast

This commit is contained in:
Julius Rakow
2018-07-13 04:16:19 +02:00
parent 63598721ca
commit 862e4c50f6
5 changed files with 82 additions and 0 deletions

View File

@ -106,6 +106,7 @@ impl ImportedTypes for ast::ImportKind {
ast::ImportKind::Function(fun) => fun.imported_types(f),
ast::ImportKind::Type(ty) => ty.imported_types(f),
ast::ImportKind::Enum(enm) => enm.imported_types(f),
ast::ImportKind::Const(c) => c.imported_types(f),
}
}
}
@ -229,6 +230,15 @@ impl ImportedTypes for ast::TypeAlias {
}
}
impl ImportedTypes for ast::Const {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.ty.imported_types(f);
}
}
/// Remove any methods, statics, &c, that reference types that are *not*
/// defined.
pub trait RemoveUndefinedImports {