diff --git a/.vscode/settings.json b/.vscode/settings.json index 62f7ed6..3972966 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,14 @@ { "root_module": "src/main.rs", "edition": "2018", + "deps": [{ + "crate": 1, + "name": "hello", + }], + }, + { + "root_module": "include/hello.rs", + "edition": "2018", "deps": [], }, ] diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..3786f22 --- /dev/null +++ b/compile.sh @@ -0,0 +1,2 @@ +rustc --crate-type=lib include/hello.rs +rustc --extern hello=libhello.rlib src/main.rs \ No newline at end of file diff --git a/include/hello.rs b/include/hello.rs new file mode 100644 index 0000000..fda37c3 --- /dev/null +++ b/include/hello.rs @@ -0,0 +1,4 @@ +/// prints a hello world message +pub fn print_hello() { + println!("Hello World!"); +} diff --git a/src/main.rs b/src/main.rs index 588039a..0a25bc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; -fn foo() {} fn main() { - std::asm!() - println!("Hello, world!"); + std::assert!(true); + hello::print_hello(); }