Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
-rw-r--r--crates/hir/src/source_analyzer.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index 45401702e9..be0116862b 100644
--- a/crates/hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
@@ -366,7 +366,7 @@ impl SourceAnalyzer {
let items = into_future_trait.items(db);
let into_future_type = items.into_iter().find_map(|item| match item {
AssocItem::TypeAlias(alias)
- if alias.name(db) == Name::new_symbol_root(sym::IntoFuture) =>
+ if alias.name(db) == Name::new_symbol_root(sym::IntoFuture.clone()) =>
{
Some(alias)
}
@@ -395,8 +395,11 @@ impl SourceAnalyzer {
// This can be either `Deref::deref` or `DerefMut::deref_mut`.
// Since deref kind is inferenced and stored in `InferenceResult.method_resolution`,
// use that result to find out which one it is.
- let (deref_trait, deref) =
- self.lang_trait_fn(db, LangItem::Deref, &Name::new_symbol_root(sym::deref))?;
+ let (deref_trait, deref) = self.lang_trait_fn(
+ db,
+ LangItem::Deref,
+ &Name::new_symbol_root(sym::deref.clone()),
+ )?;
self.infer
.as_ref()
.and_then(|infer| {
@@ -405,7 +408,7 @@ impl SourceAnalyzer {
let (deref_mut_trait, deref_mut) = self.lang_trait_fn(
db,
LangItem::DerefMut,
- &Name::new_symbol_root(sym::deref_mut),
+ &Name::new_symbol_root(sym::deref_mut.clone()),
)?;
if func == deref_mut {
Some((deref_mut_trait, deref_mut))
@@ -416,10 +419,10 @@ impl SourceAnalyzer {
.unwrap_or((deref_trait, deref))
}
ast::UnaryOp::Not => {
- self.lang_trait_fn(db, LangItem::Not, &Name::new_symbol_root(sym::not))?
+ self.lang_trait_fn(db, LangItem::Not, &Name::new_symbol_root(sym::not.clone()))?
}
ast::UnaryOp::Neg => {
- self.lang_trait_fn(db, LangItem::Neg, &Name::new_symbol_root(sym::neg))?
+ self.lang_trait_fn(db, LangItem::Neg, &Name::new_symbol_root(sym::neg.clone()))?
}
};
@@ -441,7 +444,7 @@ impl SourceAnalyzer {
let index_ty = self.ty_of_expr(db, &index_expr.index()?)?;
let (index_trait, index_fn) =
- self.lang_trait_fn(db, LangItem::Index, &Name::new_symbol_root(sym::index))?;
+ self.lang_trait_fn(db, LangItem::Index, &Name::new_symbol_root(sym::index.clone()))?;
let (op_trait, op_fn) = self
.infer
.as_ref()
@@ -451,7 +454,7 @@ impl SourceAnalyzer {
let (index_mut_trait, index_mut_fn) = self.lang_trait_fn(
db,
LangItem::IndexMut,
- &Name::new_symbol_root(sym::index_mut),
+ &Name::new_symbol_root(sym::index_mut.clone()),
)?;
if func == index_mut_fn {
Some((index_mut_trait, index_mut_fn))