forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmy.rs
More file actions
36 lines (30 loc) · 627 Bytes
/
my.rs
File metadata and controls
36 lines (30 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pub mod nested; // I37
use nested::g; // $ item=I7
pub fn f() {
println!("my.rs::f");
} // I38
pub fn h() {
println!("my.rs::h");
g(); // $ item=I7
} // I39
mod my4 {
pub mod my5;
}
pub use my4::my5::f as nested_f; // $ item=I201
#[rustfmt::skip]
type Result<
T, // T
> = ::std::result::Result<
T, // $ item=T
String,> // $ item=Result $ item=String
; // my::Result
fn int_div(
x: i32, // $ item=i32
y: i32, // $ item=i32
) -> Result<i32> // $ item=my::Result $ item=i32
{
if y == 0 {
return Err("Div by zero".to_string()); // $ item=Err
}
Ok(x / y) // $ item=Ok
}