Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lower.rs')
| -rw-r--r-- | crates/hir-ty/src/lower.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs index 5eee025f2c..7259099107 100644 --- a/crates/hir-ty/src/lower.rs +++ b/crates/hir-ty/src/lower.rs @@ -2156,13 +2156,7 @@ pub(crate) fn trait_environment<'db>( db: &'db dyn HirDatabase, def: ExpressionStoreOwnerId, ) -> ParamEnv<'db> { - let def = match def { - ExpressionStoreOwnerId::Signature(def) => def, - ExpressionStoreOwnerId::Body(def) => match def.as_generic_def_id(db) { - Some(def) => def, - None => return ParamEnv::empty(), - }, - }; + let def = def.generic_def(db); return ParamEnv { clauses: trait_environment_query(db, def).as_ref() }; |