summaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorKlaus T. Aehlig <aehlig@linta.de>2024-06-25 17:59:39 +0200
committerKlaus T. Aehlig <aehlig@linta.de>2024-06-25 18:29:41 +0200
commite65cf1d265210738a9b3c0b811fbfeffa0741c39 (patch)
tree3b1bfe9958b324b5bd0768b48bfa76aaaa3eecc7 /src/rust
parent628cb0ab06332086a7ea022bcebfb69d95c38068 (diff)
downloadhello-nix-e65cf1d265210738a9b3c0b811fbfeffa0741c39.tar.gz
Import rust rules and add a minimal example
Note that the PATH for rust targets also has to include that for the C compiler and hence also coreutils, as the rust compiler calls out to `cc`.
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/hello/TARGETS6
-rw-r--r--src/rust/hello/main.rs3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/rust/hello/TARGETS b/src/rust/hello/TARGETS
new file mode 100644
index 0000000..348e7fe
--- /dev/null
+++ b/src/rust/hello/TARGETS
@@ -0,0 +1,6 @@
+{ "":
+ { "type": ["@", "rust", "rust", "binary"]
+ , "name": ["hello"]
+ , "crate_root": ["main.rs"]
+ }
+}
diff --git a/src/rust/hello/main.rs b/src/rust/hello/main.rs
new file mode 100644
index 0000000..21e1c4e
--- /dev/null
+++ b/src/rust/hello/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, World!");
+}