]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/item_after_statement.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / item_after_statement.rs
CommitLineData
abe05a73
XL
1
2
ea8adc8c
XL
3#![warn(items_after_statements)]
4
5fn ok() {
6 fn foo() { println!("foo"); }
7 foo();
8}
9
10fn last() {
11 foo();
12 fn foo() { println!("foo"); }
13}
14
15fn main() {
16 foo();
17 fn foo() { println!("foo"); }
18 foo();
19}
20
21fn 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}