aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/type_alias.rs
blob: ab948170898356e5286ce523f772b926e153ec8b (plain)
1
2
3
4
5
6
7
8
9
10
//! HIR for type aliases (i.e. the `type` keyword).

use std::sync::Arc;

use crate::{code_model_api::Type, db::PersistentHirDatabase, type_ref::TypeRef};

pub(crate) fn type_alias_ref_query(db: &impl PersistentHirDatabase, typ: Type) -> Arc<TypeRef> {
    let (_, node) = typ.source(db);
    Arc::new(TypeRef::from_ast_opt(node.type_ref()))
}