diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-01-01 03:03:14 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-01-24 13:01:21 +1100 |
| commit | 000dc07f71baafc31da74e392ad5530fb6de9757 (patch) | |
| tree | 5b60f38422c12d75b735335ba9ca88d913878cd5 /src/rustllvm/RustWrapper.cpp | |
| parent | 4be79d6acde9eed3a9b5281a46f385bcb4ce736c (diff) | |
| download | rust-000dc07f71baafc31da74e392ad5530fb6de9757.tar.gz rust-000dc07f71baafc31da74e392ad5530fb6de9757.zip | |
Store a method-from-trait's impl in some cases when it is known.
This allows one to look at an `ExprMethodCall` `foo.bar()` where `bar`
is a method in some trait and (sometimes) extract the `impl` that `bar`
is defined in, e.g.
trait Foo {
fn bar(&self);
}
impl Foo for uint { // <A>
fn bar(&self) {}
}
fn main() {
1u.bar(); // impl_def_id == Some(<A>)
}
This definitely doesn't handle all cases, but is correct when it is
known, meaning it should only be used for certain linting/heuristic
purposes; no safety analysis.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
