Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/quote/build.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / quote / build.rs` 32 lines ยท 882 bytes Raw Blame History 1 use std::env; 2 use std::process::Command; 3 use std::str; 4 5 fn main() { 6 println!("cargo:rerun-if-changed=build.rs"); 7 8 let Some(minor) = rustc_minor_version() else { 9 return; 10 }; 11 12 if minor >= 77 { 13 println!("cargo:rustc-check-cfg=cfg(no_diagnostic_namespace)"); 14 } 15 16 // Support for the `#[diagnostic]` tool attribute namespace 17 // https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#diagnostic-attributes 18 if minor < 78 { 19 println!("cargo:rustc-cfg=no_diagnostic_namespace"); 20 } 21 } 22 23 fn rustc_minor_version() -> Option { 24 let rustc = env::var_os("RUSTC")?; 25 let output = Command::new(rustc).arg("--version").output().ok()?; 26 let version = str::from_utf8(&output.stdout).ok()?; 27 let mut pieces = version.split('.'); 28 if pieces.next() != Some("rustc 1") { 29 return None; 30 } 31 pieces.next()?.parse().ok() 32 }