File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed
Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ pkg_filegroup(
3636 srcs = [
3737 ":tools-arch" ,
3838 "//rust/tools" ,
39+ "//rust/tools/builtins" ,
3940 ],
4041 prefix = "tools" ,
4142)
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use std::{
1717 collections:: HashMap ,
1818 path:: { Path , PathBuf } ,
1919} ;
20+ use std:: { env, fs} ;
2021use tracing:: { error, info, warn} ;
2122use tracing_subscriber:: layer:: SubscriberExt ;
2223use tracing_subscriber:: util:: SubscriberInitExt ;
@@ -276,5 +277,13 @@ fn main() -> anyhow::Result<()> {
276277 }
277278 }
278279 }
280+ let builtins_dir = env:: var ( "CODEQL_EXTRACTOR_RUST_ROOT" )
281+ . map ( |path| Path :: new ( & path) . join ( "tools" ) . join ( "builtins" ) ) ?;
282+ let builtins = fs:: read_dir ( builtins_dir) . context ( "failed to read builtins directory" ) ?;
283+ for entry in builtins {
284+ let entry = entry. context ( "failed to read builtins directory" ) ?;
285+ extractor. extract_without_semantics ( & entry. path ( ) , "builtins" ) ;
286+ }
287+
279288 extractor. emit_extraction_diagnostics ( start, & cfg)
280289}
Original file line number Diff line number Diff line change 1+ load ("//misc/bazel:pkg.bzl" , "codeql_pkg_files" )
2+
3+ codeql_pkg_files (
4+ name = "builtins" ,
5+ srcs = glob (["*.rs" ]),
6+ prefix = "builtins" ,
7+ visibility = ["//rust:__subpackages__" ],
8+ )
Original file line number Diff line number Diff line change 1+ // The Language Prelude: https://doc.rust-lang.org/reference/names/preludes.html#language-prelude
2+
3+ // Type namespace
4+ // Boolean type
5+ struct bool ;
6+ // Textual types
7+ struct char ;
8+ struct str ;
9+ // Integer types
10+ struct i8 ;
11+ struct i16 ;
12+ struct i32 ;
13+ struct i64 ;
14+ struct i128 ;
15+ struct u8 ;
16+ struct u16 ;
17+ struct u32 ;
18+ struct u64 ;
19+ struct u128 ;
20+ // Machine-dependent integer types
21+ struct usize ;
22+ struct isize ;
23+ // floating-point types
24+ struct f32 ;
25+ struct f64 ;
You can’t perform that action at this time.
0 commit comments