diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-11-24 12:27:37 -0800 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-11-25 12:08:05 -0800 |
| commit | d81deb33fa8e9f03006b637fd0c035dc7acc5343 (patch) | |
| tree | 30221794a3a99eaf49f63148f3be006652a1a657 /src/librustdoc/html/render | |
| parent | 8adb0b6d6c264facc6e213ad06a25194e7591682 (diff) | |
| download | rust-d81deb33fa8e9f03006b637fd0c035dc7acc5343.tar.gz rust-d81deb33fa8e9f03006b637fd0c035dc7acc5343.zip | |
Stop re-exporting `Type::ResolvedPath`
I would like to rename it to `Type::Path`, but then it can't be re-exported since the name would conflict with the `Path` struct. Usually enum variants are referred to using their qualified names in Rust (and parts of rustdoc already do that with `clean::Type`), so this is also more consistent with the language.
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 25 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index c114edf1e70..ffa5ec8a3ee 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -218,7 +218,7 @@ fn get_index_type(clean_type: &clean::Type, generics: Vec<TypeWithKind>) -> Rend fn get_index_type_name(clean_type: &clean::Type, accept_generic: bool) -> Option<Symbol> { match *clean_type { - clean::ResolvedPath { ref path, .. } => { + clean::Type::ResolvedPath { ref path, .. } => { let path_segment = path.segments.last().unwrap(); Some(path_segment.name) } diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 7d231a0d649..42a2defa757 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1227,7 +1227,7 @@ fn should_render_item(item: &clean::Item, deref_mut_: bool, tcx: TyCtxt<'_>) -> | SelfTy::SelfExplicit(clean::BorrowedRef { mutability, .. }) => { (mutability == Mutability::Mut, false, false) } - SelfTy::SelfExplicit(clean::ResolvedPath { path }) => { + SelfTy::SelfExplicit(clean::Type::ResolvedPath { path }) => { (false, Some(path.def_id()) == tcx.lang_items().owned_box(), false) } SelfTy::SelfValue => (false, false, true), diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index e59b94f6b7d..f8a16fb9b71 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -727,10 +727,10 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra let mut implementor_dups: FxHashMap<Symbol, (DefId, bool)> = FxHashMap::default(); for implementor in implementors { match implementor.inner_impl().for_ { - clean::ResolvedPath { ref path } - | clean::BorrowedRef { type_: box clean::ResolvedPath { ref path }, .. } - if !path.is_assoc_ty() => - { + clean::Type::ResolvedPath { ref path } + | clean::BorrowedRef { + type_: box clean::Type::ResolvedPath { ref path }, .. + } if !path.is_assoc_ty() => { let did = path.def_id(); let &mut (prev_did, ref mut has_duplicates) = implementor_dups.entry(path.last()).or_insert((did, false)); @@ -1452,15 +1452,14 @@ fn render_implementor( ) { // If there's already another implementor that has the same abridged name, use the // full path, for example in `std::iter::ExactSizeIterator` - let use_absolute = match implementor.inner_impl().for_ { - clean::ResolvedPath { ref path, .. } - | clean::BorrowedRef { type_: box clean::ResolvedPath { ref path, .. }, .. } - if !path.is_assoc_ty() => - { - implementor_dups[&path.last()].1 - } - _ => false, - }; + let use_absolute = + match implementor.inner_impl().for_ { + clean::Type::ResolvedPath { ref path, .. } + | clean::BorrowedRef { + type_: box clean::Type::ResolvedPath { ref path, .. }, .. + } if !path.is_assoc_ty() => implementor_dups[&path.last()].1, + _ => false, + }; render_impl( w, cx, |
