fix: silence some unneded warnings in generated code#90
fix: silence some unneded warnings in generated code#90Ddystopia wants to merge 1 commit intoRust-for-Linux:mainfrom
Conversation
bf3eeb6 to
1f85d0d
Compare
|
I'm running tests and they pass, so I can't use this:
Can you please suggest how to run tests correctly from my machine? |
|
The test that fails verifies that the generated output hasn't changed. But since you changed it, you should also adjust the test (by using Edit: Ah I forgot to mention that you need to specify |
1f85d0d to
4595c6a
Compare
|
Do you need me to change the commit message or something like that? |
|
Yes please :) sorry, I'm pretty busy at the moment. |
1. Macro generates a projection structure and if user will not use it, unused warnings for each field are emitted. 2. If a field of a struct has underscore prefix (e.g. `_marker`), a method `_project__marker` will be generated. This is because `_` is unconditionally placed between `project` and a field name. It generates a `non_snake_case` warning due to two underscores. Changing the name itself would be a breaking change and require more powerful macros. Signed-off-by: Oleksandr Babak <alexanderbabak@proton.me>
4595c6a to
a2ba1e8
Compare
|
Hey sorry for the long wait, do you mind adding a test that fails before the fixes in this PR (but passes afterwards)? Also please rebase, since |
|
Second warning is only issued by rust analyzer, I also noticed that on crates with 2024 edition there is one more warning for |
project()method, compiler warns about fields of the projection struct being never read._marker: PhantomData<T>, rust analyzer (not rustc) gives menon_snake_casewarning. This is because of this internal method:$fvis unsafe fn [<__project_ $field>]<'__slot>. It uses_as a separator but$fieldmay have it too.