2179: Use HirDatabase to compute `is_deprecated` r=matklad a=martskins

This PR fixes #2167 by introducing `attributes_query` and adding `fn attrs(&self, def: crate::AttrDef) -> Option<Arc<[Attr]>>;`  to the `DefDatabase` trait.

I'm a little concerned about the two spots in `attributes_query` where code is repeated, but I couldn't figure out a way to avoid that, so.. I welcome suggestions 😄 



Co-authored-by: Martin Asquino <martin.asquino@gmail.com>
This commit is contained in:
bors[bot] 2019-11-06 21:11:42 +00:00 committed by GitHub
commit 14e19c0df1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 111 additions and 14 deletions

View file

@ -2,6 +2,7 @@
pub(crate) mod src;
pub(crate) mod docs;
pub(crate) mod attrs;
use std::sync::Arc;