From d34e10fbeb5af70bbc7e22405de60f30c8570087 Mon Sep 17 00:00:00 2001 From: Porter Smith Date: Mon, 26 Nov 2018 16:59:18 -0800 Subject: Add #[must_use] to functions annotated with __attribute__((warn_unused_result)) --- src/codegen/helpers.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/codegen/helpers.rs') diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs index 343f1e30..02909d57 100644 --- a/src/codegen/helpers.rs +++ b/src/codegen/helpers.rs @@ -36,6 +36,12 @@ pub mod attributes { } } + pub fn must_use() -> quote::Tokens { + quote! { + #[must_use] + } + } + pub fn doc(comment: String) -> quote::Tokens { // Doc comments are already preprocessed into nice `///` formats by the // time they get here. Just make sure that we have newlines around it so -- cgit v1.2.3