]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir-ty/src/lower.rs
feat: Handle operators like their trait functions in the IDE
[rust.git] / crates / hir-ty / src / lower.rs
index c5304c18218bf1ee1b2510deedaf4ff313e6c57f..3ed9c941f4790dc2dd07b949a89fee5cb1b50518 100644 (file)
@@ -44,7 +44,7 @@
 
 use crate::{
     all_super_traits,
-    consteval::{intern_scalar_const, path_to_const, unknown_const, unknown_const_as_generic},
+    consteval::{intern_const_scalar, path_to_const, unknown_const, unknown_const_as_generic},
     db::HirDatabase,
     make_binders,
     mapping::ToChalk,
@@ -106,7 +106,7 @@ pub fn new(db: &'a dyn HirDatabase, resolver: &'a Resolver) -> Self {
     pub fn with_debruijn<T>(
         &self,
         debruijn: DebruijnIndex,
-        f: impl FnOnce(&TyLoweringContext) -> T,
+        f: impl FnOnce(&TyLoweringContext<'_>) -> T,
     ) -> T {
         let opaque_ty_data_vec = self.opaque_type_data.take();
         let expander = self.expander.take();
@@ -130,7 +130,7 @@ pub fn with_debruijn<T>(
     pub fn with_shifted_in<T>(
         &self,
         debruijn: DebruijnIndex,
-        f: impl FnOnce(&TyLoweringContext) -> T,
+        f: impl FnOnce(&TyLoweringContext<'_>) -> T,
     ) -> T {
         self.with_debruijn(self.in_binders.shifted_in_from(debruijn), f)
     }
@@ -1033,7 +1033,7 @@ fn count_impl_traits(type_ref: &TypeRef) -> usize {
 }
 
 /// Build the signature of a callable item (function, struct or enum variant).
-pub fn callable_item_sig(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
+pub(crate) fn callable_item_sig(db: &dyn HirDatabase, def: CallableDefId) -> PolyFnSig {
     match def {
         CallableDefId::FunctionId(f) => fn_sig_for_fn(db, f),
         CallableDefId::StructId(s) => fn_sig_for_struct_constructor(db, s),
@@ -1743,7 +1743,7 @@ pub(crate) fn const_or_path_to_chalk(
     debruijn: DebruijnIndex,
 ) -> Const {
     match value {
-        ConstScalarOrPath::Scalar(s) => intern_scalar_const(s.clone(), expected_ty),
+        ConstScalarOrPath::Scalar(s) => intern_const_scalar(s.clone(), expected_ty),
         ConstScalarOrPath::Path(n) => {
             let path = ModPath::from_segments(PathKind::Plain, Some(n.clone()));
             path_to_const(db, resolver, &path, mode, args, debruijn)