Rust: extract declarations of builtin types

This commit is contained in:
Arthur Baars
2025-04-30 13:21:56 +02:00
parent 254789c89a
commit 53b2e9708c
4 changed files with 59 additions and 11 deletions

View File

@@ -0,0 +1,8 @@
load("//misc/bazel:pkg.bzl", "codeql_pkg_files")
codeql_pkg_files(
name = "builtins",
srcs = glob(["*.rs"]),
prefix = "builtins",
visibility = ["//rust:__subpackages__"],
)

View File

@@ -0,0 +1,25 @@
// The Language Prelude: https://doc.rust-lang.org/reference/names/preludes.html#language-prelude
// Type namespace
// Boolean type
pub struct bool;
// Textual types
pub struct char;
pub struct str;
// Integer types
pub struct i8;
pub struct i16;
pub struct i32;
pub struct i64;
pub struct i128;
pub struct u8;
pub struct u16;
pub struct u32;
pub struct u64;
pub struct u128;
// Machine-dependent integer types
pub struct usize;
pub struct isize;
// floating-point types
pub struct f32;
pub struct f64;