@@ -261,6 +261,17 @@ impl LintReporter<'_, '_> {
261261/// relevant suppression.
262262impl Drop for LintReporter < ' _ , ' _ > {
263263 fn drop ( & mut self ) {
264+ // The comment below was copied from the original
265+ // implementation of diagnostic reporting. The code
266+ // has been refactored, but this still kind of looked
267+ // relevant, so I've preserved the note. ---AG
268+ //
269+ // TODO: Don't emit the diagnostic if:
270+ // * The enclosing node contains any syntax errors
271+ // * The rule is disabled for this file. We probably want to introduce a new query that
272+ // returns a rule selector for a given file that respects the package's settings,
273+ // any global pragma comments in the file, and any per-file-ignores.
274+
264275 // OK because the only way `self.diag` is `None`
265276 // is via this impl, which can only run at most
266277 // once.
@@ -406,17 +417,6 @@ impl DiagnosticReporter<'_, '_> {
406417/// This will add the diagnostic to the typing context if appropriate.
407418impl Drop for DiagnosticReporter < ' _ , ' _ > {
408419 fn drop ( & mut self ) {
409- // The comment below was copied from the original
410- // implementation of diagnostic reporting. The code
411- // has been refactored, but this still kind of looked
412- // relevant, so I've preserved the note. ---AG
413- //
414- // TODO: Don't emit the diagnostic if:
415- // * The enclosing node contains any syntax errors
416- // * The rule is disabled for this file. We probably want to introduce a new query that
417- // returns a rule selector for a given file that respects the package's settings,
418- // any global pragma comments in the file, and any per-file-ignores.
419-
420420 // OK because the only way `self.diag` is `None`
421421 // is via this impl, which can only run at most
422422 // once.
0 commit comments