aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r--crates/ra_hir/src/ty/lower.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index 300616a53..cb494baf4 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -353,11 +353,10 @@ pub(crate) fn generic_defaults(db: &impl HirDatabase, def: GenericDef) -> Substs
353} 353}
354 354
355fn fn_sig_for_fn(db: &impl HirDatabase, def: Function) -> FnSig { 355fn fn_sig_for_fn(db: &impl HirDatabase, def: Function) -> FnSig {
356 let signature = def.signature(db); 356 let data = def.data(db);
357 let resolver = def.resolver(db); 357 let resolver = def.resolver(db);
358 let params = 358 let params = data.params().iter().map(|tr| Ty::from_hir(db, &resolver, tr)).collect::<Vec<_>>();
359 signature.params().iter().map(|tr| Ty::from_hir(db, &resolver, tr)).collect::<Vec<_>>(); 359 let ret = Ty::from_hir(db, &resolver, data.ret_type());
360 let ret = Ty::from_hir(db, &resolver, signature.ret_type());
361 FnSig::from_params_and_return(params, ret) 360 FnSig::from_params_and_return(params, ret)
362} 361}
363 362
@@ -371,18 +370,18 @@ fn type_for_fn(db: &impl HirDatabase, def: Function) -> Ty {
371 370
372/// Build the declared type of a const. 371/// Build the declared type of a const.
373fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty { 372fn type_for_const(db: &impl HirDatabase, def: Const) -> Ty {
374 let signature = def.signature(db); 373 let data = def.data(db);
375 let resolver = def.resolver(db); 374 let resolver = def.resolver(db);
376 375
377 Ty::from_hir(db, &resolver, signature.type_ref()) 376 Ty::from_hir(db, &resolver, data.type_ref())
378} 377}
379 378
380/// Build the declared type of a static. 379/// Build the declared type of a static.
381fn type_for_static(db: &impl HirDatabase, def: Static) -> Ty { 380fn type_for_static(db: &impl HirDatabase, def: Static) -> Ty {
382 let signature = def.signature(db); 381 let data = def.data(db);
383 let resolver = def.resolver(db); 382 let resolver = def.resolver(db);
384 383
385 Ty::from_hir(db, &resolver, signature.type_ref()) 384 Ty::from_hir(db, &resolver, data.type_ref())
386} 385}
387 386
388/// Build the declared type of a static. 387/// Build the declared type of a static.