diff options
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index c25f3f34b..3fec0e431 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -15,7 +15,7 @@ use test_utils::mark; | |||
15 | 15 | ||
16 | use crate::{ | 16 | use crate::{ |
17 | autoderef, method_resolution, op, | 17 | autoderef, method_resolution, op, |
18 | primitive::UintTy, | 18 | primitive::{self, UintTy}, |
19 | traits::{FnTrait, InEnvironment}, | 19 | traits::{FnTrait, InEnvironment}, |
20 | utils::{generics, variant_data, Generics}, | 20 | utils::{generics, variant_data, Generics}, |
21 | ApplicationTy, Binders, CallableDefId, InferTy, Mutability, Obligation, OpaqueTyId, Rawness, | 21 | ApplicationTy, Binders, CallableDefId, InferTy, Mutability, Obligation, OpaqueTyId, Rawness, |
@@ -730,17 +730,21 @@ impl<'a> InferenceContext<'a> { | |||
730 | } | 730 | } |
731 | Literal::Char(..) => Ty::simple(TypeCtor::Scalar(Scalar::Char)), | 731 | Literal::Char(..) => Ty::simple(TypeCtor::Scalar(Scalar::Char)), |
732 | Literal::Int(_v, ty) => match ty { | 732 | Literal::Int(_v, ty) => match ty { |
733 | Some(int_ty) => Ty::simple(TypeCtor::Scalar(Scalar::Int((*int_ty).into()))), | 733 | Some(int_ty) => Ty::simple(TypeCtor::Scalar(Scalar::Int( |
734 | primitive::int_ty_from_builtin(*int_ty), | ||
735 | ))), | ||
734 | None => self.table.new_integer_var(), | 736 | None => self.table.new_integer_var(), |
735 | }, | 737 | }, |
736 | Literal::Uint(_v, ty) => match ty { | 738 | Literal::Uint(_v, ty) => match ty { |
737 | Some(int_ty) => Ty::simple(TypeCtor::Scalar(Scalar::Uint((*int_ty).into()))), | 739 | Some(int_ty) => Ty::simple(TypeCtor::Scalar(Scalar::Uint( |
740 | primitive::uint_ty_from_builtin(*int_ty), | ||
741 | ))), | ||
738 | None => self.table.new_integer_var(), | 742 | None => self.table.new_integer_var(), |
739 | }, | 743 | }, |
740 | Literal::Float(_v, ty) => match ty { | 744 | Literal::Float(_v, ty) => match ty { |
741 | Some(float_ty) => { | 745 | Some(float_ty) => Ty::simple(TypeCtor::Scalar(Scalar::Float( |
742 | Ty::simple(TypeCtor::Scalar(Scalar::Float((*float_ty).into()))) | 746 | primitive::float_ty_from_builtin(*float_ty), |
743 | } | 747 | ))), |
744 | None => self.table.new_float_var(), | 748 | None => self.table.new_float_var(), |
745 | }, | 749 | }, |
746 | }, | 750 | }, |