mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Nicer display of projections in Chalk logs
This commit is contained in:
parent
7886513f89
commit
2e7b88b525
3 changed files with 12 additions and 8 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1013,6 +1013,7 @@ dependencies = [
|
|||
"chalk-solve",
|
||||
"ena",
|
||||
"insta",
|
||||
"itertools",
|
||||
"log",
|
||||
"ra_arena",
|
||||
"ra_db",
|
||||
|
|
|
@ -8,6 +8,7 @@ authors = ["rust-analyzer developers"]
|
|||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
itertools = "0.9.0"
|
||||
arrayvec = "0.5.1"
|
||||
smallvec = "1.2.0"
|
||||
ena = "0.13.1"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
use std::fmt;
|
||||
|
||||
use chalk_ir::{AliasTy, Goal, Goals, Lifetime, Parameter, ProgramClauseImplication, TypeName};
|
||||
use itertools::Itertools;
|
||||
|
||||
use super::{from_chalk, Interner};
|
||||
use crate::{db::HirDatabase, CallableDef, TypeCtor};
|
||||
|
@ -133,14 +134,15 @@ impl DebugContext<'_> {
|
|||
};
|
||||
let trait_data = self.0.trait_data(trait_);
|
||||
let params = alias.substitution.parameters(&Interner);
|
||||
write!(
|
||||
fmt,
|
||||
"<{:?} as {}<{:?}>>::{}",
|
||||
¶ms[0],
|
||||
trait_data.name,
|
||||
¶ms[1..],
|
||||
type_alias_data.name
|
||||
)
|
||||
write!(fmt, "<{:?} as {}", ¶ms[0], trait_data.name,)?;
|
||||
if params.len() > 1 {
|
||||
write!(
|
||||
fmt,
|
||||
"<{}>",
|
||||
¶ms[1..].iter().format_with(", ", |x, f| f(&format_args!("{:?}", x))),
|
||||
)?;
|
||||
}
|
||||
write!(fmt, ">::{}", type_alias_data.name)
|
||||
}
|
||||
|
||||
pub fn debug_ty(
|
||||
|
|
Loading…
Reference in a new issue