summaryrefslogtreecommitdiff
path: root/dhall/src/semantics
diff options
context:
space:
mode:
authorNadrieril2020-02-02 17:23:20 +0000
committerNadrieril2020-02-02 17:23:31 +0000
commit47167b874179bd6e659f0a596defcfe854369618 (patch)
tree6d18d9a2c2e1e10094009495b7349655321707e5 /dhall/src/semantics
parentd8c3ced0f1acb1924c801fadbfd3077dede9b0dd (diff)
Let rustfmt format string literals
Diffstat (limited to 'dhall/src/semantics')
-rw-r--r--dhall/src/semantics/tck/typecheck.rs87
1 files changed, 44 insertions, 43 deletions
diff --git a/dhall/src/semantics/tck/typecheck.rs b/dhall/src/semantics/tck/typecheck.rs
index d99f549..48794a8 100644
--- a/dhall/src/semantics/tck/typecheck.rs
+++ b/dhall/src/semantics/tck/typecheck.rs
@@ -82,11 +82,10 @@ fn type_one_layer(
annot.get_type()?.to_expr_tyenv(env)
),
)
- .help(
- format!(
- "The input type of a function must have type `Type`, `Kind` or `Sort`",
- ),
- )
+ .help(format!(
+ "The input type of a function must have type \
+ `Type`, `Kind` or `Sort`",
+ ))
.format(),
);
}
@@ -317,8 +316,8 @@ fn type_one_layer(
_ => {
return mkerr(
ErrorBuilder::new(format!(
- "Trying to apply an argument \
- to a value that is not a function"
+ "Trying to apply an argument to a value that is not a \
+ function"
))
.span_err(
&f.span(),
@@ -505,14 +504,13 @@ fn type_one_layer(
))
.span_err(
&span,
- format!(
- "in this merge expression",
- ),
+ format!("in this merge expression",),
)
.span_err(
&record.span(),
format!(
- "the handler `{}` expects a value of type: `{}`",
+ "the handler `{}` expects a value \
+ of type: `{}`",
x,
annot.to_expr_tyenv(env)
),
@@ -520,7 +518,8 @@ fn type_one_layer(
.span_err(
&union.span(),
format!(
- "but the corresponding variant has type: `{}`",
+ "but the corresponding variant \
+ has type: `{}`",
variant_type.to_expr_tyenv(env)
),
)
@@ -533,38 +532,40 @@ fn type_one_layer(
mkerr("MergeReturnTypeIsDependent")
})?
}
- _ =>
- return mkerr(
- ErrorBuilder::new(format!(
- "Handler is not a function"
- ))
- .span_err(
- &span,
- format!(
- "in this merge expression",
- ),
- )
- .span_err(
- &record.span(),
- format!(
- "the handler `{}` had type: `{}`",
- x,
- handler_type.to_expr_tyenv(env)
- ),
- )
- .span_help(
- &union.span(),
- format!(
- "the corresponding variant has type: `{}`",
- variant_type.to_expr_tyenv(env)
- ),
- )
- .help(format!(
- "a handler for this variant must be a function that takes an input of type: `{}`",
- variant_type.to_expr_tyenv(env)
- ))
- .format(),
+ _ => {
+ return mkerr(
+ ErrorBuilder::new(format!(
+ "Handler is not a function"
+ ))
+ .span_err(
+ &span,
+ format!("in this merge expression",),
)
+ .span_err(
+ &record.span(),
+ format!(
+ "the handler `{}` had type: `{}`",
+ x,
+ handler_type.to_expr_tyenv(env)
+ ),
+ )
+ .span_help(
+ &union.span(),
+ format!(
+ "the corresponding variant has type: \
+ `{}`",
+ variant_type.to_expr_tyenv(env)
+ ),
+ )
+ .help(format!(
+ "a handler for this variant must be a \
+ function that takes an input of type: \
+ `{}`",
+ variant_type.to_expr_tyenv(env)
+ ))
+ .format(),
+ )
+ }
},
// Union alternative without type
Some(None) => handler_type.clone(),