1
1
#![ feature( associated_type_defaults) ]
2
2
#![ warn( clippy:: linkedlist) ]
3
- #![ allow( dead_code, clippy:: needless_pass_by_value) ]
3
+ #![ allow( unused , dead_code, clippy:: needless_pass_by_value) ]
4
4
5
5
extern crate alloc;
6
6
use alloc:: collections:: linked_list:: LinkedList ;
@@ -20,24 +20,29 @@ impl Foo for LinkedList<u8> {
20
20
const BAR : Option < LinkedList < u8 > > = None ;
21
21
}
22
22
23
- struct Bar ;
23
+ pub struct Bar {
24
+ priv_linked_list_field : LinkedList < u8 > ,
25
+ pub pub_linked_list_field : LinkedList < u8 > ,
26
+ }
24
27
impl Bar {
25
28
fn foo ( _: LinkedList < u8 > ) { }
26
29
}
27
30
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
34
36
}
35
-
36
- pub fn test_local_not_linted ( ) {
37
+ fn test_local_not_linted ( ) {
37
38
let _: LinkedList < u8 > ;
38
39
}
39
40
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
43
46
}
47
+
48
+ fn main ( ) { }
0 commit comments