mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Style hover messages a bit differently
This commit is contained in:
parent
3741b863a6
commit
a953875f49
3 changed files with 363 additions and 117 deletions
|
@ -34,7 +34,10 @@ pub mod term_search;
|
|||
|
||||
mod display;
|
||||
|
||||
use std::{mem::discriminant, ops::ControlFlow};
|
||||
use std::{
|
||||
mem::discriminant,
|
||||
ops::{ControlFlow, Not},
|
||||
};
|
||||
|
||||
use arrayvec::ArrayVec;
|
||||
use base_db::{CrateDisplayName, CrateId, CrateOrigin};
|
||||
|
@ -2697,6 +2700,18 @@ impl Trait {
|
|||
hir_ty::dyn_compatibility::dyn_compatibility(db, self.id)
|
||||
}
|
||||
|
||||
pub fn dyn_compatibility_all_violations(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
) -> Option<Vec<DynCompatibilityViolation>> {
|
||||
let mut violations = vec![];
|
||||
hir_ty::dyn_compatibility::dyn_compatibility_with_callback(db, self.id, &mut |violation| {
|
||||
violations.push(violation);
|
||||
ControlFlow::Continue(())
|
||||
});
|
||||
violations.is_empty().not().then_some(violations)
|
||||
}
|
||||
|
||||
fn all_macro_calls(&self, db: &dyn HirDatabase) -> Box<[(AstId<ast::Item>, MacroCallId)]> {
|
||||
db.trait_data(self.id)
|
||||
.macro_calls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue