Skip to content

Support pointers to non-integer, non-Path types? #507

@iximeow

Description

@iximeow

I tried writing this probe today:

fn nvme_interrupt_completion_single(cq: *const CompQueue) {}

and got told Only pointers to integer types are supported because of my devious *const CompQueue. I assume the motivation here is that because repr(Rust) types have unstable layout and may change, it's really a bad idea to write a probe that depends on anything behind that pointer. But I really just want to distinguish the pointer arguments here, not read through them.

I've made the argument a usize for the time being, which is.. functionally enough. If I correctly understand why we don't support pointers to other types, maybe we could loosen that to allow any type that has #[repr(C)]? Then the error could suggest this, too. In this context it'd be totally fine to make CompQueue also repr(C) in support of debuggability, too, so that would probably be a net improvement!

(preemptively assigning myself mostly because I think the change would be small, but I don't plan on posting a PR quickly. If discussion gets settled and someone wants to Do The Thing, I heartily encourage stealing this from me :) )

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions