Skip to content

Commit b3a1039

Browse files
Remove rustdoc old style files generation
1 parent 118e052 commit b3a1039

File tree

9 files changed

+24
-51
lines changed

9 files changed

+24
-51
lines changed

src/librustdoc/html/render.rs

+1-21
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use std::default::Default;
4343
use std::error;
4444
use std::fmt::{self, Display, Formatter, Write as FmtWrite};
4545
use std::ffi::OsStr;
46-
use std::fs::{self, File, OpenOptions};
46+
use std::fs::{self, File};
4747
use std::io::prelude::*;
4848
use std::io::{self, BufWriter, BufReader};
4949
use std::mem;
@@ -2143,26 +2143,6 @@ impl Context {
21432143
if !self.render_redirect_pages {
21442144
all.append(full_path(self, &item), &item_type);
21452145
}
2146-
// Redirect from a sane URL using the namespace to Rustdoc's
2147-
// URL for the page.
2148-
let redir_name = format!("{}.{}.html", name, item_type.name_space());
2149-
let redir_dst = self.dst.join(redir_name);
2150-
if let Ok(redirect_out) = OpenOptions::new().create_new(true)
2151-
.write(true)
2152-
.open(&redir_dst) {
2153-
let mut redirect_out = BufWriter::new(redirect_out);
2154-
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
2155-
}
2156-
2157-
// If the item is a macro, redirect from the old macro URL (with !)
2158-
// to the new one (without).
2159-
if item_type == ItemType::Macro {
2160-
let redir_name = format!("{}.{}!.html", item_type, name);
2161-
let redir_dst = self.dst.join(redir_name);
2162-
let redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
2163-
let mut redirect_out = BufWriter::new(redirect_out);
2164-
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
2165-
}
21662146
}
21672147
}
21682148
Ok(())

src/test/rustdoc/issue-19190.rs

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ impl Deref for Bar {
2323
fn deref(&self) -> &Foo { loop {} }
2424
}
2525

26-
// @has issue_19190/Bar.t.html
2726
// @has issue_19190/struct.Bar.html
28-
// @has - '//*[@id="foo.v"]' 'fn foo(&self)'
2927
// @has - '//*[@id="method.foo"]' 'fn foo(&self)'
30-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
3128
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-21092.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
extern crate issue_21092;
1515

16-
// @has issue_21092/Bar.t.html
1716
// @has issue_21092/struct.Bar.html
1817
// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32'
1918
pub use issue_21092::{Foo, Bar};

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

-8
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,11 @@ impl DerefMut for Bar {
3333
fn deref_mut(&mut self) -> &mut Foo { loop {} }
3434
}
3535

36-
// @has issue_35169_2/Bar.t.html
3736
// @has issue_35169_2/struct.Bar.html
38-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
3937
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
40-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
4138
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
42-
// @has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
4339
// @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
44-
// @has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
4540
// @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
46-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
4741
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
48-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
4942
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
50-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
5143
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/issue-35169.rs

-8
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,11 @@ impl Deref for Bar {
2828
fn deref(&self) -> &Foo { loop {} }
2929
}
3030

31-
// @has issue_35169/Bar.t.html
3231
// @has issue_35169/struct.Bar.html
33-
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
3432
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
35-
// @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
3633
// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
37-
// @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
3834
// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
39-
// @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
4035
// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
41-
// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
4236
// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
43-
// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
4437
// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
45-
// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
4638
// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'

src/test/rustdoc/macros.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// @has - //pre '() => { ... };'
1313
// @has - //pre '($a:tt) => { ... };'
1414
// @has - //pre '($e:expr) => { ... };'
15-
// @has macros/macro.my_macro!.html
16-
// @has - //a 'macro.my_macro.html'
1715
#[macro_export]
1816
macro_rules! my_macro {
1917
() => [];

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

+23
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

-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ pub mod bar {
2424
// @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
2525
pub mod baz {
2626
/// Dox
27-
// @has foo/bar/baz/baz.v.html
2827
// @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
2928
pub fn baz() { }
3029
}
3130

3231
/// Dox
33-
// @has foo/bar/Foobar.t.html
3432
// @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
3533
pub trait Foobar { fn dummy(&self) { } }
3634

src/test/rustdoc/structfields.rs

-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// @has structfields/Foo.t.html
12-
// @has - struct.Foo.html
1311
// @has structfields/struct.Foo.html
1412
pub struct Foo {
1513
// @has - //pre "pub a: ()"
@@ -24,17 +22,13 @@ pub struct Foo {
2422
pub d: usize,
2523
}
2624

27-
// @has structfields/Bar.t.html
28-
// @has - struct.Bar.html
2925
// @has structfields/struct.Bar.html
3026
pub struct Bar {
3127
// @has - //pre "pub a: ()"
3228
pub a: (),
3329
// @!has - //pre "// some fields omitted"
3430
}
3531

36-
// @has structfields/Qux.t.html
37-
// @has - enum.Qux.html
3832
// @has structfields/enum.Qux.html
3933
pub enum Qux {
4034
Quz {

0 commit comments

Comments
 (0)