diff options
Diffstat (limited to 'crates/ra_hir/src/path.rs')
-rw-r--r-- | crates/ra_hir/src/path.rs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/crates/ra_hir/src/path.rs b/crates/ra_hir/src/path.rs index 9e449f6cc..a61161b63 100644 --- a/crates/ra_hir/src/path.rs +++ b/crates/ra_hir/src/path.rs | |||
@@ -234,7 +234,7 @@ impl GenericArgs { | |||
234 | } | 234 | } |
235 | if let Some(ret_type) = ret_type { | 235 | if let Some(ret_type) = ret_type { |
236 | let type_ref = TypeRef::from_ast_opt(ret_type.type_ref()); | 236 | let type_ref = TypeRef::from_ast_opt(ret_type.type_ref()); |
237 | bindings.push((name::OUTPUT, type_ref)) | 237 | bindings.push((name::OUTPUT_TYPE, type_ref)) |
238 | } | 238 | } |
239 | if args.is_empty() && bindings.is_empty() { | 239 | if args.is_empty() && bindings.is_empty() { |
240 | None | 240 | None |
@@ -338,3 +338,31 @@ fn convert_path(prefix: Option<Path>, path: ast::Path) -> Option<Path> { | |||
338 | }; | 338 | }; |
339 | Some(res) | 339 | Some(res) |
340 | } | 340 | } |
341 | |||
342 | pub mod known { | ||
343 | use super::{Path, PathKind}; | ||
344 | use crate::name; | ||
345 | |||
346 | pub fn std_iter_into_iterator() -> Path { | ||
347 | Path::from_simple_segments( | ||
348 | PathKind::Abs, | ||
349 | vec![name::STD, name::ITER, name::INTO_ITERATOR_TYPE], | ||
350 | ) | ||
351 | } | ||
352 | |||
353 | pub fn std_ops_try() -> Path { | ||
354 | Path::from_simple_segments(PathKind::Abs, vec![name::STD, name::OPS, name::TRY_TYPE]) | ||
355 | } | ||
356 | |||
357 | pub fn std_result_result() -> Path { | ||
358 | Path::from_simple_segments(PathKind::Abs, vec![name::STD, name::RESULT, name::RESULT_TYPE]) | ||
359 | } | ||
360 | |||
361 | pub fn std_future_future() -> Path { | ||
362 | Path::from_simple_segments(PathKind::Abs, vec![name::STD, name::FUTURE, name::FUTURE_TYPE]) | ||
363 | } | ||
364 | |||
365 | pub fn std_boxed_box() -> Path { | ||
366 | Path::from_simple_segments(PathKind::Abs, vec![name::STD, name::BOXED, name::BOX_TYPE]) | ||
367 | } | ||
368 | } | ||