Skip to content

Commit 1ac7277

Browse files
Remove rustdoc old style files generation
1 parent 19f8958 commit 1ac7277

File tree

9 files changed

+24
-50
lines changed

9 files changed

+24
-50
lines changed

src/librustdoc/html/render.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use std::default::Default;
3333
use std::error;
3434
use std::fmt::{self, Display, Formatter, Write as FmtWrite};
3535
use std::ffi::OsStr;
36-
use std::fs::{self, File, OpenOptions};
36+
use std::fs::{self, File};
3737
use std::io::prelude::*;
3838
use std::io::{self, BufWriter, BufReader};
3939
use std::mem;
@@ -2229,26 +2229,6 @@ impl Context {
22292229
if !self.render_redirect_pages {
22302230
all.append(full_path(self, &item), &item_type);
22312231
}
2232-
// Redirect from a sane URL using the namespace to Rustdoc's
2233-
// URL for the page.
2234-
let redir_name = format!("{}.{}.html", name, item_type.name_space());
2235-
let redir_dst = self.dst.join(redir_name);
2236-
if let Ok(redirect_out) = OpenOptions::new().create_new(true)
2237-
.write(true)
2238-
.open(&redir_dst) {
2239-
let mut redirect_out = BufWriter::new(redirect_out);
2240-
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
2241-
}
2242-
2243-
// If the item is a macro, redirect from the old macro URL (with !)
2244-
// to the new one (without).
2245-
if item_type == ItemType::Macro {
2246-
let redir_name = format!("{}.{}!.html", item_type, name);
2247-
let redir_dst = self.dst.join(redir_name);
2248-
let redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
2249-
let mut redirect_out = BufWriter::new(redirect_out);
2250-
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
2251-
}
22522232
}
22532233
}
22542234
Ok(())

src/test/rustdoc/issue-19190.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ impl Deref for Bar {
1313
fn deref(&self) -> &Foo { loop {} }
1414
}
1515

16-
// @has issue_19190/Bar.t.html
1716
// @has issue_19190/struct.Bar.html
18-
// @has - '//*[@id="foo.v"]' 'fn foo(&self)'
1917
// @has - '//*[@id="method.foo"]' 'fn foo(&self)'
20-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
2118
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-21092.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
extern crate issue_21092;
55

6-
// @has issue_21092/Bar.t.html
76
// @has issue_21092/struct.Bar.html
87
// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32'
98
pub use issue_21092::{Foo, Bar};

src/test/rustdoc/issue-35169-2.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,11 @@ impl DerefMut for Bar {
2323
fn deref_mut(&mut self) -> &mut Foo { loop {} }
2424
}
2525

26-
// @has issue_35169_2/Bar.t.html
2726
// @has issue_35169_2/struct.Bar.html
28-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
2927
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
30-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
3128
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
32-
// @has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
3329
// @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
34-
// @has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
3530
// @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
36-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
3731
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
38-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
3932
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
40-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
4133
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-35169.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,11 @@ impl Deref for Bar {
1818
fn deref(&self) -> &Foo { loop {} }
1919
}
2020

21-
// @has issue_35169/Bar.t.html
2221
// @has issue_35169/struct.Bar.html
23-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
2422
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
25-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
2623
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
27-
// @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
2824
// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
29-
// @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
3025
// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
31-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
3226
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
33-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
3427
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
35-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
3628
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/macros.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// @has - //pre '() => { ... };'
33
// @has - //pre '($a:tt) => { ... };'
44
// @has - //pre '($e:expr) => { ... };'
5-
// @has macros/macro.my_macro!.html
6-
// @has - //a 'macro.my_macro.html'
75
#[macro_export]
86
macro_rules! my_macro {
97
() => [];

src/test/rustdoc/old-style-files.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_name = "foo"]
12+
13+
// @has foo/macro.bar.html
14+
// @!has foo/macro.bar!.html
15+
// @!has foo/bar.m.html
16+
#[macro_export]
17+
macro_rules! bar {
18+
() => {}
19+
}
20+
21+
// @has foo/struct.Bar.html
22+
// @!has foo/Bar.t.html
23+
pub struct Bar;

src/test/rustdoc/src-links.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ pub mod bar {
1414
// @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
1515
pub mod baz {
1616
/// Dox
17-
// @has foo/bar/baz/baz.v.html
1817
// @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
1918
pub fn baz() { }
2019
}
2120

2221
/// Dox
23-
// @has foo/bar/Foobar.t.html
2422
// @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
2523
pub trait Foobar { fn dummy(&self) { } }
2624

src/test/rustdoc/structfields.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @has structfields/Foo.t.html
22
// @has - struct.Foo.html
3-
// @has structfields/struct.Foo.html
43
pub struct Foo {
54
// @has - //pre "pub a: ()"
65
pub a: (),
@@ -14,17 +13,13 @@ pub struct Foo {
1413
pub d: usize,
1514
}
1615

17-
// @has structfields/Bar.t.html
18-
// @has - struct.Bar.html
1916
// @has structfields/struct.Bar.html
2017
pub struct Bar {
2118
// @has - //pre "pub a: ()"
2219
pub a: (),
2320
// @!has - //pre "// some fields omitted"
2421
}
2522

26-
// @has structfields/Qux.t.html
27-
// @has - enum.Qux.html
2823
// @has structfields/enum.Qux.html
2924
pub enum Qux {
3025
Quz {

0 commit comments

Comments
 (0)