Explorar el Código

Produce a compilation error if riscv-rt appears more than once in the dependency graph

Vadim Kaushan hace 6 años
padre
commit
8163823a83
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      riscv-rt/src/lib.rs

+ 4 - 0
riscv-rt/src/lib.rs

@@ -210,6 +210,10 @@ pub use macros::{entry, pre_init};
 
 use riscv::register::{mstatus, mtvec};
 
+#[export_name = "error: riscv-rt appears more than once in the dependency graph"]
+#[doc(hidden)]
+pub static __ONCE__: () = ();
+
 extern "C" {
     // Boundaries of the .bss section
     static mut _ebss: u32;