]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/json/conversions.rs
Rename RealFileName::Named to LocalPath and Devirtualized to Remapped
[rust.git] / src / librustdoc / json / conversions.rs
index 80ef0073da8a410f30745bdeed49c21e09b43f7c..88e369e1babc216fd5362d5408b9b97c3ff584ad 100644 (file)
@@ -40,7 +40,8 @@ pub(super) fn convert_item(&self, item: clean::Item) -> Option<Item> {
             .iter()
             .map(rustc_ast_pretty::pprust::attribute_to_string)
             .collect();
-        let clean::Item { span, name, attrs: _, kind: _, visibility, def_id } = item;
+        let span = item.span(self.tcx);
+        let clean::Item { name, attrs: _, kind: _, visibility, def_id, cfg: _ } = item;
         let inner = match *item.kind {
             clean::StrippedItem(_) => return None,
             _ => from_clean_item(item, self.tcx),
@@ -65,12 +66,7 @@ fn convert_span(&self, span: clean::Span) -> Option<Span> {
                 let hi = span.hi(self.sess());
                 let lo = span.lo(self.sess());
                 Some(Span {
-                    filename: match name {
-                        rustc_span::RealFileName::Named(path) => path,
-                        rustc_span::RealFileName::Devirtualized { local_path, virtual_name: _ } => {
-                            local_path
-                        }
-                    },
+                    filename: name.into_local_path(),
                     begin: (lo.line, lo.col.to_usize()),
                     end: (hi.line, hi.col.to_usize()),
                 })
@@ -420,7 +416,7 @@ fn from_tcx(bare_decl: clean::BareFunctionDecl, tcx: TyCtxt<'_>) -> Self {
 
 impl FromWithTcx<clean::FnDecl> for FnDecl {
     fn from_tcx(decl: clean::FnDecl, tcx: TyCtxt<'_>) -> Self {
-        let clean::FnDecl { inputs, output, c_variadic, attrs: _ } = decl;
+        let clean::FnDecl { inputs, output, c_variadic } = decl;
         FnDecl {
             inputs: inputs
                 .values
@@ -452,16 +448,17 @@ fn from_tcx(trait_: clean::Trait, tcx: TyCtxt<'_>) -> Self {
 
 impl FromWithTcx<clean::Impl> for Impl {
     fn from_tcx(impl_: clean::Impl, tcx: TyCtxt<'_>) -> Self {
+        let provided_trait_methods = impl_.provided_trait_methods(tcx);
         let clean::Impl {
             unsafety,
             generics,
-            provided_trait_methods,
             trait_,
             for_,
             items,
             negative_polarity,
             synthetic,
             blanket_impl,
+            span: _span,
         } = impl_;
         Impl {
             is_unsafe: unsafety == rustc_hir::Unsafety::Unsafe,