Add a hir::TypeRef as an intermediate between ast::TypeRef and ty::Ty

This commit is contained in:
Florian Diebold 2018-12-25 21:14:13 +01:00
parent 2870effd5c
commit cdca397061
10 changed files with 219 additions and 95 deletions

View file

@ -115,7 +115,7 @@ impl Module {
Ok(res)
}
pub fn resolve_path(&self, db: &impl HirDatabase, path: Path) -> Cancelable<PerNs<DefId>> {
pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> {
let mut curr_per_ns = PerNs::types(
match path.kind {
PathKind::Crate => self.crate_root(),
@ -131,7 +131,7 @@ impl Module {
.def_id(db),
);
let segments = path.segments;
let segments = &path.segments;
for name in segments.iter() {
let curr = if let Some(r) = curr_per_ns.as_ref().take(Namespace::Types) {
r