]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir/src/semantics/source_to_def.rs
Add const generics
[rust.git] / crates / hir / src / semantics / source_to_def.rs
index 986ea0cf2a664cb863634ca2461089d32895d1c8..4672e7db40c25fe30a4c3cf245221dcdf3f9d23a 100644 (file)
@@ -279,7 +279,7 @@ fn cache_for(&mut self, container: ChildContainer, file_id: HirFileId) -> &DynMa
     pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
         let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
         let dyn_map = self.cache_for(container, src.file_id);
-        dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(|x| x.into())
+        dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(|x| TypeParamId::from_unchecked(x))
     }
 
     pub(super) fn lifetime_param_to_def(
@@ -297,7 +297,7 @@ pub(super) fn const_param_to_def(
     ) -> Option<ConstParamId> {
         let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
         let dyn_map = self.cache_for(container, src.file_id);
-        dyn_map[keys::CONST_PARAM].get(&src.value).copied().map(|x| x.into())
+        dyn_map[keys::CONST_PARAM].get(&src.value).copied().map(|x| ConstParamId::from_unchecked(x))
     }
 
     pub(super) fn generic_param_to_def(