about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-12-12 00:33:00 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-01-27 12:46:18 +0100
commit270151bffb0be259ff20feee3801bb124c2c39ec (patch)
treeeee429f5d63bd5218024cb343db153b0fe61da98 /src/test/rustdoc
parent1ac727772bd91b6e35b624e3252e6a6bd681c70b (diff)
downloadrust-270151bffb0be259ff20feee3801bb124c2c39ec.tar.gz
rust-270151bffb0be259ff20feee3801bb124c2c39ec.zip
Add generate-old-style-files option to rustdoc
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/issue-19190.rs5
-rw-r--r--src/test/rustdoc/issue-35169-2.rs7
-rw-r--r--src/test/rustdoc/issue-35169.rs7
-rw-r--r--src/test/rustdoc/old-style-files.rs23
-rw-r--r--src/test/rustdoc/structfields.rs7
-rw-r--r--src/test/rustdoc/without-redirect.rs13
6 files changed, 39 insertions, 23 deletions
diff --git a/src/test/rustdoc/issue-19190.rs b/src/test/rustdoc/issue-19190.rs
index 4d3b7622970..e023e79fcde 100644
--- a/src/test/rustdoc/issue-19190.rs
+++ b/src/test/rustdoc/issue-19190.rs
@@ -1,3 +1,5 @@
+// compile-flags:--generate-redirect-pages
+
 use std::ops::Deref;
 
 pub struct Foo;
@@ -13,6 +15,9 @@ 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()'
diff --git a/src/test/rustdoc/issue-35169-2.rs b/src/test/rustdoc/issue-35169-2.rs
index 7dea268ec02..33f7646ced6 100644
--- a/src/test/rustdoc/issue-35169-2.rs
+++ b/src/test/rustdoc/issue-35169-2.rs
@@ -24,10 +24,17 @@ impl DerefMut for Bar {
 }
 
 // @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()'
diff --git a/src/test/rustdoc/issue-35169.rs b/src/test/rustdoc/issue-35169.rs
index 883d5d0158d..04fffc40572 100644
--- a/src/test/rustdoc/issue-35169.rs
+++ b/src/test/rustdoc/issue-35169.rs
@@ -19,10 +19,17 @@ impl Deref for Bar {
 }
 
 // @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()'
diff --git a/src/test/rustdoc/old-style-files.rs b/src/test/rustdoc/old-style-files.rs
deleted file mode 100644
index fb6697e18fb..00000000000
--- a/src/test/rustdoc/old-style-files.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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;
diff --git a/src/test/rustdoc/structfields.rs b/src/test/rustdoc/structfields.rs
index cd8957aa2ec..bfe116acffc 100644
--- a/src/test/rustdoc/structfields.rs
+++ b/src/test/rustdoc/structfields.rs
@@ -1,5 +1,8 @@
+// compile-flags:--generate-redirect-pages
+
 // @has structfields/Foo.t.html
 // @has - struct.Foo.html
+// @has structfields/struct.Foo.html
 pub struct Foo {
     // @has - //pre "pub a: ()"
     pub a: (),
@@ -13,6 +16,8 @@ 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: ()"
@@ -20,6 +25,8 @@ 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 {
diff --git a/src/test/rustdoc/without-redirect.rs b/src/test/rustdoc/without-redirect.rs
new file mode 100644
index 00000000000..d473dd8f428
--- /dev/null
+++ b/src/test/rustdoc/without-redirect.rs
@@ -0,0 +1,13 @@
+#![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;