| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
5637: SSR: Matching trait associated constants, types and functions r=matklad a=davidlattimore
This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`).
Same for associated constants and types that are part of a trait implementation.
However, we still don't support matching calls to trait methods.
Co-authored-by: David Lattimore <[email protected]>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes matching of things like `HashMap::default()` by resolving
`HashMap` instead of `default` (which resolves to `Default::default`).
Same for associated constants and types that are part of a trait
implementation.
However, we still don't support matching calls to trait methods.
|
| | |
|
|/
|
|
|
|
|
|
|
| |
It's now consistent with other variables in that if the pattern
references self, only the `self` in scope where the rule is invoked will
be accepted. Since `self` doesn't work the same as other paths, this is
implemented by restricting the search to just the current function.
Prior to this change (since path resolution was implemented), having
self in a pattern would just result in no matches.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
It seems that Semantics::scope, if given a statement node, won't resolve
locals that were defined in the current scope, only in parent scopes.
Not sure if this is intended / expected behavior, but we work around it
for now by finding another nearby node to use as the scope (e.g. the
expression inside the EXPR_STMT).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This differs from how this used to work before I removed it in that:
a) It's only one direction. Function calls in the pattern can match
method calls in the code, but not the other way around.
b) We now check that the function call in the pattern resolves to the
same function as the method call in the code.
The lack of (b) was the reason I felt the need to remove the feature
before.
|
|
|
|
| |
When the search pattern contains a path, this substantially speeds up finding matches, especially if the path references a private item.
|
|
Also render template paths appropriately for their context.
|