5823: Don't underline function definition if self is &mut r=Nashenas88 a=matklad

The self is right there, and is already underlined, so it makes little
sense to emit even more underlines.

before:
![before](https://user-images.githubusercontent.com/1711539/90672843-0d379500-e257-11ea-840f-b0caed4410f1.png)
after:
![after](https://user-images.githubusercontent.com/1711539/90672840-0c9efe80-e257-11ea-9739-23af433841c6.png)



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-08-22 14:41:17 +00:00 committed by GitHub
commit e65d48d1fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View file

@ -748,12 +748,6 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
if func.is_unsafe(db) {
h |= HighlightModifier::Unsafe;
}
if let Some(self_param) = func.self_param(db) {
match self_param.access(db) {
hir::Access::Exclusive => h |= HighlightModifier::Mutable,
hir::Access::Shared | hir::Access::Owned => (),
}
}
return h;
}
hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Struct,