]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/item_after_statement.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / item_after_statement.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3 #![warn(items_after_statements)]
4
5 fn ok() {
6 fn foo() { println!("foo"); }
7 foo();
8 }
9
10 fn last() {
11 foo();
12 fn foo() { println!("foo"); }
13 }
14
15 fn main() {
16 foo();
17 fn foo() { println!("foo"); }
18 foo();
19 }
20
21 fn mac() {
22 let mut a = 5;
23 println!("{}", a);
24 // do not lint this, because it needs to be after `a`
25 macro_rules! b {
26 () => {{ a = 6 }}
27 }
28 b!();
29 println!("{}", a);
30 }