Rollup merge of #59170 - varkor:const-generics-rustdoc, r=QuietMisdreavus,eddyb
Add const generics to rustdoc Split out from #53645. This work is a collaborative effort with @yodaldevoid. The `FIXME`s are waiting on a refactor to `LazyConst`. I'll address these in a follow up, but I thought it would be better to implement the rest now to avoid bitrot. r? @QuietMisdreavus
This commit is contained in:
commit
4c79967760
7 changed files with 156 additions and 117 deletions
|
@ -271,7 +271,7 @@ pub struct Cache {
|
|||
/// Mapping of typaram ids to the name of the type parameter. This is used
|
||||
/// when pretty-printing a type (so pretty-printing doesn't have to
|
||||
/// painfully maintain a context like this)
|
||||
pub typarams: FxHashMap<DefId, String>,
|
||||
pub param_names: FxHashMap<DefId, String>,
|
||||
|
||||
/// Maps a type ID to all known implementations for that type. This is only
|
||||
/// recognized for intra-crate `ResolvedPath` types, and is used to print
|
||||
|
@ -368,7 +368,7 @@ pub struct Cache {
|
|||
pub struct RenderInfo {
|
||||
pub inlined: FxHashSet<DefId>,
|
||||
pub external_paths: crate::core::ExternalPaths,
|
||||
pub external_typarams: FxHashMap<DefId, String>,
|
||||
pub external_param_names: FxHashMap<DefId, String>,
|
||||
pub exact_paths: FxHashMap<DefId, Vec<String>>,
|
||||
pub access_levels: AccessLevels<DefId>,
|
||||
pub deref_trait_did: Option<DefId>,
|
||||
|
@ -601,7 +601,7 @@ pub fn run(mut krate: clean::Crate,
|
|||
let RenderInfo {
|
||||
inlined: _,
|
||||
external_paths,
|
||||
external_typarams,
|
||||
external_param_names,
|
||||
exact_paths,
|
||||
access_levels,
|
||||
deref_trait_did,
|
||||
|
@ -635,7 +635,7 @@ pub fn run(mut krate: clean::Crate,
|
|||
deref_mut_trait_did,
|
||||
owned_box_did,
|
||||
masked_crates: mem::replace(&mut krate.masked_crates, Default::default()),
|
||||
typarams: external_typarams,
|
||||
param_names: external_param_names,
|
||||
aliases: Default::default(),
|
||||
};
|
||||
|
||||
|
@ -1751,7 +1751,7 @@ impl<'a> Cache {
|
|||
clean::GenericParamDefKind::Lifetime => {}
|
||||
clean::GenericParamDefKind::Type { did, .. } |
|
||||
clean::GenericParamDefKind::Const { did, .. } => {
|
||||
self.typarams.insert(did, param.name.clone());
|
||||
self.param_names.insert(did, param.name.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue