From 60bdb66ef23f78d8c73afa1897a4542e7e722ed2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 7 Sep 2019 14:31:43 +0200 Subject: Lower bounds on trait definition, and resolve assoc types from super traits --- crates/ra_hir/src/type_ref.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_hir/src/type_ref.rs') diff --git a/crates/ra_hir/src/type_ref.rs b/crates/ra_hir/src/type_ref.rs index fa91bfb22..bc8acc7ee 100644 --- a/crates/ra_hir/src/type_ref.rs +++ b/crates/ra_hir/src/type_ref.rs @@ -150,4 +150,11 @@ impl TypeBound { ast::TypeBoundKind::ForType(_) | ast::TypeBoundKind::Lifetime(_) => TypeBound::Error, } } + + pub fn as_path(&self) -> Option<&Path> { + match self { + TypeBound::Path(p) => Some(p), + _ => None, + } + } } -- cgit v1.2.3