From f02fcc16444fcd18ccd51b43fa01bf0233e044fa Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 13 Dec 2019 22:32:44 +0100 Subject: Use path macro --- crates/ra_hir_ty/src/expr.rs | 4 ++-- crates/ra_hir_ty/src/infer.rs | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index d2bd64e5c..f752a9f09 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use hir_def::{ - path::{known, Path}, + path::{path, Path}, resolver::HasResolver, AdtId, FunctionId, }; @@ -124,7 +124,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { None => return, }; - let std_result_path = known::std_result_result(); + let std_result_path = path![std::result::Result]; let resolver = self.func.resolver(db); let std_result_enum = match resolver.resolve_known_enum(db, &std_result_path) { diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index edf4e69ba..f1b7e9442 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs @@ -24,7 +24,7 @@ use hir_def::{ body::Body, data::{ConstData, FunctionData}, expr::{BindingAnnotation, ExprId, PatId}, - path::{known, Path}, + path::{path, Path}, resolver::{HasResolver, Resolver, TypeNs}, type_ref::{Mutability, TypeRef}, AdtId, AssocItemId, DefWithBodyId, FunctionId, StructFieldId, TypeAliasId, VariantId, @@ -422,73 +422,73 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { } fn resolve_into_iter_item(&self) -> Option { - let path = known::std_iter_into_iterator(); + let path = path![std::iter::IntoIterator]; let trait_ = self.resolver.resolve_known_trait(self.db, &path)?; self.db.trait_data(trait_).associated_type_by_name(&name![Item]) } fn resolve_ops_try_ok(&self) -> Option { - let path = known::std_ops_try(); + let path = path![std::ops::Try]; let trait_ = self.resolver.resolve_known_trait(self.db, &path)?; self.db.trait_data(trait_).associated_type_by_name(&name![Ok]) } fn resolve_ops_neg_output(&self) -> Option { - let path = known::std_ops_neg(); + let path = path![std::ops::Neg]; let trait_ = self.resolver.resolve_known_trait(self.db, &path)?; self.db.trait_data(trait_).associated_type_by_name(&name![Output]) } fn resolve_ops_not_output(&self) -> Option { - let path = known::std_ops_not(); + let path = path![std::ops::Not]; let trait_ = self.resolver.resolve_known_trait(self.db, &path)?; self.db.trait_data(trait_).associated_type_by_name(&name![Output]) } fn resolve_future_future_output(&self) -> Option { - let path = known::std_future_future(); + let path = path![std::future::Future]; let trait_ = self.resolver.resolve_known_trait(self.db, &path)?; self.db.trait_data(trait_).associated_type_by_name(&name![Output]) } fn resolve_boxed_box(&self) -> Option { - let path = known::std_boxed_box(); + let path = path![std::boxed::Box]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range_full(&self) -> Option { - let path = known::std_ops_range_full(); + let path = path![std::ops::RangeFull]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range(&self) -> Option { - let path = known::std_ops_range(); + let path = path![std::ops::Range]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range_inclusive(&self) -> Option { - let path = known::std_ops_range_inclusive(); + let path = path![std::ops::RangeInclusive]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range_from(&self) -> Option { - let path = known::std_ops_range_from(); + let path = path![std::ops::RangeFrom]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range_to(&self) -> Option { - let path = known::std_ops_range_to(); + let path = path![std::ops::RangeTo]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } fn resolve_range_to_inclusive(&self) -> Option { - let path = known::std_ops_range_to_inclusive(); + let path = path![std::ops::RangeToInclusive]; let struct_ = self.resolver.resolve_known_struct(self.db, &path)?; Some(struct_.into()) } -- cgit v1.2.3