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 | 6656413a5c9beb774dfde16804aa523cf9dbf1b5 (patch) | |
| tree | ca630e7c69d363fba81ed572433b3d50c61bb117 /src/tools/clippy/clippy_lints | |
| parent | d02150fd45b4e63007a446f497ce032f48b1166e (diff) | |
| download | rust-6656413a5c9beb774dfde16804aa523cf9dbf1b5.tar.gz rust-6656413a5c9beb774dfde16804aa523cf9dbf1b5.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.)
Diffstat (limited to 'src/tools/clippy/clippy_lints')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs b/src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs index a744b69ecb4..8b018220c17 100644 --- a/src/tools/clippy/clippy_lints/src/doc/needless_doctest_main.rs +++ b/src/tools/clippy/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); }, }; |
