mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
37 lines
517 B
Rust
37 lines
517 B
Rust
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
|
|
|
|
type Result<
|
|
T, // T
|
|
> = ::std::result::Result<
|
|
T, // $ item=T
|
|
String,
|
|
>; // my::Result
|
|
|
|
fn int_div(
|
|
x: i32, //
|
|
y: i32,
|
|
) -> Result<i32> // $ item=my::Result
|
|
{
|
|
if y == 0 {
|
|
return Err("Div by zero".to_string());
|
|
}
|
|
Ok(x / y)
|
|
}
|