]> git.lizzy.rs Git - rust.git/commitdiff
Remove rustdoc old style files generation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 6 Dec 2018 21:47:09 +0000 (22:47 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 26 Jan 2019 23:34:05 +0000 (00:34 +0100)
src/librustdoc/html/render.rs
src/test/rustdoc/issue-19190.rs
src/test/rustdoc/issue-21092.rs
src/test/rustdoc/issue-35169-2.rs
src/test/rustdoc/issue-35169.rs
src/test/rustdoc/macros.rs
src/test/rustdoc/old-style-files.rs [new file with mode: 0644]
src/test/rustdoc/src-links.rs
src/test/rustdoc/structfields.rs

index 86fb51419c270a581d9bff2a6a5d931831d26075..4f237dc85a5ee20ec769dc83547047c0a1a5b7c7 100644 (file)
@@ -33,7 +33,7 @@
 use std::error;
 use std::fmt::{self, Display, Formatter, Write as FmtWrite};
 use std::ffi::OsStr;
-use std::fs::{self, File, OpenOptions};
+use std::fs::{self, File};
 use std::io::prelude::*;
 use std::io::{self, BufWriter, BufReader};
 use std::mem;
@@ -2229,26 +2229,6 @@ fn item<F>(&mut self, item: clean::Item, all: &mut AllTypes, mut f: F) -> Result
                 if !self.render_redirect_pages {
                     all.append(full_path(self, &item), &item_type);
                 }
-                // Redirect from a sane URL using the namespace to Rustdoc's
-                // URL for the page.
-                let redir_name = format!("{}.{}.html", name, item_type.name_space());
-                let redir_dst = self.dst.join(redir_name);
-                if let Ok(redirect_out) = OpenOptions::new().create_new(true)
-                                                            .write(true)
-                                                            .open(&redir_dst) {
-                    let mut redirect_out = BufWriter::new(redirect_out);
-                    try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
-                }
-
-                // If the item is a macro, redirect from the old macro URL (with !)
-                // to the new one (without).
-                if item_type == ItemType::Macro {
-                    let redir_name = format!("{}.{}!.html", item_type, name);
-                    let redir_dst = self.dst.join(redir_name);
-                    let redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
-                    let mut redirect_out = BufWriter::new(redirect_out);
-                    try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
-                }
             }
         }
         Ok(())
index a7c25538f7c44682206ab708aad233d3b4252347..4d3b76229702b4d6ea676eca309ef7116ced126d 100644 (file)
@@ -13,9 +13,6 @@ impl Deref for Bar {
     fn deref(&self) -> &Foo { loop {} }
 }
 
-// @has issue_19190/Bar.t.html
 // @has issue_19190/struct.Bar.html
-// @has - '//*[@id="foo.v"]' 'fn foo(&self)'
 // @has - '//*[@id="method.foo"]' 'fn foo(&self)'
-// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
index 14f547abd9a68b59bd7a1715c723911773ec82f2..b054145a4831a6d681516b560c1c19ec072162bb 100644 (file)
@@ -3,7 +3,6 @@
 
 extern crate issue_21092;
 
-// @has issue_21092/Bar.t.html
 // @has issue_21092/struct.Bar.html
 // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32'
 pub use issue_21092::{Foo, Bar};
index 0caead100d666216df186129e038a874ead479f1..7dea268ec025885fc914626ee855f419a5e02704 100644 (file)
@@ -23,19 +23,11 @@ impl DerefMut for Bar {
     fn deref_mut(&mut self) -> &mut Foo { loop {} }
 }
 
-// @has issue_35169_2/Bar.t.html
 // @has issue_35169_2/struct.Bar.html
-// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
 // @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
-// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
 // @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
-// @has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
 // @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
-// @has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
 // @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
-// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
 // @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
-// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
 // @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
-// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
index 0978b103076fefd9d6ced159bfb4b20a26bf353b..883d5d0158d7ef687fb3536d92d309e568553865 100644 (file)
@@ -18,19 +18,11 @@ impl Deref for Bar {
     fn deref(&self) -> &Foo { loop {} }
 }
 
-// @has issue_35169/Bar.t.html
 // @has issue_35169/struct.Bar.html
-// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
 // @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
-// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
 // @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
-// @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
 // @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
-// @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
 // @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
-// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
 // @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
-// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
 // @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
-// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
index c66a2c845bfd8a30fec1370b8fbcb4d8a1d522c6..fb4f02ad16052a8bc3f0c746733f9df62fdd14e7 100644 (file)
@@ -2,8 +2,6 @@
 // @has - //pre '() => { ... };'
 // @has - //pre '($a:tt) => { ... };'
 // @has - //pre '($e:expr) => { ... };'
-// @has macros/macro.my_macro!.html
-// @has - //a 'macro.my_macro.html'
 #[macro_export]
 macro_rules! my_macro {
     () => [];
diff --git a/src/test/rustdoc/old-style-files.rs b/src/test/rustdoc/old-style-files.rs
new file mode 100644 (file)
index 0000000..fb6697e
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_name = "foo"]
+
+// @has foo/macro.bar.html
+// @!has foo/macro.bar!.html
+// @!has foo/bar.m.html
+#[macro_export]
+macro_rules! bar {
+    () => {}
+}
+
+// @has foo/struct.Bar.html
+// @!has foo/Bar.t.html
+pub struct Bar;
index 902a319a7b90659f5004be06681a75f3d0293648..353ce10243e0055d8ee570b77bf4d9f8e786d076 100644 (file)
@@ -14,13 +14,11 @@ pub mod bar {
     // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
     pub mod baz {
         /// Dox
-        // @has foo/bar/baz/baz.v.html
         // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
         pub fn baz() { }
     }
 
     /// Dox
-    // @has foo/bar/Foobar.t.html
     // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
     pub trait Foobar { fn dummy(&self) { } }
 
index 35cea8afe21469ec06872afba6059b30b88efa3f..cd8957aa2ecb93bacd8d1f05bc17add9d9a6e74c 100644 (file)
@@ -1,6 +1,5 @@
 // @has structfields/Foo.t.html
 // @has - struct.Foo.html
-// @has structfields/struct.Foo.html
 pub struct Foo {
     // @has - //pre "pub a: ()"
     pub a: (),
@@ -14,8 +13,6 @@ pub struct Foo {
     pub d: usize,
 }
 
-// @has structfields/Bar.t.html
-// @has - struct.Bar.html
 // @has structfields/struct.Bar.html
 pub struct Bar {
     // @has - //pre "pub a: ()"
@@ -23,8 +20,6 @@ pub struct Bar {
     // @!has - //pre "// some fields omitted"
 }
 
-// @has structfields/Qux.t.html
-// @has - enum.Qux.html
 // @has structfields/enum.Qux.html
 pub enum Qux {
     Quz {