Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ jobs:
- name: test no-std
run: |
cd ./test_suite/derive_tests_no_std
cargo run --no-default-features
rustup target add x86_64-unknown-none
cargo run --target x86_64-unknown-none --no-default-features
20 changes: 20 additions & 0 deletions Makefile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makefile doesn't seem to be used? Can we remove it?

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: check test clean

check:
cargo clippy --all-targets -- -D warnings
cargo clippy --all --all-features -- -D warnings
cargo check --no-default-features --features bit-vec
cargo check --no-default-features --features docs
cargo check --no-default-features --features serde
cargo check --no-default-features --features serde,decode
cargo check --no-default-features --features schema

test:
cargo test --all --all-features
cd ./test_suite/derive_tests_no_std; \
cargo run --target x86_64-unknown-none --no-default-features

clean:
cargo clean
cd ./test_suite/derive_tests_no_std; \
cargo clean
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.84.1"
targets = ["wasm32-unknown-unknown", "x86_64-unknown-none"]
19 changes: 14 additions & 5 deletions test_suite/derive_tests_no_std/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#![allow(internal_features)]
#![feature(lang_items, start)]
#![feature(alloc_error_handler)]
#![feature(lang_items, alloc_error_handler)]
#![no_std]
#![no_main]

#[start]
fn start(_argc: isize, _argv: *const *const u8) -> isize {
#[no_mangle]
pub extern "C" fn _start() {
test();
0

use core::arch::asm;
unsafe {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment that this inline assembly makes a syscall exit(0)?

asm!(
"syscall",
in("rax") 60,
in("rdi") 0,
options(noreturn)
);
}
}

#[lang = "eh_personality"]
Expand Down