about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/pub_without_shorthand.fixed
blob: fbe3326400cbc7aafeb46a52f8b34ddde8a552d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//@aux-build:proc_macros.rs
#![feature(custom_inner_attributes)]
#![allow(clippy::needless_pub_self, unused)]
#![warn(clippy::pub_without_shorthand)]
#![no_main]
#![rustfmt::skip] // rustfmt will remove `in`, understandable
                  // but very annoying for our purposes!

#[macro_use]
extern crate proc_macros;

pub(self) fn a() {}
pub(self) fn b() {}
//~^ pub_without_shorthand

pub fn c() {}
mod a {
    pub(super) fn d() {}
    //~^ pub_without_shorthand
    pub(super) fn e() {}
    pub(self) fn f() {}
    pub(crate) fn k() {}
    pub(crate) fn m() {}
    //~^ pub_without_shorthand
    mod b {
        pub(in crate::a) fn l() {}
    }
}

external! {
    pub(self) fn g() {}
    pub(in self) fn h() {}
}
with_span! {
    span
    pub(self) fn i() {}
    pub(in self) fn j() {}
}

// not really anything more to test. just a really simple lint overall