aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
diff options
context:
space:
mode:
authorPhil Ellison <[email protected]>2020-12-30 17:33:33 +0000
committerPhil Ellison <[email protected]>2021-01-07 19:01:33 +0000
commit554ee6ea0272349b811c81507088f6e95c2b5a00 (patch)
tree6a6049c226ee4a54b5c8dcd56beeeb9a0e93b76a /crates/hir_ty/src
parentb2dbe6e43a28a22be2b5d8631dff83b644520f59 (diff)
cargo fmt
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r--crates/hir_ty/src/diagnostics/expr.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs
index 455b0d4aa..a1c484fdf 100644
--- a/crates/hir_ty/src/diagnostics/expr.rs
+++ b/crates/hir_ty/src/diagnostics/expr.rs
@@ -11,8 +11,8 @@ use crate::{
11 db::HirDatabase, 11 db::HirDatabase,
12 diagnostics::{ 12 diagnostics::{
13 match_check::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, 13 match_check::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness},
14 MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkOrSomeInTailExpr, MissingPatFields, 14 MismatchedArgCount, MissingFields, MissingMatchArms, MissingOkOrSomeInTailExpr,
15 RemoveThisSemicolon, 15 MissingPatFields, RemoveThisSemicolon,
16 }, 16 },
17 utils::variant_data, 17 utils::variant_data,
18 ApplicationTy, InferenceResult, Ty, TypeCtor, 18 ApplicationTy, InferenceResult, Ty, TypeCtor,
@@ -324,10 +324,10 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
324 let (params, required) = match &mismatch.expected { 324 let (params, required) = match &mismatch.expected {
325 Ty::Apply(ApplicationTy { ctor, parameters }) if ctor == &core_result_ctor => { 325 Ty::Apply(ApplicationTy { ctor, parameters }) if ctor == &core_result_ctor => {
326 (parameters, "Ok".to_string()) 326 (parameters, "Ok".to_string())
327 }, 327 }
328 Ty::Apply(ApplicationTy { ctor, parameters }) if ctor == &core_option_ctor => { 328 Ty::Apply(ApplicationTy { ctor, parameters }) if ctor == &core_option_ctor => {
329 (parameters, "Some".to_string()) 329 (parameters, "Some".to_string())
330 }, 330 }
331 _ => return, 331 _ => return,
332 }; 332 };
333 333
@@ -335,8 +335,11 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
335 let (_, source_map) = db.body_with_source_map(self.owner.into()); 335 let (_, source_map) = db.body_with_source_map(self.owner.into());
336 336
337 if let Ok(source_ptr) = source_map.expr_syntax(id) { 337 if let Ok(source_ptr) = source_map.expr_syntax(id) {
338 self.sink 338 self.sink.push(MissingOkOrSomeInTailExpr {
339 .push(MissingOkOrSomeInTailExpr { file: source_ptr.file_id, expr: source_ptr.value, required }); 339 file: source_ptr.file_id,
340 expr: source_ptr.value,
341 required,
342 });
340 } 343 }
341 } 344 }
342 } 345 }