Skip to content

Commit b1c3e78

Browse files
Apply suggestions from code review
Co-authored-by: Ralf Jung <[email protected]>
1 parent f1ac7b5 commit b1c3e78

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

compiler/rustc_middle/src/lint.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,12 @@ pub fn explain_lint_level_source(
286286
///
287287
/// ## `decorate` signature
288288
///
289-
/// Signature of `decorate` may be confusing at first, for instance what's the
290-
/// point of returning `&'b mut DiagnosticBuilder<'a, ()>` if the original can
291-
/// be used instead?
292-
/// ```ignore pseudo-code
293-
/// _ = decorate(&mut diag);
294-
/// /* use `diag` here again */
295-
/// ```
289+
/// The return value of `decorate` is ignored by this function. So what is the
290+
/// point of returning `&'b mut DiagnosticBuilder<'a, ()>`?
296291
///
297-
/// There 2 reasons for such choice signature.
292+
/// There are 2 reasons for this signature.
298293
///
299-
/// First off all, it prevents accidental use `.emit()` -- it's clear that the
294+
/// First off all, it prevents accidental use of `.emit()` -- it's clear that the
300295
/// builder will be later used and shouldn't be emitted right away (this is
301296
/// especially important because the old API expected you to call `.emit()` in
302297
/// the closure).

0 commit comments

Comments
 (0)