aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index d9c62f84c..cc5afad75 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -368,12 +368,12 @@ impl Ty {
368 let resolution = resolver.resolve_path(db, path).take_types(); 368 let resolution = resolver.resolve_path(db, path).take_types();
369 369
370 let def = match resolution { 370 let def = match resolution {
371 Some(Resolution::Def { def, .. }) => def, 371 Some(Resolution::Def(def)) => def,
372 Some(Resolution::LocalBinding { .. }) => { 372 Some(Resolution::LocalBinding(..)) => {
373 // this should never happen 373 // this should never happen
374 panic!("path resolved to local binding in type ns"); 374 panic!("path resolved to local binding in type ns");
375 } 375 }
376 Some(Resolution::GenericParam { idx }) => { 376 Some(Resolution::GenericParam(idx)) => {
377 return Ty::Param { 377 return Ty::Param {
378 idx, 378 idx,
379 // TODO: maybe return name in resolution? 379 // TODO: maybe return name in resolution?
@@ -1107,7 +1107,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1107 fn infer_path_expr(&mut self, resolver: &Resolver, path: &Path) -> Option<Ty> { 1107 fn infer_path_expr(&mut self, resolver: &Resolver, path: &Path) -> Option<Ty> {
1108 let resolved = resolver.resolve_path(self.db, &path).take_values()?; 1108 let resolved = resolver.resolve_path(self.db, &path).take_values()?;
1109 match resolved { 1109 match resolved {
1110 Resolution::Def { def, .. } => { 1110 Resolution::Def(def) => {
1111 let typable: Option<TypableDef> = def.into(); 1111 let typable: Option<TypableDef> = def.into();
1112 let typable = typable?; 1112 let typable = typable?;
1113 let substs = Ty::substs_from_path(self.db, &self.resolver, path, typable); 1113 let substs = Ty::substs_from_path(self.db, &self.resolver, path, typable);
@@ -1115,12 +1115,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1115 let ty = self.insert_type_vars(ty); 1115 let ty = self.insert_type_vars(ty);
1116 Some(ty) 1116 Some(ty)
1117 } 1117 }
1118 Resolution::LocalBinding { pat } => { 1118 Resolution::LocalBinding(pat) => {
1119 let ty = self.type_of_pat.get(pat)?; 1119 let ty = self.type_of_pat.get(pat)?;
1120 let ty = self.resolve_ty_as_possible(&mut vec![], ty.clone()); 1120 let ty = self.resolve_ty_as_possible(&mut vec![], ty.clone());
1121 Some(ty) 1121 Some(ty)
1122 } 1122 }
1123 Resolution::GenericParam { .. } => { 1123 Resolution::GenericParam(..) => {
1124 // generic params can't refer to values... yet 1124 // generic params can't refer to values... yet
1125 None 1125 None
1126 } 1126 }
@@ -1138,13 +1138,13 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1138 }; 1138 };
1139 let resolver = &self.resolver; 1139 let resolver = &self.resolver;
1140 let typable: Option<TypableDef> = match resolver.resolve_path(self.db, &path).take_types() { 1140 let typable: Option<TypableDef> = match resolver.resolve_path(self.db, &path).take_types() {
1141 Some(Resolution::Def { def, .. }) => def.into(), 1141 Some(Resolution::Def(def)) => def.into(),
1142 Some(Resolution::LocalBinding { .. }) => { 1142 Some(Resolution::LocalBinding(..)) => {
1143 // this cannot happen 1143 // this cannot happen
1144 log::error!("path resolved to local binding in type ns"); 1144 log::error!("path resolved to local binding in type ns");
1145 return (Ty::Unknown, None); 1145 return (Ty::Unknown, None);
1146 } 1146 }
1147 Some(Resolution::GenericParam { .. }) => { 1147 Some(Resolution::GenericParam(..)) => {
1148 // generic params can't be used in struct literals 1148 // generic params can't be used in struct literals
1149 return (Ty::Unknown, None); 1149 return (Ty::Unknown, None);
1150 } 1150 }