rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
906 stars 60 forks source link

Add #[must_use] to libgccjit Context::new_call #358

Closed antoyo closed 5 months ago

antoyo commented 10 months ago

The result of of the method Context::new_call() must always be used, either as part of another expression, or through Block::add_eval() if the call is done for its side effects.

As such, adding the attribute #[must_use] attribute will allow seeing where we forget to use the call.

mubarak23 commented 5 months ago

@antoyo can you add more description to this issue, i will like to pick it and work on it

antoyo commented 5 months ago

@mubarak23: I edited the description to add details. Feel free to ask questions if you need more details.

mubarak23 commented 5 months ago

So Adding the #[must_use] attribute to new_call() would help in catching situations @antoyo

mubarak23 commented 5 months ago

@antoyo assign this issue to me, let me work on it.

antoyo commented 5 months ago

Done. Feel free to ask any questions.

mubarak23 commented 5 months ago

@antoyo this is the PR Link, kindly review, let me know where i can improve or make necessary changes

antoyo commented 5 months ago

Done in https://github.com/rust-lang/gccjit.rs/pull/30.