]> git.lizzy.rs Git - rust.git/blob - tests/ui/item_after_statement.rs
Merge pull request #2065 from rust-lang-nursery/cargo_clippy
[rust.git] / tests / ui / item_after_statement.rs
1
2
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 }