summaryrefslogtreecommitdiff
path: root/src/codegen/helpers.rs
diff options
context:
space:
mode:
authorPorter Smith <flowbish@gmail.com>2018-11-26 16:59:18 -0800
committerPorter Smith <flowbish@gmail.com>2018-11-27 11:31:27 -0800
commitd34e10fbeb5af70bbc7e22405de60f30c8570087 (patch)
tree97d285a485da5af97b680dc1a6a181c39be5c08a /src/codegen/helpers.rs
parent1e527e2575119784a0c61783576356090c2be1e1 (diff)
Add #[must_use] to functions annotated with __attribute__((warn_unused_result))
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r--src/codegen/helpers.rs6
1 files changed, 6 insertions, 0 deletions
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