mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Merge #7907
7907: Autoderef with visibility r=cynecx a=cynecx
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7841.
I am not sure about the general approach here. Right now this simply tries to check whether the autoderef candidate is reachable from the current module. ~~However this doesn't exactly work with traits (see the `tests::macros::infer_derive_clone_in_core` test, which fails right now).~~ see comment below
Refs:
- `rustc_typeck` checking fields: 66ec64ccf3/compiler/rustc_typeck/src/check/expr.rs (L1610)
r? @flodiebold
Co-authored-by: cynecx <me@cynecx.net>
This commit is contained in:
commit
d7db38fff9
10 changed files with 250 additions and 37 deletions
|
@ -1999,6 +1999,7 @@ impl Type {
|
|||
env,
|
||||
krate,
|
||||
traits_in_scope,
|
||||
None,
|
||||
name,
|
||||
method_resolution::LookupMode::MethodCall,
|
||||
|ty, it| match it {
|
||||
|
@ -2031,6 +2032,7 @@ impl Type {
|
|||
env,
|
||||
krate,
|
||||
traits_in_scope,
|
||||
None,
|
||||
name,
|
||||
method_resolution::LookupMode::Path,
|
||||
|ty, it| callback(ty, it.into()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue