diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-26 22:41:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-26 22:41:39 +0100 |
| commit | fcbbdaf2092ad2dee5763389ad89f89cbf560906 (patch) | |
| tree | 14a404a01d19a5cdd2c76310d373fd8c83dc73ff /src/librustdoc/html/render | |
| parent | 10743f0f6823b2a122cc4d552ed8aa0cabb9f088 (diff) | |
| parent | 79c718f1d5916318b5d55e6c1391a438cae1f763 (diff) | |
| download | rust-fcbbdaf2092ad2dee5763389ad89f89cbf560906.tar.gz rust-fcbbdaf2092ad2dee5763389ad89f89cbf560906.zip | |
Rollup merge of #91197 - camelid:rename-resolvedpath, r=GuillaumeGomez,jyn514
rustdoc: Rename `Type::ResolvedPath` to `Type::Path` and don't re-export it The new name is shorter, simpler, and consistent with `hir::Ty`. It can't be re-exported since the name would conflict with the `clean::Path` struct. But usually enum variants are referred to using their qualified names in Rust anyway (and parts of rustdoc already do that with `clean::Type`), so this is also more consistent with the language. r? `@GuillaumeGomez` cc `@jyn514`
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index c114edf1e70..d12667c9e5c 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::Path { ref path, .. } => { let path_segment = path.segments.last().unwrap(); Some(path_segment.name) } @@ -371,7 +371,7 @@ crate fn get_real_types<'tcx>( let mut ty_generics = Vec::new(); for bound in bound.get_bounds().unwrap_or(&[]) { if let Some(path) = bound.get_trait_path() { - let ty = Type::ResolvedPath { path }; + let ty = Type::Path { path }; get_real_types(generics, &ty, tcx, recurse + 1, &mut ty_generics, cache); } } diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 7d231a0d649..20a200f0484 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::Path { path }) => { (false, Some(path.def_id()) == tcx.lang_items().owned_box(), false) } SelfTy::SelfValue => (false, false, true), @@ -2520,7 +2520,7 @@ fn collect_paths_for_type(first_ty: clean::Type, cache: &Cache) -> Vec<String> { } match ty { - clean::Type::ResolvedPath { path } => process_path(path.def_id()), + clean::Type::Path { path } => process_path(path.def_id()), clean::Type::Tuple(tys) => { work.extend(tys.into_iter()); } diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index e59b94f6b7d..d3738cfa3e7 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -727,8 +727,8 @@ 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 }, .. } + clean::Type::Path { ref path } + | clean::BorrowedRef { type_: box clean::Type::Path { ref path }, .. } if !path.is_assoc_ty() => { let did = path.def_id(); @@ -1453,8 +1453,8 @@ 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, .. }, .. } + clean::Type::Path { ref path, .. } + | clean::BorrowedRef { type_: box clean::Type::Path { ref path, .. }, .. } if !path.is_assoc_ty() => { implementor_dups[&path.last()].1 |
