mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 23:25:03 +00:00
Adds impl Deref assist
This commit is contained in:
parent
5b40342d2d
commit
a624e2ea8d
6 changed files with 185 additions and 0 deletions
|
@ -113,6 +113,10 @@ impl FamousDefs<'_, '_> {
|
|||
self.find_module("core:iter")
|
||||
}
|
||||
|
||||
pub fn core_ops_Deref(&self) -> Option<Trait> {
|
||||
self.find_trait("core:ops:Deref")
|
||||
}
|
||||
|
||||
fn find_trait(&self, path: &str) -> Option<Trait> {
|
||||
match self.find_def(path)? {
|
||||
hir::ScopeDef::ModuleDef(hir::ModuleDef::Trait(it)) => Some(it),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue