Skip to content

Commit d99ec1d

Browse files
P1n3appl3jyn514
authored andcommitted
Fix tests and update conversions
1 parent 5ff33ca commit d99ec1d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/librustdoc/clean/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl ItemEnum {
302302
| ImportItem(_)
303303
| FunctionItem(_)
304304
| TypedefItem(_, _)
305-
| OpaqueTyItem(_, _)
305+
| OpaqueTyItem(_)
306306
| StaticItem(_)
307307
| ConstantItem(_)
308308
| TraitAliasItem(_)

src/librustdoc/json/conversions.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl From<clean::Item> for Item {
3939
links: attrs
4040
.links
4141
.into_iter()
42-
.filter_map(|(a, b, _)| b.map(|b| (a, b.into())))
42+
.filter_map(|clean::ItemLink { link, did, .. }| did.map(|did| (link, did.into())))
4343
.collect(),
4444
attrs: attrs
4545
.other_attrs
@@ -173,7 +173,7 @@ impl From<clean::ItemEnum> for ItemEnum {
173173
ForeignStaticItem(s) => ItemEnum::StaticItem(s.into()),
174174
ForeignTypeItem => ItemEnum::ForeignTypeItem,
175175
TypedefItem(t, _) => ItemEnum::TypedefItem(t.into()),
176-
OpaqueTyItem(t, _) => ItemEnum::OpaqueTyItem(t.into()),
176+
OpaqueTyItem(t) => ItemEnum::OpaqueTyItem(t.into()),
177177
ConstantItem(c) => ItemEnum::ConstantItem(c.into()),
178178
MacroItem(m) => ItemEnum::MacroItem(m.source),
179179
ProcMacroItem(m) => ItemEnum::ProcMacroItem(m.into()),
@@ -502,18 +502,18 @@ impl From<clean::Variant> for Variant {
502502

503503
impl From<clean::Import> for Import {
504504
fn from(import: clean::Import) -> Self {
505-
use clean::Import::*;
506-
match import {
507-
Simple(s, i) => Import {
508-
source: i.path.whole_name(),
505+
use clean::ImportKind::*;
506+
match import.kind {
507+
Simple(s) => Import {
508+
source: import.source.path.whole_name(),
509509
name: s,
510-
id: i.did.map(Into::into),
510+
id: import.source.did.map(Into::into),
511511
glob: false,
512512
},
513-
Glob(i) => Import {
514-
source: i.path.whole_name(),
515-
name: i.path.last_name().to_string(),
516-
id: i.did.map(Into::into),
513+
Glob => Import {
514+
source: import.source.path.whole_name(),
515+
name: import.source.path.last_name().to_string(),
516+
id: import.source.did.map(Into::into),
517517
glob: true,
518518
},
519519
}

src/test/run-make-fulldeps/rustdoc-json/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _check_subset(expected, actual, trace):
6262
_check_subset(expected_index.get(expected, {}), actual_index.get(actual, {}), trace)
6363
_check_subset(expected_paths.get(expected, {}), actual_paths.get(actual, {}), trace)
6464

65-
_check_subset(expected_main, actual_main, [])
65+
_check_subset(expected_main["root"], actual_main["root"], [])
6666

6767

6868
def rustdoc_object_hook(obj):

0 commit comments

Comments
 (0)