diff options
| author | Waffle Maybe <waffle.lapkin@gmail.com> | 2022-10-12 16:39:11 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-12 16:39:11 +0400 |
| commit | b1c3e786613932f04472e7616a0dfd856cda17ad (patch) | |
| tree | 7c281511d920d373dbe576198b82a0553b8bca6e | |
| parent | f1ac7b5a65e7e647ec452c40c97d90d7039ff397 (diff) | |
| download | rust-b1c3e786613932f04472e7616a0dfd856cda17ad.tar.gz rust-b1c3e786613932f04472e7616a0dfd856cda17ad.zip | |
Apply suggestions from code review
Co-authored-by: Ralf Jung <post@ralfj.de>
| -rw-r--r-- | compiler/rustc_middle/src/lint.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index ec9130f5e0c..0fa44587011 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). |
