about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2021-03-09 21:51:32 -0800
committerCamelid <camelidcamel@gmail.com>2021-03-21 19:47:12 -0700
commitb0659f9b1bfb92626c40dabceb3268f88bb26224 (patch)
treedc0f79cede6dfabf25e3fe0410a619ee1b321d03
parente190983bd3cefdec262c63dc8d47f76d965fea65 (diff)
downloadrust-b0659f9b1bfb92626c40dabceb3268f88bb26224.tar.gz
rust-b0659f9b1bfb92626c40dabceb3268f88bb26224.zip
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
-rw-r--r--src/librustdoc/json/conversions.rs4
-rw-r--r--src/rustdoc-json-types/lib.rs2
-rw-r--r--src/test/rustdoc-json/nested.rs4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index 023f392563e..073209c2468 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -503,13 +503,13 @@ impl From<clean::Import> for Import {
         use clean::ImportKind::*;
         match import.kind {
             Simple(s) => Import {
-                span: import.source.path.whole_name(),
+                source: import.source.path.whole_name(),
                 name: s.to_string(),
                 id: import.source.did.map(from_def_id),
                 glob: false,
             },
             Glob => Import {
-                span: import.source.path.whole_name(),
+                source: import.source.path.whole_name(),
                 name: import.source.path.last_name().to_string(),
                 id: import.source.did.map(from_def_id),
                 glob: true,
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs
index 82064f31f58..72a4d9a1830 100644
--- a/src/rustdoc-json-types/lib.rs
+++ b/src/rustdoc-json-types/lib.rs
@@ -461,7 +461,7 @@ pub struct Impl {
 #[serde(rename_all = "snake_case")]
 pub struct Import {
     /// The full path being imported.
-    pub span: String,
+    pub source: String,
     /// May be different from the last segment of `source` when renaming imports:
     /// `use source as name;`
     pub name: String,
diff --git a/src/test/rustdoc-json/nested.rs b/src/test/rustdoc-json/nested.rs
index 5bb66f7f6fd..b0e717d8a86 100644
--- a/src/test/rustdoc-json/nested.rs
+++ b/src/test/rustdoc-json/nested.rs
@@ -24,7 +24,7 @@ pub mod l1 {
         // @has - "$.index[*][?(@.name=='l3')].inner.items[*]" $l4_id
         pub struct L4;
     }
-    // @is nested.json "$.index[*][?(@.inner.span=='l3::L4')].kind" \"import\"
-    // @is - "$.index[*][?(@.inner.span=='l3::L4')].inner.glob" false
+    // @is nested.json "$.index[*][?(@.inner.source=='l3::L4')].kind" \"import\"
+    // @is - "$.index[*][?(@.inner.source=='l3::L4')].inner.glob" false
     pub use l3::L4;
 }