]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc-json: Rename `Import.span` to `Import.source`
authorCamelid <camelidcamel@gmail.com>
Wed, 10 Mar 2021 05:51:32 +0000 (21:51 -0800)
committerCamelid <camelidcamel@gmail.com>
Mon, 22 Mar 2021 02:47:12 +0000 (19:47 -0700)
* It is called `source` in rustc and the rest of rustdoc
* It is not a span, rather it is the source of the import

src/librustdoc/json/conversions.rs
src/rustdoc-json-types/lib.rs
src/test/rustdoc-json/nested.rs

index 023f392563e884d283e4be9eeff5bd4ce416a0bc..073209c2468a0b4f6fe6e20e36a7b2812aa2cd0d 100644 (file)
@@ -503,13 +503,13 @@ fn from(import: clean::Import) -> Self {
         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,
index 82064f31f58e35150566b24054450b967ef224b2..72a4d9a18301139ae16af1287c6a7a5772e31203 100644 (file)
@@ -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,
index 5bb66f7f6fd7c1b257f4277c49643b4d63ee718b..b0e717d8a86ba11ee32825edbf9c417d390d799b 100644 (file)
@@ -24,7 +24,7 @@ pub mod l3 {
         // @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;
 }