diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 18 | ||||
-rw-r--r-- | crates/ra_hir/src/ty.rs | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 2696592a4..5081466a2 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -661,22 +661,20 @@ impl ExprCollector { | |||
661 | .map(|s| Name::new(s)) | 661 | .map(|s| Name::new(s)) |
662 | .and_then(|name| UncertainIntTy::from_name(&name)); | 662 | .and_then(|name| UncertainIntTy::from_name(&name)); |
663 | 663 | ||
664 | if let Some(kn) = known_name { | 664 | Literal::Int( |
665 | Literal::Int(Default::default(), kn) | 665 | Default::default(), |
666 | } else { | 666 | known_name.unwrap_or(UncertainIntTy::Unknown), |
667 | Literal::Int(Default::default(), UncertainIntTy::Unknown) | 667 | ) |
668 | } | ||
669 | } | 668 | } |
670 | LiteralFlavor::FloatNumber { suffix } => { | 669 | LiteralFlavor::FloatNumber { suffix } => { |
671 | let known_name = suffix | 670 | let known_name = suffix |
672 | .map(|s| Name::new(s)) | 671 | .map(|s| Name::new(s)) |
673 | .and_then(|name| UncertainFloatTy::from_name(&name)); | 672 | .and_then(|name| UncertainFloatTy::from_name(&name)); |
674 | 673 | ||
675 | if let Some(kn) = known_name { | 674 | Literal::Float( |
676 | Literal::Float(Default::default(), kn) | 675 | Default::default(), |
677 | } else { | 676 | known_name.unwrap_or(UncertainFloatTy::Unknown), |
678 | Literal::Float(Default::default(), UncertainFloatTy::Unknown) | 677 | ) |
679 | } | ||
680 | } | 678 | } |
681 | LiteralFlavor::ByteString => Literal::ByteString(Default::default()), | 679 | LiteralFlavor::ByteString => Literal::ByteString(Default::default()), |
682 | LiteralFlavor::String => Literal::String(Default::default()), | 680 | LiteralFlavor::String => Literal::String(Default::default()), |
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index b6577ee5e..5579db8fb 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -107,7 +107,7 @@ impl UnifyValue for TypeVarValue { | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | /// The kinds of placeholders we need during type inference. There's seperate | 110 | /// The kinds of placeholders we need during type inference. There's separate |
111 | /// values for general types, and for integer and float variables. The latter | 111 | /// values for general types, and for integer and float variables. The latter |
112 | /// two are used for inference of literal values (e.g. `100` could be one of | 112 | /// two are used for inference of literal values (e.g. `100` could be one of |
113 | /// several integer types). | 113 | /// several integer types). |