Use ConstArg instead of Expr for AstId of InTypeConstId

This commit is contained in:
hkalbasi 2023-06-08 23:47:45 +03:30
parent d9136df9e5
commit f8594f78bb
13 changed files with 29 additions and 28 deletions

View file

@ -537,11 +537,11 @@ impl Clone for Box<dyn OpaqueInternableThing> {
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct InTypeConstId(InternId);
type InTypeConstLoc = (AstId<ast::Expr>, TypeOwnerId, Box<dyn OpaqueInternableThing>);
type InTypeConstLoc = (AstId<ast::ConstArg>, TypeOwnerId, Box<dyn OpaqueInternableThing>);
impl_intern!(InTypeConstId, InTypeConstLoc, intern_in_type_const, lookup_intern_in_type_const);
impl InTypeConstId {
pub fn source(&self, db: &dyn db::DefDatabase) -> ast::Expr {
pub fn source(&self, db: &dyn db::DefDatabase) -> ast::ConstArg {
let src = self.lookup(db).0;
let file_id = src.file_id;
let root = &db.parse_or_expand(file_id);