Skip to content

Commit b0659f9

Browse files
committed
rustdoc-json: Rename Import.span to Import.source
* It is called `source` in rustc and the rest of rustdoc * It is not a span, rather it is the source of the import
1 parent e190983 commit b0659f9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustdoc/json/conversions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,13 @@ impl From<clean::Import> for Import {
503503
use clean::ImportKind::*;
504504
match import.kind {
505505
Simple(s) => Import {
506-
span: import.source.path.whole_name(),
506+
source: import.source.path.whole_name(),
507507
name: s.to_string(),
508508
id: import.source.did.map(from_def_id),
509509
glob: false,
510510
},
511511
Glob => Import {
512-
span: import.source.path.whole_name(),
512+
source: import.source.path.whole_name(),
513513
name: import.source.path.last_name().to_string(),
514514
id: import.source.did.map(from_def_id),
515515
glob: true,

src/rustdoc-json-types/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ pub struct Impl {
461461
#[serde(rename_all = "snake_case")]
462462
pub struct Import {
463463
/// The full path being imported.
464-
pub span: String,
464+
pub source: String,
465465
/// May be different from the last segment of `source` when renaming imports:
466466
/// `use source as name;`
467467
pub name: String,

src/test/rustdoc-json/nested.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub mod l1 {
2424
// @has - "$.index[*][?(@.name=='l3')].inner.items[*]" $l4_id
2525
pub struct L4;
2626
}
27-
// @is nested.json "$.index[*][?(@.inner.span=='l3::L4')].kind" \"import\"
28-
// @is - "$.index[*][?(@.inner.span=='l3::L4')].inner.glob" false
27+
// @is nested.json "$.index[*][?(@.inner.source=='l3::L4')].kind" \"import\"
28+
// @is - "$.index[*][?(@.inner.source=='l3::L4')].inner.glob" false
2929
pub use l3::L4;
3030
}

0 commit comments

Comments
 (0)