Display warning help + minor error improvements.

This commit is contained in:
KtorZ
2023-01-21 17:42:45 +01:00
parent 83fd910604
commit 91bd0d1d77
2 changed files with 7 additions and 4 deletions

View File

@@ -638,7 +638,10 @@ The best thing to do from here is to remove it."#))]
#[diagnostic(code("type_mismatch"))]
#[diagnostic(help("{}", suggest_unify(expected, given, situation, rigid_type_names)))]
CouldNotUnify {
#[label]
#[label(
"expected type '{}'",
expected.to_pretty_with_names(rigid_type_names.clone(), 0),
)]
location: Span,
expected: Arc<Type>,
given: Arc<Type>,
@@ -1152,13 +1155,13 @@ pub enum Warning {
name: String,
},
#[error("I came across an unused variable: '{}'.\n", name.purple())]
#[error("I came across an unused variable.\n")]
#[diagnostic(help(
"No big deal, but you might want to remove it to get rid of that warning."
))]
#[diagnostic(code("unused::variable"))]
UnusedVariable {
#[label]
#[label("unused")]
location: Span,
name: String,
},