From b1c3e786613932f04472e7616a0dfd856cda17ad Mon Sep 17 00:00:00 2001 From: Waffle Maybe Date: Wed, 12 Oct 2022 16:39:11 +0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Ralf Jung --- compiler/rustc_middle/src/lint.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index ec9130f5e0c7..0fa44587011b 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -286,17 +286,12 @@ pub fn explain_lint_level_source( /// /// ## `decorate` signature /// -/// Signature of `decorate` may be confusing at first, for instance what's the -/// point of returning `&'b mut DiagnosticBuilder<'a, ()>` if the original can -/// be used instead? -/// ```ignore pseudo-code -/// _ = decorate(&mut diag); -/// /* use `diag` here again */ -/// ``` +/// The return value of `decorate` is ignored by this function. So what is the +/// point of returning `&'b mut DiagnosticBuilder<'a, ()>`? /// -/// There 2 reasons for such choice signature. +/// There are 2 reasons for this signature. /// -/// First off all, it prevents accidental use `.emit()` -- it's clear that the +/// First off all, it prevents accidental use of `.emit()` -- it's clear that the /// builder will be later used and shouldn't be emitted right away (this is /// especially important because the old API expected you to call `.emit()` in /// the closure).