From 33b2677384149c7b9f56a6a84a628ad0008f0e80 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 4 Oct 2021 23:55:26 -0400 Subject: [PATCH] Suppress broken semicolon_if_nothing_returned lint https://github.com/rust-lang/rust-clippy/issues/7768 error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:849:1 | 849 | / seq_impl!( 850 | | BinaryHeap, 851 | | seq, 852 | | BinaryHeap::clear, ... | 855 | | BinaryHeap::push 856 | | ); | |__^ | note: the lint level is defined here --> serde/src/lib.rs:97:52 | 97 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] | ^^^^^^^^^^^^^^^ = note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 849 + seq_impl!( 850 + BinaryHeap, 851 + seq, 852 + BinaryHeap::clear, 853 + BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())), 854 + BinaryHeap::reserve, ... error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:859:1 | 859 | / seq_impl!( 860 | | BTreeSet, 861 | | seq, 862 | | BTreeSet::clear, ... | 865 | | BTreeSet::insert 866 | | ); | |__^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 859 + seq_impl!( 860 + BTreeSet, 861 + seq, 862 + BTreeSet::clear, 863 + BTreeSet::new(), 864 + nop_reserve, ... error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:869:1 | 869 | / seq_impl!( 870 | | LinkedList, 871 | | seq, 872 | | LinkedList::clear, ... | 875 | | LinkedList::push_back 876 | | ); | |__^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 869 + seq_impl!( 870 + LinkedList, 871 + seq, 872 + LinkedList::clear, 873 + LinkedList::new(), 874 + nop_reserve, ... error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:879:1 | 879 | / seq_impl!( 880 | | HashSet, 881 | | seq, 882 | | HashSet::clear, 883 | | HashSet::with_capacity_and_hasher(size_hint::cautious(seq.size_hint()), S::default()), 884 | | HashSet::reserve, 885 | | HashSet::insert); | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 879 + seq_impl!( 880 + HashSet, 881 + seq, 882 + HashSet::clear, 883 + HashSet::with_capacity_and_hasher(size_hint::cautious(seq.size_hint()), S::default()), 884 + HashSet::reserve, ... error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:888:1 | 888 | / seq_impl!( 889 | | VecDeque, 890 | | seq, 891 | | VecDeque::clear, ... | 894 | | VecDeque::push_back 895 | | ); | |__^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 888 + seq_impl!( 889 + VecDeque, 890 + seq, 891 + VecDeque::clear, 892 + VecDeque::with_capacity(size_hint::cautious(seq.size_hint())), 893 + VecDeque::reserve, ... error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:1300:1 | 1300 | / map_impl!( 1301 | | BTreeMap, 1302 | | map, 1303 | | BTreeMap::new()); | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 1300 + map_impl!( 1301 + BTreeMap, 1302 + map, 1303 + BTreeMap::new());; | error: consider adding a `;` to the last statement for consistent formatting --> serde/src/de/impls.rs:1306:1 | 1306 | / map_impl!( 1307 | | HashMap, 1308 | | map, 1309 | | HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default())); | |___________________________________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned help: add a `;` here | 1306 + map_impl!( 1307 + HashMap, 1308 + map, 1309 + HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default()));; | --- serde/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/serde/src/lib.rs b/serde/src/lib.rs index aad68517..7d757f4a 100644 --- a/serde/src/lib.rs +++ b/serde/src/lib.rs @@ -101,6 +101,8 @@ allow( // clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704 unnested_or_patterns, + // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768 + semicolon_if_nothing_returned, // not available in our oldest supported compiler checked_conversions, empty_enum,