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

@ -145,7 +145,7 @@ impl VariantData {
.map(|(i, fd)| {
Ok(StructField {
name: SmolStr::new(i.to_string()),
ty: Ty::new_opt(db, &module, fd.type_ref())?,
ty: Ty::from_ast_opt(db, &module, fd.type_ref())?,
})
})
.collect::<Cancelable<_>>()?;
@ -160,7 +160,7 @@ impl VariantData {
.name()
.map(|n| n.text())
.unwrap_or_else(|| SmolStr::new("[error]")),
ty: Ty::new_opt(db, &module, fd.type_ref())?,
ty: Ty::from_ast_opt(db, &module, fd.type_ref())?,
})
})
.collect::<Cancelable<_>>()?;