aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ty/autoderef.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs
index ab5f008ef..a442a856c 100644
--- a/crates/ra_hir/src/ty/autoderef.rs
+++ b/crates/ra_hir/src/ty/autoderef.rs
@@ -3,7 +3,7 @@
3//! reference to a type with the field `bar`. This is an approximation of the 3//! reference to a type with the field `bar`. This is an approximation of the
4//! logic in rustc (which lives in librustc_typeck/check/autoderef.rs). 4//! logic in rustc (which lives in librustc_typeck/check/autoderef.rs).
5 5
6use ra_syntax::algo::generate; 6use std::iter::successors;
7 7
8use crate::HirDatabase; 8use crate::HirDatabase;
9use super::Ty; 9use super::Ty;
@@ -11,7 +11,7 @@ use super::Ty;
11impl Ty { 11impl Ty {
12 /// Iterates over the possible derefs of `ty`. 12 /// Iterates over the possible derefs of `ty`.
13 pub fn autoderef<'a>(self, db: &'a impl HirDatabase) -> impl Iterator<Item = Ty> + 'a { 13 pub fn autoderef<'a>(self, db: &'a impl HirDatabase) -> impl Iterator<Item = Ty> + 'a {
14 generate(Some(self), move |ty| ty.autoderef_step(db)) 14 successors(Some(self), move |ty| ty.autoderef_step(db))
15 } 15 }
16 16
17 fn autoderef_step(&self, _db: &impl HirDatabase) -> Option<Ty> { 17 fn autoderef_step(&self, _db: &impl HirDatabase) -> Option<Ty> {