red_knot_python_semantic: remove #[must_use] on diagnostic guard constructor

I believe this was an artifact of an older iteration of the diagnostic
reporting API. But this is strictly not necessary now, and indeed, might
even be annoying. It is okay, but perhaps looks a little odd, to do
`builder.into_diagnostic("...")` if you don't want to add anything else
to the diagnostic.
This commit is contained in:
Andrew Gallant 2025-04-16 10:26:29 -04:00 committed by Andrew Gallant
parent 14f71ceb83
commit 3b300559ab

View file

@ -404,7 +404,6 @@ impl<'db, 'ctx> LintDiagnosticGuardBuilder<'db, 'ctx> {
///
/// The diagnostic can be further mutated on the guard via its `DerefMut`
/// impl to `Diagnostic`.
#[must_use]
pub(super) fn into_diagnostic(
self,
message: impl std::fmt::Display,
@ -541,7 +540,6 @@ impl<'db, 'ctx> DiagnosticGuardBuilder<'db, 'ctx> {
///
/// The diagnostic can be further mutated on the guard via its `DerefMut`
/// impl to `Diagnostic`.
#[must_use]
pub(super) fn into_diagnostic(
self,
message: impl std::fmt::Display,