dtolnay / dtolnay/reflect

Implement auto-ref

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
780
Forks
23
PR merge metrics
No merged PRs in 30d

Description

If a library method is declared to take self by reference or mut reference and the user's macro invokes the method with a receiver that is not a reference, it would be good to mirror rustc's rules around automatically taking a reference to the receiver.

```rust
library! {
extern crate krate {
type Struct;

impl Struct {
fn method(&self);
}
}
}

let receiver = /* ... by value */;
RUNTIME::krate::Struct::method.INVOKE(receiver.reference()); // should not require reference()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.