aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/infer.rs4
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs10
-rw-r--r--crates/ra_hir/src/ty/primitive.rs2
-rw-r--r--crates/ra_hir/src/ty/traits.rs2
4 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 8322de0a8..a23daabc2 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -85,7 +85,7 @@ enum BindingMode {
85} 85}
86 86
87impl BindingMode { 87impl BindingMode {
88 pub fn convert(annotation: &BindingAnnotation) -> BindingMode { 88 pub fn convert(annotation: BindingAnnotation) -> BindingMode {
89 match annotation { 89 match annotation {
90 BindingAnnotation::Unannotated | BindingAnnotation::Mutable => BindingMode::Move, 90 BindingAnnotation::Unannotated | BindingAnnotation::Mutable => BindingMode::Move,
91 BindingAnnotation::Ref => BindingMode::Ref(Mutability::Shared), 91 BindingAnnotation::Ref => BindingMode::Ref(Mutability::Shared),
@@ -778,7 +778,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
778 let mode = if mode == &BindingAnnotation::Unannotated { 778 let mode = if mode == &BindingAnnotation::Unannotated {
779 default_bm 779 default_bm
780 } else { 780 } else {
781 BindingMode::convert(mode) 781 BindingMode::convert(*mode)
782 }; 782 };
783 let inner_ty = if let Some(subpat) = subpat { 783 let inner_ty = if let Some(subpat) = subpat {
784 self.infer_pat(*subpat, expected, default_bm) 784 self.infer_pat(*subpat, expected, default_bm)
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs
index bc890fe79..10a6e0b10 100644
--- a/crates/ra_hir/src/ty/method_resolution.rs
+++ b/crates/ra_hir/src/ty/method_resolution.rs
@@ -58,7 +58,7 @@ impl CrateImplBlocks {
58 58
59 pub fn lookup_impl_blocks_for_trait<'a>( 59 pub fn lookup_impl_blocks_for_trait<'a>(
60 &'a self, 60 &'a self,
61 tr: &Trait, 61 tr: Trait,
62 ) -> impl Iterator<Item = ImplBlock> + 'a { 62 ) -> impl Iterator<Item = ImplBlock> + 'a {
63 self.impls_by_trait.get(&tr).into_iter().flat_map(|i| i.iter()).map( 63 self.impls_by_trait.get(&tr).into_iter().flat_map(|i| i.iter()).map(
64 move |(module_id, impl_id)| { 64 move |(module_id, impl_id)| {
@@ -68,8 +68,8 @@ impl CrateImplBlocks {
68 ) 68 )
69 } 69 }
70 70
71 fn collect_recursive(&mut self, db: &impl HirDatabase, module: &Module) { 71 fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) {
72 let module_impl_blocks = db.impls_in_module(module.clone()); 72 let module_impl_blocks = db.impls_in_module(module);
73 73
74 for (impl_id, _) in module_impl_blocks.impls.iter() { 74 for (impl_id, _) in module_impl_blocks.impls.iter() {
75 let impl_block = ImplBlock::from_id(module_impl_blocks.module, impl_id); 75 let impl_block = ImplBlock::from_id(module_impl_blocks.module, impl_id);
@@ -94,7 +94,7 @@ impl CrateImplBlocks {
94 } 94 }
95 95
96 for child in module.children(db) { 96 for child in module.children(db) {
97 self.collect_recursive(db, &child); 97 self.collect_recursive(db, child);
98 } 98 }
99 } 99 }
100 100
@@ -108,7 +108,7 @@ impl CrateImplBlocks {
108 impls_by_trait: FxHashMap::default(), 108 impls_by_trait: FxHashMap::default(),
109 }; 109 };
110 if let Some(module) = krate.root_module(db) { 110 if let Some(module) = krate.root_module(db) {
111 crate_impl_blocks.collect_recursive(db, &module); 111 crate_impl_blocks.collect_recursive(db, module);
112 } 112 }
113 Arc::new(crate_impl_blocks) 113 Arc::new(crate_impl_blocks)
114 } 114 }
diff --git a/crates/ra_hir/src/ty/primitive.rs b/crates/ra_hir/src/ty/primitive.rs
index 62b75b764..2c60fefd6 100644
--- a/crates/ra_hir/src/ty/primitive.rs
+++ b/crates/ra_hir/src/ty/primitive.rs
@@ -131,7 +131,7 @@ impl IntTy {
131 IntTy { signedness: Signedness::Unsigned, bitness: IntBitness::X128 } 131 IntTy { signedness: Signedness::Unsigned, bitness: IntBitness::X128 }
132 } 132 }
133 133
134 pub(crate) fn ty_to_string(&self) -> &'static str { 134 pub(crate) fn ty_to_string(self) -> &'static str {
135 match (self.signedness, self.bitness) { 135 match (self.signedness, self.bitness) {
136 (Signedness::Signed, IntBitness::Xsize) => "isize", 136 (Signedness::Signed, IntBitness::Xsize) => "isize",
137 (Signedness::Signed, IntBitness::X8) => "i8", 137 (Signedness::Signed, IntBitness::X8) => "i8",
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs
index 3c902451b..cff4de316 100644
--- a/crates/ra_hir/src/ty/traits.rs
+++ b/crates/ra_hir/src/ty/traits.rs
@@ -50,7 +50,7 @@ pub(crate) fn impls_for_trait_query(
50 impls.extend(db.impls_for_trait(dep.krate, trait_).iter()); 50 impls.extend(db.impls_for_trait(dep.krate, trait_).iter());
51 } 51 }
52 let crate_impl_blocks = db.impls_in_crate(krate); 52 let crate_impl_blocks = db.impls_in_crate(krate);
53 impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(&trait_)); 53 impls.extend(crate_impl_blocks.lookup_impl_blocks_for_trait(trait_));
54 impls.into_iter().collect::<Vec<_>>().into() 54 impls.into_iter().collect::<Vec<_>>().into()
55} 55}
56 56