Help for unused variables error
@@ -53,8 +53,8 @@ impl ResolverError {
"unused variable ".to_string(),
ident.0.span(),
);
-
- diag.add_note("A new variable usually means a constraint has been added and is being unused. \n For this reason, it is almost always a bug to declare a variable and not use it.".to_owned());
+ let message = format!("A new variable usually means a constraint has been added and is being unused. \n For this reason, it is almost always a bug to declare a variable and not use it. \n help: if this is intentional, prefix it with an underscore: `_{}`", name);
+ diag.add_note(message);
diag
}
ResolverError::VariableNotDeclared { name, span } => Diagnostic::simple_error(
