Skip to content

Ability to have *-pointers as arguments to MethodDefs #16781

Closed
@Manishearth

Description

@Manishearth

I'm trying to write a syntax extension that works similar to #[deriving(Encodable)], where a trait JSTraceable can be applied to types where all subfields implement that JSTraceable, such that calling .trace() will simply call .trace() on all subfields with the same arguments (there is no output to be treed up like with Clone and PartialEq)

The signature I want is the following:

trait Traceable {
    fn trace(&self, trc: *mut JSTracer);
}

However, there's a problem here. Following the internal implementation, I need to supply a MethodDef, which includes an argument list of Tys

However,Ty doesn't support *-pointers, so I will probably have to work around this with a second trait and some transmutes (which I'd rather not do)

Could we get support for * pointers in MethodDef?

Metadata

Metadata

Assignees

No one assigned

    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