goblin icon indicating copy to clipboard operation
goblin copied to clipboard

Nightly has what appear to be upcoming serious failures

Open m4b opened this issue 6 months ago • 1 comments

error: implicit autoref creates a reference to the dereference of a raw pointer
   --> src/elf/dynamic.rs:788:5
    |
570 |                         let lib = &(*strtab)[dynamic.d_val as usize];
    |                                      ------ this raw pointer has type `*const Strtab<'_>`
...
788 |     elf_dyn_std_impl!(u32, crate::elf32::program_header::ProgramHeader);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: creating a reference requires the pointer target to be valid and imposes aliasing requirements
note: autoref is being applied to this expression, resulting in: `&Strtab<'_>`
   --> src/elf/dynamic.rs:570:36
    |
570 |                         let lib = &(*strtab)[dynamic.d_val as usize];
    |                                    ^^^^^^^^^
...
788 |     elf_dyn_std_impl!(u32, crate::elf32::program_header::ProgramHeader);
    |     ------------------------------------------------------------------- in this macro invocation
    = note: `#[deny(dangerous_implicit_autorefs)]` on by default
    = note: this error originates in the macro `elf_dyn_std_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
    |
570 |                         let lib = &(&(*strtab))[dynamic.d_val as usize];
    |                                    ++         +

error: implicit autoref creates a reference to the dereference of a raw pointer
   --> src/elf/dynamic.rs:802:5
    |
570 |                         let lib = &(*strtab)[dynamic.d_val as usize];
    |                                      ------ this raw pointer has type `*const Strtab<'_>`
...
802 |     elf_dyn_std_impl!(u64, crate::elf64::program_header::ProgramHeader);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: creating a reference requires the pointer target to be valid and imposes aliasing requirements
note: autoref is being applied to this expression, resulting in: `&Strtab<'_>`
   --> src/elf/dynamic.rs:570:36
    |
570 |                         let lib = &(*strtab)[dynamic.d_val as usize];
    |                                    ^^^^^^^^^
...
802 |     elf_dyn_std_impl!(u64, crate::elf64::program_header::ProgramHeader);
    |     ------------------------------------------------------------------- in this macro invocation
    = note: this error originates in the macro `elf_dyn_std_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
    |
570 |                         let lib = &(&(*strtab))[dynamic.d_val as usize];
    |                                    ++         +

m4b avatar Jun 14 '25 19:06 m4b

https://github.com/m4b/goblin/pull/471#issuecomment-2972466261

m4b avatar Jun 14 '25 19:06 m4b