mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-24 03:10:28 +02:00
This is a contribution of a Chromium section for Comprehensive Rust. --------- Co-authored-by: Nicole L <dlegare.1001@gmail.com> Co-authored-by: Martin Geisler <martin@geisler.net>
456 B
456 B
Including unsafe
Rust code
Unsafe Rust code is forbidden in rust_static_library
by default - it won't
compile. If you need unsafe Rust code, add allow_unsafe = true
to the
gn target. (Later in the course we'll see circumstances where this is necessary.)
import("//build/rust/rust_static_library.gni")
rust_static_library("my_rust_lib") {
crate_root = "lib.rs"
sources = [
"lib.rs",
"hippopotamus.rs"
]
allow_unsafe = true
}