Skip to content

Commit 9ea1544

Browse files
committed
Add a test
1 parent 3295afa commit 9ea1544

File tree

6 files changed

+541
-0
lines changed

6 files changed

+541
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-include ../tools.mk
2+
all: code
3+
krate2: krate2.rs
4+
$(RUSTC) $<
5+
code: foo.rs krate2
6+
$(RUSTC) foo.rs -Zsave-analysis-csv
7+
$(RUSTC) foo.rs -Zsave-analysis
8+
$(RUSTC) foo.rs -Zsave-analysis-api
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// sub-module in the same directory as the main crate file
12+
13+
pub struct SameStruct {
14+
pub name: String
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn hello(x: isize) {
12+
println!("macro {} :-(", x);
13+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// sub-module in a sub-directory
12+
13+
use sub::sub2 as msalias;
14+
use sub::sub2;
15+
16+
static yy: usize = 25;
17+
18+
mod sub {
19+
pub mod sub2 {
20+
pub mod sub3 {
21+
pub fn hello() {
22+
println!("hello from module 3");
23+
}
24+
}
25+
pub fn hello() {
26+
println!("hello from a module");
27+
}
28+
29+
pub struct nested_struct {
30+
pub field2: u32,
31+
}
32+
}
33+
}
34+
35+
pub struct SubStruct {
36+
pub name: String
37+
}

0 commit comments

Comments
 (0)