From d709191be13a0e70d3bd5271d17fa1ae646a8e0d Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 6 Mar 2019 12:02:20 +0100 Subject: [PATCH] doc(runtime-c-api) Declare the example as C, so that they are not tested. Those examples contain C code. They must not be run by `rustdoc` as tests. --- lib/runtime-c-api/src/lib.rs | 6 ++++-- lib/runtime-c-api/wasmer.h | 4 ++-- lib/runtime-c-api/wasmer.hh | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/runtime-c-api/src/lib.rs b/lib/runtime-c-api/src/lib.rs index 3b08d9103..591a03a54 100644 --- a/lib/runtime-c-api/src/lib.rs +++ b/lib/runtime-c-api/src/lib.rs @@ -1498,7 +1498,8 @@ fn take_last_error() -> Option> { /// bytes needed to store a message. /// /// # Example -/// ``` +/// +/// ```c /// int error_len = wasmer_last_error_length(); /// char *error_str = malloc(error_len); /// ``` @@ -1517,7 +1518,8 @@ pub extern "C" fn wasmer_last_error_length() -> c_int { /// Returns `-1` if an error occurs. /// /// # Example -/// ``` +/// +/// ```c /// int error_len = wasmer_last_error_length(); /// char *error_str = malloc(error_len); /// wasmer_last_error_message(error_str, error_len); diff --git a/lib/runtime-c-api/wasmer.h b/lib/runtime-c-api/wasmer.h index 9681d5dce..8ecdd1d7d 100644 --- a/lib/runtime-c-api/wasmer.h +++ b/lib/runtime-c-api/wasmer.h @@ -417,7 +417,7 @@ wasmer_result_t wasmer_instantiate(wasmer_instance_t **instance, * This can be used to dynamically allocate a buffer with the correct number of * bytes needed to store a message. * # Example - * ``` + * ```c * int error_len = wasmer_last_error_length(); * char *error_str = malloc(error_len); * ``` @@ -430,7 +430,7 @@ int wasmer_last_error_length(void); * Returns the length of the string in bytes. * Returns `-1` if an error occurs. * # Example - * ``` + * ```c * int error_len = wasmer_last_error_length(); * char *error_str = malloc(error_len); * wasmer_last_error_message(error_str, error_len); diff --git a/lib/runtime-c-api/wasmer.hh b/lib/runtime-c-api/wasmer.hh index 3bd59bd89..b093b2b64 100644 --- a/lib/runtime-c-api/wasmer.hh +++ b/lib/runtime-c-api/wasmer.hh @@ -333,7 +333,7 @@ wasmer_result_t wasmer_instantiate(wasmer_instance_t **instance, /// This can be used to dynamically allocate a buffer with the correct number of /// bytes needed to store a message. /// # Example -/// ``` +/// ```c /// int error_len = wasmer_last_error_length(); /// char *error_str = malloc(error_len); /// ``` @@ -344,7 +344,7 @@ int wasmer_last_error_length(); /// Returns the length of the string in bytes. /// Returns `-1` if an error occurs. /// # Example -/// ``` +/// ```c /// int error_len = wasmer_last_error_length(); /// char *error_str = malloc(error_len); /// wasmer_last_error_message(error_str, error_len);