11#![ feature( associated_type_defaults) ]
22#![ warn( clippy:: linkedlist) ]
3- #![ allow( dead_code, clippy:: needless_pass_by_value) ]
3+ #![ allow( unused , dead_code, clippy:: needless_pass_by_value) ]
44
55extern crate alloc;
66use alloc:: collections:: linked_list:: LinkedList ;
@@ -20,24 +20,29 @@ impl Foo for LinkedList<u8> {
2020 const BAR : Option < LinkedList < u8 > > = None ;
2121}
2222
23- struct Bar ;
23+ pub struct Bar {
24+ priv_linked_list_field : LinkedList < u8 > ,
25+ pub pub_linked_list_field : LinkedList < u8 > ,
26+ }
2427impl Bar {
2528 fn foo ( _: LinkedList < u8 > ) { }
2629}
2730
28- pub fn test ( my_favourite_linked_list : LinkedList < u8 > ) {
29- println ! ( "{:?}" , my_favourite_linked_list)
30- }
31-
32- pub fn test_ret ( ) -> Option < LinkedList < u8 > > {
33- unimplemented ! ( ) ;
31+ // All of these test should be trigger the lint because they are not
32+ // part of the public api
33+ fn test ( my_favorite_linked_list : LinkedList < u8 > ) { }
34+ fn test_ret ( ) -> Option < LinkedList < u8 > > {
35+ None
3436}
35-
36- pub fn test_local_not_linted ( ) {
37+ fn test_local_not_linted ( ) {
3738 let _: LinkedList < u8 > ;
3839}
3940
40- fn main ( ) {
41- test ( LinkedList :: new ( ) ) ;
42- test_local_not_linted ( ) ;
41+ // All of these test should be allowed because they are part of the
42+ // public api and `avoid_breaking_exported_api` is `false` by default.
43+ pub fn pub_test ( the_most_awesome_linked_list : LinkedList < u8 > ) { }
44+ pub fn pub_test_ret ( ) -> Option < LinkedList < u8 > > {
45+ None
4346}
47+
48+ fn main ( ) { }
0 commit comments