mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Abstract over ItemTreeLoc
This commit is contained in:
parent
2ebf0c87c2
commit
00303c3b67
11 changed files with 160 additions and 229 deletions
|
@ -814,9 +814,8 @@ impl HirDisplay for Ty {
|
|||
|
||||
// Don't count Sized but count when it absent
|
||||
// (i.e. when explicit ?Sized bound is set).
|
||||
let default_sized = SizedByDefault::Sized {
|
||||
anchor: func.lookup(db.upcast()).module(db.upcast()).krate(),
|
||||
};
|
||||
let default_sized =
|
||||
SizedByDefault::Sized { anchor: func.krate(db.upcast()) };
|
||||
let sized_bounds = bounds
|
||||
.skip_binders()
|
||||
.iter()
|
||||
|
@ -1025,7 +1024,7 @@ impl HirDisplay for Ty {
|
|||
let data =
|
||||
(*datas).as_ref().map(|rpit| rpit.impl_traits[idx].bounds.clone());
|
||||
let bounds = data.substitute(Interner, ¶meters);
|
||||
let krate = func.lookup(db.upcast()).module(db.upcast()).krate();
|
||||
let krate = func.krate(db.upcast());
|
||||
write_bounds_like_dyn_trait_with_prefix(
|
||||
f,
|
||||
"impl",
|
||||
|
@ -1191,7 +1190,7 @@ impl HirDisplay for Ty {
|
|||
let data =
|
||||
(*datas).as_ref().map(|rpit| rpit.impl_traits[idx].bounds.clone());
|
||||
let bounds = data.substitute(Interner, &opaque_ty.substitution);
|
||||
let krate = func.lookup(db.upcast()).module(db.upcast()).krate();
|
||||
let krate = func.krate(db.upcast());
|
||||
write_bounds_like_dyn_trait_with_prefix(
|
||||
f,
|
||||
"impl",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue