From 3b300559ab5ddee40ca353da6303b02f8f10f1a4 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 16 Apr 2025 10:26:29 -0400 Subject: [PATCH] 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. --- crates/red_knot_python_semantic/src/types/context.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/red_knot_python_semantic/src/types/context.rs b/crates/red_knot_python_semantic/src/types/context.rs index 40cd9b7137..4a6c24186c 100644 --- a/crates/red_knot_python_semantic/src/types/context.rs +++ b/crates/red_knot_python_semantic/src/types/context.rs @@ -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,