Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust): fix no_std compilation due to ockam::node attribute #2355

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ fn output_node(
let err_handling = if ret_type == ReturnType::Default {
quote! {.unwrap();}
} else {
#[cfg(feature = "std")]
quote! {?}

// For now the executor's `Executor::execute` for std returns `Result<F::Output>`
// while for no_std it returns `Result<()>` and always returns `Ok(())` or panics.
// So while it makes sense using the `?` operator in std in no_std just returning Ok(())
// would be enough(since execute already hides the return type) but we are letting the
// `Executor::execute` return bubble up to keep the code simpler.
// Note: This also means that for no_std `main` return type can only be `Result<()>` or nothing.
#[cfg(not(feature = "std"))]
quote! {}
};

// Assumes the target platform knows about main() functions
Expand Down