rustdoc: Introduce new DynTrait
type for better representation of trait objects
This commit is contained in:
parent
1f65f56461
commit
4ea27484c9
9 changed files with 117 additions and 116 deletions
|
@ -402,6 +402,15 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
|
|||
self.cache.parent_stack.push(did);
|
||||
true
|
||||
}
|
||||
clean::DynTrait(ref bounds, _)
|
||||
| clean::BorrowedRef { type_: box clean::DynTrait(ref bounds, _), .. } => {
|
||||
if let Some(did) = bounds[0].trait_.def_id() {
|
||||
self.cache.parent_stack.push(did);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
ref t => {
|
||||
let prim_did = t
|
||||
.primitive_type()
|
||||
|
@ -432,6 +441,12 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
|
|||
| clean::BorrowedRef { type_: box clean::ResolvedPath { did, .. }, .. } => {
|
||||
dids.insert(did);
|
||||
}
|
||||
clean::DynTrait(ref bounds, _)
|
||||
| clean::BorrowedRef { type_: box clean::DynTrait(ref bounds, _), .. } => {
|
||||
if let Some(did) = bounds[0].trait_.def_id() {
|
||||
dids.insert(did);
|
||||
}
|
||||
}
|
||||
ref t => {
|
||||
let did = t
|
||||
.primitive_type()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue