diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-11 14:22:44 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-11 18:37:56 +1100 |
| commit | fb83ef649587413c4e3a8ec9e364b828ec250a56 (patch) | |
| tree | fe94665cac9f56e6f1c8747b45baab580fa4645b | |
| parent | beeaee97859f34c7a618565e6ff8539b52ac3912 (diff) | |
| download | rust-fb83ef649587413c4e3a8ec9e364b828ec250a56.tar.gz rust-fb83ef649587413c4e3a8ec9e364b828ec250a56.zip | |
Stop using `DiagnosticBuilder::buffer` in the parser.
One consequence is that errors returned by `maybe_new_parser_from_source_str` now must be consumed, so a bunch of places that previously ignored those errors now cancel them. (Most of them explicitly dropped the errors before. I guess that was to indicate "we are explicitly ignoring these", though I'm not 100% sure.)
| -rw-r--r-- | clippy_lints/src/doc/needless_doctest_main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/doc/needless_doctest_main.rs b/clippy_lints/src/doc/needless_doctest_main.rs index a744b69ecb4..8b018220c17 100644 --- a/clippy_lints/src/doc/needless_doctest_main.rs +++ b/clippy_lints/src/doc/needless_doctest_main.rs @@ -53,7 +53,7 @@ pub fn check( let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) { Ok(p) => p, Err(errs) => { - drop(errs); + errs.into_iter().for_each(|err| err.cancel()); return (false, test_attr_spans); }, }; |
