1
Fork 0

E0379: Make diagnostic more precise

This commit is contained in:
León Orell Valerian Liehr 2024-01-02 00:26:50 +01:00
parent 8f546aa495
commit ae8e401c9f
No known key found for this signature in database
GPG key ID: D17A07215F68E713
13 changed files with 31 additions and 20 deletions

View file

@ -293,7 +293,7 @@ impl<'a> AstValidator<'a> {
fn check_trait_fn_not_const(&self, constness: Const) {
if let Const::Yes(span) = constness {
self.dcx().emit_err(errors::TraitFnConst { span });
self.dcx().emit_err(errors::TraitFnConst { span, in_impl: self.in_trait_impl });
}
}

View file

@ -49,6 +49,7 @@ pub struct TraitFnConst {
#[primary_span]
#[label]
pub span: Span,
pub in_impl: bool,
}
#[derive(Diagnostic)]