summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/print_macro/print_macro.rs
blob: 3a8b30cca36a6f12cd609f670f71ce9707bb2347 (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);
}