summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/print_macro/print_macro.rs
blob: 5aefb6a6b4d467031c25d37ca0599ba5b4cb23a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// compile-flags: --test
#![warn(clippy::print_stdout)]
#![warn(clippy::print_stderr)]

fn foo(n: u32) {
    print!("{n}");
    eprint!("{n}");
}

#[test]
pub fn foo1() {
    print!("{}", 1);
    eprint!("{}", 1);
}

#[cfg(test)]
fn foo3() {
    print!("{}", 1);
    eprint!("{}", 1);
}