diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index af4f1b88b0fb0..a6ac5879bbe6a 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -316,6 +316,7 @@ impl MissingDoc { *self.doc_hidden_stack.last().expect("empty doc_hidden_stack") } + #[allow(unused)] fn check_missing_docs_attrs(&self, cx: &LateContext<'_, '_>, id: Option, @@ -344,9 +345,9 @@ impl MissingDoc { let has_doc = attrs.iter().any(|a| has_doc(a)); if !has_doc { - cx.span_lint(MISSING_DOCS, - cx.tcx.sess.source_map().def_span(sp), - &format!("missing documentation for {}", desc)); + // cx.span_lint(MISSING_DOCS, + // cx.tcx.sess.source_map().def_span(sp), + // &format!("missing documentation for {}", desc)); } } } @@ -374,9 +375,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { for macro_def in &krate.exported_macros { let has_doc = macro_def.attrs.iter().any(|a| has_doc(a)); if !has_doc { - cx.span_lint(MISSING_DOCS, - cx.tcx.sess.source_map().def_span(macro_def.span), - "missing documentation for macro"); + // cx.span_lint(MISSING_DOCS, + // cx.tcx.sess.source_map().def_span(macro_def.span), + // "missing documentation for macro"); } } } diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index e99a86e807f7f..60306c860ab8a 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -38,17 +38,17 @@ impl<'a> Parser<'a> { attrs.push(self.parse_attribute_with_inner_parse_policy(inner_parse_policy)?); just_parsed_doc_comment = false; } - token::DocComment(s) => { - let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.span); - if attr.style != ast::AttrStyle::Outer { - let mut err = self.fatal("expected outer doc comment"); - err.note("inner doc comments like this (starting with \ - `//!` or `/*!`) can only appear before items"); - return Err(err); - } - attrs.push(attr); + token::DocComment(_s) => { + // let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.span); + // if attr.style != ast::AttrStyle::Outer { + // let mut err = self.fatal("expected outer doc comment"); + // err.note("inner doc comments like this (starting with \ + // `//!` or `/*!`) can only appear before items"); + // return Err(err); + // } + // attrs.push(attr); self.bump(); - just_parsed_doc_comment = true; + // just_parsed_doc_comment = true; } _ => break, } @@ -199,15 +199,16 @@ impl<'a> Parser<'a> { assert_eq!(attr.style, ast::AttrStyle::Inner); attrs.push(attr); } - token::DocComment(s) => { + token::DocComment(_s) => { + self.bump(); // we need to get the position of this token before we bump. - let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.span); - if attr.style == ast::AttrStyle::Inner { - attrs.push(attr); - self.bump(); - } else { - break; - } + // let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.span); + // if attr.style == ast::AttrStyle::Inner { + // attrs.push(attr); + // self.bump(); + // } else { + // break; + // } } _ => break, } diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 0611c1d9b42a5..bfcb257a9afe6 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -357,7 +357,6 @@ impl SeqSep { mod tests { use super::*; use crate::ast::{self, Ident, PatKind}; - use crate::attr::first_attr_value_str_by_name; use crate::ptr::P; use crate::print::pprust::item_to_string; use crate::tokenstream::{DelimSpan, TokenTree}; @@ -575,36 +574,6 @@ mod tests { }) } - #[test] fn crlf_doc_comments() { - with_globals(|| { - use crate::symbol::sym; - - let sess = ParseSess::new(FilePathMapping::empty()); - - let name_1 = FileName::Custom("crlf_source_1".to_string()); - let source = "/// doc comment\r\nfn foo() {}".to_string(); - let item = parse_item_from_source_str(name_1, source, &sess) - .unwrap().unwrap(); - let doc = first_attr_value_str_by_name(&item.attrs, sym::doc).unwrap(); - assert_eq!(doc.as_str(), "/// doc comment"); - - let name_2 = FileName::Custom("crlf_source_2".to_string()); - let source = "/// doc comment\r\n/// line 2\r\nfn foo() {}".to_string(); - let item = parse_item_from_source_str(name_2, source, &sess) - .unwrap().unwrap(); - let docs = item.attrs.iter().filter(|a| a.path == sym::doc) - .map(|a| a.value_str().unwrap().to_string()).collect::>(); - let b: &[_] = &["/// doc comment".to_string(), "/// line 2".to_string()]; - assert_eq!(&docs[..], b); - - let name_3 = FileName::Custom("clrf_source_3".to_string()); - let source = "/** doc comment\r\n * with CRLF */\r\nfn foo() {}".to_string(); - let item = parse_item_from_source_str(name_3, source, &sess).unwrap().unwrap(); - let doc = first_attr_value_str_by_name(&item.attrs, sym::doc).unwrap(); - assert_eq!(doc.as_str(), "/** doc comment\n * with CRLF */"); - }); - } - #[test] fn ttdelim_span() { fn parse_expr_from_source_str( diff --git a/src/test/pretty/doc-comments.rs b/src/test/pretty/doc-comments.rs deleted file mode 100644 index 2a98c9fc05897..0000000000000 --- a/src/test/pretty/doc-comments.rs +++ /dev/null @@ -1,53 +0,0 @@ -// compile-flags: --crate-type=lib - -// pp-exact - -// some single-line non-doc comment - -/// some single line outer-docs -fn a() { } - -fn b() { - //! some single line inner-docs -} - -////////////////////////////////// -// some single-line non-doc comment preceded by a separator - -////////////////////////////////// -/// some single-line outer-docs preceded by a separator -/// (and trailing whitespaces) -fn c() { } - -/* - * some multi-line non-doc comment - */ - -/** - * some multi-line outer-docs - */ -fn d() { } - -fn e() { - /*! - * some multi-line inner-docs - */ -} - -/********************************/ -/* - * some multi-line non-doc comment preceded by a separator - */ - -/********************************/ -/** - * some multi-line outer-docs preceded by a separator - */ -fn f() { } - -#[doc = "unsugared outer doc-comments work also"] -fn g() { } - -fn h() { - #![doc = "as do inner ones"] -} diff --git a/src/test/pretty/top-level-doc-comments.rs b/src/test/pretty/top-level-doc-comments.rs deleted file mode 100644 index 16f95d334cbcf..0000000000000 --- a/src/test/pretty/top-level-doc-comments.rs +++ /dev/null @@ -1,13 +0,0 @@ -/// Some doc comment. -struct X; - -// ignore-license - -// http://rust-lang.org/COPYRIGHT. -// - -// pp-exact - -// Test that rust can properly pretty print a doc comment if it's the first line in a file. some - -fn main() { let x = X; } diff --git a/src/test/rustdoc/all.rs b/src/test/rustdoc/all.rs deleted file mode 100644 index a95d6c4620697..0000000000000 --- a/src/test/rustdoc/all.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct' -// @has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum' -// @has foo/all.html '//a[@href="union.Union.html"]' 'Union' -// @has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST' -// @has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC' -// @has foo/all.html '//a[@href="fn.function.html"]' 'function' - -pub struct Struct; -pub enum Enum { - X, - Y, -} -pub union Union { - x: u32, -} -pub const CONST: u32 = 0; -pub static STATIC: &str = "baguette"; -pub fn function() {} - -mod private_module { - pub struct ReexportedStruct; -} - -// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct' -// @!has foo/all.html 'private_module' -pub use private_module::ReexportedStruct; diff --git a/src/test/rustdoc/assoc-consts-version.rs b/src/test/rustdoc/assoc-consts-version.rs deleted file mode 100644 index 6060bc0a6fd5c..0000000000000 --- a/src/test/rustdoc/assoc-consts-version.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_name = "foo"] - -#![feature(staged_api)] - -#![stable(since="1.1.1", feature="rust1")] - -#[stable(since="1.1.1", feature="rust1")] -pub struct SomeStruct; - -impl SomeStruct { - // @has 'foo/struct.SomeStruct.html' \ - // '//*[@id="associatedconstant.SOME_CONST"]//span[@class="since"]' '1.1.2' - #[stable(since="1.1.2", feature="rust2")] - pub const SOME_CONST: usize = 0; -} diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs deleted file mode 100644 index ee622e74a08dc..0000000000000 --- a/src/test/rustdoc/assoc-consts.rs +++ /dev/null @@ -1,99 +0,0 @@ -pub trait Foo { - // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \ - // 'const FOO: usize;' - // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' - const FOO: usize = 12; - // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' - const FOO_NO_DEFAULT: bool; - // @!has - FOO_HIDDEN - #[doc(hidden)] - const FOO_HIDDEN: u8 = 0; -} - -pub struct Bar; - -impl Foo for Bar { - // @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar' - // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' - const FOO: usize = 12; - // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' - const FOO_NO_DEFAULT: bool = false; - // @!has - FOO_HIDDEN - #[doc(hidden)] - const FOO_HIDDEN: u8 = 0; -} - -impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \ - // 'const BAR: usize' - pub const BAR: usize = 3; -} - -pub struct Baz<'a, U: 'a, T>(T, &'a [U]); - -impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \ - // "const BAZ: Baz<'static, u8, u32>" - pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]); -} - -pub fn f(_: &(ToString + 'static)) {} - -impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \ - // "const F: fn(_: &(dyn ToString + 'static))" - pub const F: fn(_: &(ToString + 'static)) = f; -} - -impl Bar { - // @!has assoc_consts/struct.Bar.html 'BAR_PRIVATE' - const BAR_PRIVATE: char = 'a'; - // @!has assoc_consts/struct.Bar.html 'BAR_HIDDEN' - #[doc(hidden)] - pub const BAR_HIDDEN: &'static str = "a"; -} - -// @has assoc_consts/trait.Qux.html -pub trait Qux { - // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' - // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." - /// Docs for QUX0 in trait. - const QUX0: u8; - // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' - // @has - '//*[@class="docblock"]' "Docs for QUX1 in trait." - /// Docs for QUX1 in trait. - const QUX1: i8; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait." - /// Docs for QUX_DEFAULT12 in trait. - const QUX_DEFAULT0: u16 = 1; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait." - /// Docs for QUX_DEFAULT1 in trait. - const QUX_DEFAULT1: i16 = 2; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." - /// Docs for QUX_DEFAULT2 in trait. - const QUX_DEFAULT2: u32 = 3; -} - -// @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar' -impl Qux for Bar { - // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' - // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." - /// Docs for QUX0 in trait. - const QUX0: u8 = 4; - // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' - // @has - '//*[@class="docblock"]' "Docs for QUX1 in impl." - /// Docs for QUX1 in impl. - const QUX1: i8 = 5; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//*[@class="docblock hidden"]' "Docs for QUX_DEFAULT12 in trait." - const QUX_DEFAULT0: u16 = 6; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl." - /// Docs for QUX_DEFAULT1 in impl. - const QUX_DEFAULT1: i16 = 7; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." -} diff --git a/src/test/rustdoc/assoc-item-cast.rs b/src/test/rustdoc/assoc-item-cast.rs deleted file mode 100644 index dc62fac6a957d..0000000000000 --- a/src/test/rustdoc/assoc-item-cast.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -pub trait Expression { - type SqlType; -} - -pub trait AsExpression { - type Expression: Expression; - fn as_expression(self) -> Self::Expression; -} - -// @has foo/type.AsExprOf.html -// @has - '//*[@class="rust typedef"]' 'type AsExprOf = >::Expression;' -pub type AsExprOf = >::Expression; diff --git a/src/test/rustdoc/assoc-types.rs b/src/test/rustdoc/assoc-types.rs deleted file mode 100644 index b708dc0c717ca..0000000000000 --- a/src/test/rustdoc/assoc-types.rs +++ /dev/null @@ -1,41 +0,0 @@ -// ignore-tidy-linelength - -#![crate_type="lib"] - -// @has assoc_types/trait.Index.html -pub trait Index { - // @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized' - // @has - '//code[@id="Output.t"]' 'type Output: ?Sized' - type Output: ?Sized; - // @has - '//code[@id="index.v"]' 'fn index' - // @has - '//*[@id="tymethod.index"]//code' \ - // "fn index<'a>(&'a self, index: I) -> &'a Self::Output" - // @has - '//*[@id="tymethod.index"]//code//a[@href="../assoc_types/trait.Index.html#associatedtype.Output"]' \ - // "Output" - fn index<'a>(&'a self, index: I) -> &'a Self::Output; -} - -// @has assoc_types/fn.use_output.html -// @has - '//*[@class="rust fn"]' '-> &T::Output' -// @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Index.html#associatedtype.Output"]' 'Output' -pub fn use_output>(obj: &T, index: usize) -> &T::Output { - obj.index(index) -} - -pub trait Feed { - type Input; -} - -// @has assoc_types/fn.use_input.html -// @has - '//*[@class="rust fn"]' 'T::Input' -// @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Feed.html#associatedtype.Input"]' 'Input' -pub fn use_input(_feed: &T, _element: T::Input) { } - -// @has assoc_types/fn.cmp_input.html -// @has - '//*[@class="rust fn"]' 'where T::Input: PartialEq' -// @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Feed.html#associatedtype.Input"]' 'Input' -pub fn cmp_input(a: &T::Input, b: &U::Input) -> bool - where T::Input: PartialEq -{ - a == b -} diff --git a/src/test/rustdoc/async-fn.rs b/src/test/rustdoc/async-fn.rs deleted file mode 100644 index 7384f7027d185..0000000000000 --- a/src/test/rustdoc/async-fn.rs +++ /dev/null @@ -1,35 +0,0 @@ -// edition:2018 - -#![feature(async_await)] - -// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option' -pub async fn foo() -> Option { - None -} - -// @has async_fn/fn.bar.html '//pre[@class="rust fn"]' 'pub async fn bar(a: i32, b: i32) -> i32' -pub async fn bar(a: i32, b: i32) -> i32 { - 0 -} - -// @has async_fn/fn.baz.html '//pre[@class="rust fn"]' 'pub async fn baz(a: T) -> T' -pub async fn baz(a: T) -> T { - a -} - -trait Bar {} - -impl Bar for () {} - -// @has async_fn/fn.quux.html '//pre[@class="rust fn"]' 'pub async fn quux() -> impl Bar' -pub async fn quux() -> impl Bar { - () -} - -// @has async_fn/struct.Foo.html -// @matches - '//code' 'pub async fn f\(\)$' -pub struct Foo; - -impl Foo { - pub async fn f() {} -} diff --git a/src/test/rustdoc/attributes.rs b/src/test/rustdoc/attributes.rs deleted file mode 100644 index eb0e3f065c7b3..0000000000000 --- a/src/test/rustdoc/attributes.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.f.html '//*[@class="docblock attributes"]' '#[no_mangle]' -#[no_mangle] -pub extern "C" fn f() {} - -// @has foo/fn.g.html '//*[@class="docblock attributes"]' '#[export_name = "bar"]' -#[export_name = "bar"] -pub extern "C" fn g() {} - -// @has foo/enum.Foo.html '//*[@class="docblock attributes"]' '#[repr(i64)]' -// @has foo/enum.Foo.html '//*[@class="docblock attributes"]' '#[must_use]' -#[repr(i64)] -#[must_use] -pub enum Foo { - Bar, -} diff --git a/src/test/rustdoc/auto-impl-for-trait.rs b/src/test/rustdoc/auto-impl-for-trait.rs deleted file mode 100644 index bc658fbfc8cce..0000000000000 --- a/src/test/rustdoc/auto-impl-for-trait.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Test for https://github.com/rust-lang/rust/issues/48463 issue. - -use std::any::Any; -use std::ops::Deref; - -pub struct AnyValue { - val: Box, -} - -impl Deref for AnyValue { - type Target = Any; - - fn deref(&self) -> &Any { - &*self.val - } -} diff --git a/src/test/rustdoc/auto-impl-primitive.rs b/src/test/rustdoc/auto-impl-primitive.rs deleted file mode 100644 index 83631b89f281a..0000000000000 --- a/src/test/rustdoc/auto-impl-primitive.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_name = "foo"] -pub use std::fs::File; - -// @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation' -#[doc(primitive = "i16")] -/// I love poneys! -mod prim {} diff --git a/src/test/rustdoc/auto-traits.rs b/src/test/rustdoc/auto-traits.rs deleted file mode 100644 index a1fa611994f1a..0000000000000 --- a/src/test/rustdoc/auto-traits.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:auto-traits.rs - -#![feature(optin_builtin_traits)] - -#![crate_name = "foo"] - -extern crate auto_traits; - -// @has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo' -pub unsafe auto trait Foo {} - -// @has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar' -pub use auto_traits::Bar; diff --git a/src/test/rustdoc/auxiliary/all-item-types.rs b/src/test/rustdoc/auxiliary/all-item-types.rs deleted file mode 100644 index f94bd998717a0..0000000000000 --- a/src/test/rustdoc/auxiliary/all-item-types.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(extern_types)] - -pub mod foo_mod {} -extern "C" { - pub fn foo_ffn(); - pub static FOO_FSTATIC: FooStruct; - pub type FooFType; -} -pub fn foo_fn() {} -pub trait FooTrait {} -pub struct FooStruct; -pub enum FooEnum {} -pub union FooUnion { - x: (), -} -pub type FooType = FooStruct; -pub static FOO_STATIC: FooStruct = FooStruct; -pub const FOO_CONSTANT: FooStruct = FooStruct; -#[macro_export] -macro_rules! foo_macro { - () => (); -} diff --git a/src/test/rustdoc/auxiliary/auto-traits.rs b/src/test/rustdoc/auxiliary/auto-traits.rs deleted file mode 100644 index f52210613888d..0000000000000 --- a/src/test/rustdoc/auxiliary/auto-traits.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![feature(optin_builtin_traits)] - -pub unsafe auto trait Bar {} diff --git a/src/test/rustdoc/auxiliary/empty.rs b/src/test/rustdoc/auxiliary/empty.rs deleted file mode 100644 index d11c69f812a8d..0000000000000 --- a/src/test/rustdoc/auxiliary/empty.rs +++ /dev/null @@ -1 +0,0 @@ -// intentionally empty diff --git a/src/test/rustdoc/auxiliary/enum-primitive.rs b/src/test/rustdoc/auxiliary/enum-primitive.rs deleted file mode 100644 index ed1da253a9732..0000000000000 --- a/src/test/rustdoc/auxiliary/enum-primitive.rs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) 2015 Anders Kaseorg - -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// “Software”), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: - -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -//! This crate exports a macro `enum_from_primitive!` that wraps an -//! `enum` declaration and automatically adds an implementation of -//! `num::FromPrimitive` (reexported here), to allow conversion from -//! primitive integers to the enum. It therefore provides an -//! alternative to the built-in `#[derive(FromPrimitive)]`, which -//! requires the unstable `std::num::FromPrimitive` and is disabled in -//! Rust 1.0. -//! -//! # Example -//! -//! ``` -//! #[macro_use] extern crate enum_primitive; -//! extern crate num_traits; -//! use num_traits::FromPrimitive; -//! -//! enum_from_primitive! { -//! #[derive(Debug, PartialEq)] -//! enum FooBar { -//! Foo = 17, -//! Bar = 42, -//! Baz, -//! } -//! } -//! -//! fn main() { -//! assert_eq!(FooBar::from_i32(17), Some(FooBar::Foo)); -//! assert_eq!(FooBar::from_i32(42), Some(FooBar::Bar)); -//! assert_eq!(FooBar::from_i32(43), Some(FooBar::Baz)); -//! assert_eq!(FooBar::from_i32(91), None); -//! } -//! ``` - -pub mod num_traits { - pub trait FromPrimitive: Sized { - fn from_i64(n: i64) -> Option; - fn from_u64(n: u64) -> Option; - } -} - -pub use std::option::Option; -pub use num_traits::FromPrimitive; - -/// Helper macro for internal use by `enum_from_primitive!`. -#[macro_export] -macro_rules! enum_from_primitive_impl_ty { - ($meth:ident, $ty:ty, $name:ident, $( $variant:ident )*) => { - #[allow(non_upper_case_globals, unused)] - fn $meth(n: $ty) -> $crate::Option { - $( if n == $name::$variant as $ty { - $crate::Option::Some($name::$variant) - } else )* { - $crate::Option::None - } - } - }; -} - -/// Helper macro for internal use by `enum_from_primitive!`. -#[macro_export] -#[macro_use(enum_from_primitive_impl_ty)] -macro_rules! enum_from_primitive_impl { - ($name:ident, $( $variant:ident )*) => { - impl $crate::FromPrimitive for $name { - enum_from_primitive_impl_ty! { from_i64, i64, $name, $( $variant )* } - enum_from_primitive_impl_ty! { from_u64, u64, $name, $( $variant )* } - } - }; -} - -/// Wrap this macro around an `enum` declaration to get an -/// automatically generated implementation of `num::FromPrimitive`. -#[macro_export] -#[macro_use(enum_from_primitive_impl)] -macro_rules! enum_from_primitive { - ( - $( #[$enum_attr:meta] )* - enum $name:ident { - $( $( #[$variant_attr:meta] )* $variant:ident ),+ - $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )* - } - ) => { - $( #[$enum_attr] )* - enum $name { - $( $( #[$variant_attr] )* $variant ),+ - $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )* - } - enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - enum $name:ident { - $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),* - } - ) => { - $( #[$enum_attr] )* - enum $name { - $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),* - } - enum_from_primitive_impl! { $name, $( $( $variant )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - enum $name:ident { - $( $( #[$variant_attr:meta] )* $variant:ident ),+ - $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*, - } - ) => { - $( #[$enum_attr] )* - enum $name { - $( $( #[$variant_attr] )* $variant ),+ - $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*, - } - enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - enum $name:ident { - $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),+, - } - ) => { - $( #[$enum_attr] )* - enum $name { - $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),+, - } - enum_from_primitive_impl! { $name, $( $( $variant )+ )+ } - }; - - ( - $( #[$enum_attr:meta] )* - pub enum $name:ident { - $( $( #[$variant_attr:meta] )* $variant:ident ),+ - $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )* - } - ) => { - $( #[$enum_attr] )* - pub enum $name { - $( $( #[$variant_attr] )* $variant ),+ - $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )* - } - enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - pub enum $name:ident { - $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),* - } - ) => { - $( #[$enum_attr] )* - pub enum $name { - $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),* - } - enum_from_primitive_impl! { $name, $( $( $variant )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - pub enum $name:ident { - $( $( #[$variant_attr:meta] )* $variant:ident ),+ - $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*, - } - ) => { - $( #[$enum_attr] )* - pub enum $name { - $( $( #[$variant_attr] )* $variant ),+ - $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*, - } - enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* } - }; - - ( - $( #[$enum_attr:meta] )* - pub enum $name:ident { - $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),+, - } - ) => { - $( #[$enum_attr] )* - pub enum $name { - $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),+, - } - enum_from_primitive_impl! { $name, $( $( $variant )+ )+ } - }; -} diff --git a/src/test/rustdoc/auxiliary/extern-impl-trait.rs b/src/test/rustdoc/auxiliary/extern-impl-trait.rs deleted file mode 100644 index dbd543930980b..0000000000000 --- a/src/test/rustdoc/auxiliary/extern-impl-trait.rs +++ /dev/null @@ -1,27 +0,0 @@ -pub trait Foo { - type Associated; -} - -pub struct X; -pub struct Y; - - -impl Foo for X { - type Associated = (); -} - -impl Foo for Y { - type Associated = (); -} - -impl X { - pub fn returns_sized<'a>(&'a self) -> impl Foo + 'a { - X - } -} - -impl Y { - pub fn returns_unsized<'a>(&'a self) -> Box + 'a> { - Box::new(X) - } -} diff --git a/src/test/rustdoc/auxiliary/extern-links.rs b/src/test/rustdoc/auxiliary/extern-links.rs deleted file mode 100644 index 4a835673a596b..0000000000000 --- a/src/test/rustdoc/auxiliary/extern-links.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct Foo; diff --git a/src/test/rustdoc/auxiliary/external-cross-doc.md b/src/test/rustdoc/auxiliary/external-cross-doc.md deleted file mode 100644 index 8b4e6edc69997..0000000000000 --- a/src/test/rustdoc/auxiliary/external-cross-doc.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cross-crate imported docs - -This file is to make sure `#[doc(include="file.md")]` works when you re-export an item with included -docs. diff --git a/src/test/rustdoc/auxiliary/external-cross.rs b/src/test/rustdoc/auxiliary/external-cross.rs deleted file mode 100644 index 473d4ec99f037..0000000000000 --- a/src/test/rustdoc/auxiliary/external-cross.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(external_doc)] -#![deny(missing_doc)] - -#[doc(include="external-cross-doc.md")] -pub struct NeedMoreDocs; diff --git a/src/test/rustdoc/auxiliary/external-doc.md b/src/test/rustdoc/auxiliary/external-doc.md deleted file mode 100644 index 38478c1635a17..0000000000000 --- a/src/test/rustdoc/auxiliary/external-doc.md +++ /dev/null @@ -1,3 +0,0 @@ -# External Docs - -This file is here to test the `#[doc(include="file")]` attribute. diff --git a/src/test/rustdoc/auxiliary/inline-default-methods.rs b/src/test/rustdoc/auxiliary/inline-default-methods.rs deleted file mode 100644 index 8a636f449210f..0000000000000 --- a/src/test/rustdoc/auxiliary/inline-default-methods.rs +++ /dev/null @@ -1,6 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Foo { - fn bar(&self); - fn foo(&mut self) {} -} diff --git a/src/test/rustdoc/auxiliary/intra-link-extern-crate.rs b/src/test/rustdoc/auxiliary/intra-link-extern-crate.rs deleted file mode 100644 index db3bb38ada0da..0000000000000 --- a/src/test/rustdoc/auxiliary/intra-link-extern-crate.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_name="inner"] - -//! ooh, i'm a rebel just for [kicks] diff --git a/src/test/rustdoc/auxiliary/intra-links-external-traits.rs b/src/test/rustdoc/auxiliary/intra-links-external-traits.rs deleted file mode 100644 index 6142dcda986cf..0000000000000 --- a/src/test/rustdoc/auxiliary/intra-links-external-traits.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub trait ThisTrait { - fn asdf(&self); - - /// let's link to [`asdf`](ThisTrait::asdf) - fn qwop(&self); -} diff --git a/src/test/rustdoc/auxiliary/issue-13698.rs b/src/test/rustdoc/auxiliary/issue-13698.rs deleted file mode 100644 index a65ebfe36a497..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-13698.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Foo { - #[doc(hidden)] - fn foo(&self) {} -} - -impl Foo for i32 {} diff --git a/src/test/rustdoc/auxiliary/issue-15318.rs b/src/test/rustdoc/auxiliary/issue-15318.rs deleted file mode 100644 index 83cc31b587c29..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-15318.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: -Cmetadata=aux - -#![doc(html_root_url = "http://example.com/")] - -/// dox -#[doc(primitive = "pointer")] -pub mod ptr {} diff --git a/src/test/rustdoc/auxiliary/issue-17476.rs b/src/test/rustdoc/auxiliary/issue-17476.rs deleted file mode 100644 index 80c915eb7cfae..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-17476.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: -Cmetadata=aux - -#![doc(html_root_url = "http://example.com")] - -pub trait Foo { - fn foo(&self) {} -} diff --git a/src/test/rustdoc/auxiliary/issue-19190-3.rs b/src/test/rustdoc/auxiliary/issue-19190-3.rs deleted file mode 100644 index 8c526a89a882e..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-19190-3.rs +++ /dev/null @@ -1,23 +0,0 @@ -// compile-flags: -Cmetadata=aux - -use std::ops::Deref; - -pub struct Foo; - -impl Deref for Foo { - type Target = String; - fn deref(&self) -> &String { loop {} } -} - -pub struct Bar; -pub struct Baz; - -impl Baz { - pub fn baz(&self) {} - pub fn static_baz() {} -} - -impl Deref for Bar { - type Target = Baz; - fn deref(&self) -> &Baz { loop {} } -} diff --git a/src/test/rustdoc/auxiliary/issue-20646.rs b/src/test/rustdoc/auxiliary/issue-20646.rs deleted file mode 100644 index 8e16f2de0d97a..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-20646.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Trait { - type Output; -} - -pub fn fun(_: T) where T: Trait {} diff --git a/src/test/rustdoc/auxiliary/issue-20727.rs b/src/test/rustdoc/auxiliary/issue-20727.rs deleted file mode 100644 index 7ffc1985b058e..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-20727.rs +++ /dev/null @@ -1,30 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Deref { - type Target: ?Sized; - - fn deref<'a>(&'a self) -> &'a Self::Target; -} - -pub trait Add { - type Output; - - fn add(self, rhs: RHS) -> Self::Output; -} - - -pub trait Bar {} -pub trait Deref2 { - type Target: Bar; - - fn deref(&self) -> Self::Target; -} - -pub trait Index { - type Output: ?Sized; - fn index(&self, index: Idx) -> &Self::Output; -} - -pub trait IndexMut: Index { - fn index_mut(&mut self, index: Idx) -> &mut Self::Output; -} diff --git a/src/test/rustdoc/auxiliary/issue-21092.rs b/src/test/rustdoc/auxiliary/issue-21092.rs deleted file mode 100644 index 51ab7de1c546c..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-21092.rs +++ /dev/null @@ -1,12 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Foo { - type Bar; - fn foo(&self) {} -} - -pub struct Bar; - -impl Foo for Bar { - type Bar = i32; -} diff --git a/src/test/rustdoc/auxiliary/issue-21801.rs b/src/test/rustdoc/auxiliary/issue-21801.rs deleted file mode 100644 index 732612ff00076..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-21801.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub struct Foo; - -impl Foo { - pub fn new(f: F) -> Foo where F: FnMut() -> i32 { - loop {} - } -} diff --git a/src/test/rustdoc/auxiliary/issue-22025.rs b/src/test/rustdoc/auxiliary/issue-22025.rs deleted file mode 100644 index 5346c0e92bdec..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-22025.rs +++ /dev/null @@ -1,10 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub mod foo { - - pub trait Foo {} - pub struct Bar; - - impl Foo for Bar {} - -} diff --git a/src/test/rustdoc/auxiliary/issue-23207-1.rs b/src/test/rustdoc/auxiliary/issue-23207-1.rs deleted file mode 100644 index 8531d5f1acd3c..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-23207-1.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod fmt { - pub struct Error; -} diff --git a/src/test/rustdoc/auxiliary/issue-23207-2.rs b/src/test/rustdoc/auxiliary/issue-23207-2.rs deleted file mode 100644 index b92b16653167b..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-23207-2.rs +++ /dev/null @@ -1,5 +0,0 @@ -extern crate issue_23207_1; - -pub mod fmt { - pub use issue_23207_1::fmt::Error; -} diff --git a/src/test/rustdoc/auxiliary/issue-26606-macro.rs b/src/test/rustdoc/auxiliary/issue-26606-macro.rs deleted file mode 100644 index d60d32526aa36..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-26606-macro.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[macro_export] -macro_rules! make_item ( - ($name: ident) => (pub const $name: usize = 42;) -); diff --git a/src/test/rustdoc/auxiliary/issue-27362.rs b/src/test/rustdoc/auxiliary/issue-27362.rs deleted file mode 100644 index 077bdc33e66f6..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-27362.rs +++ /dev/null @@ -1,10 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub const fn foo() {} -pub const unsafe fn bar() {} - -pub struct Foo; - -impl Foo { - pub const unsafe fn baz() {} -} diff --git a/src/test/rustdoc/auxiliary/issue-28927-1.rs b/src/test/rustdoc/auxiliary/issue-28927-1.rs deleted file mode 100644 index 688c73428ddaa..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-28927-1.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod detail { - pub extern crate issue_28927_2 as inner2; -} -pub use detail::inner2 as bar; diff --git a/src/test/rustdoc/auxiliary/issue-28927-2.rs b/src/test/rustdoc/auxiliary/issue-28927-2.rs deleted file mode 100644 index 7c0937fce20f2..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-28927-2.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct Baz; diff --git a/src/test/rustdoc/auxiliary/issue-29584.rs b/src/test/rustdoc/auxiliary/issue-29584.rs deleted file mode 100644 index a9b8796c0fe31..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-29584.rs +++ /dev/null @@ -1,10 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub struct Foo; - -#[doc(hidden)] -mod bar { - trait Bar {} - - impl Bar for ::Foo {} -} diff --git a/src/test/rustdoc/auxiliary/issue-30109-1.rs b/src/test/rustdoc/auxiliary/issue-30109-1.rs deleted file mode 100644 index ca05a6a9076c2..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-30109-1.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct Bar; diff --git a/src/test/rustdoc/auxiliary/issue-34274.rs b/src/test/rustdoc/auxiliary/issue-34274.rs deleted file mode 100644 index b0c3b4f562985..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-34274.rs +++ /dev/null @@ -1,3 +0,0 @@ -extern { - pub fn extern_c_fn(); -} diff --git a/src/test/rustdoc/auxiliary/issue-36031.rs b/src/test/rustdoc/auxiliary/issue-36031.rs deleted file mode 100644 index da688139e3462..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-36031.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub trait Foo { - const FOO: usize; -} - -pub struct Bar; - -impl Bar { - pub const BAR: usize = 3; -} diff --git a/src/test/rustdoc/auxiliary/issue-40936.rs b/src/test/rustdoc/auxiliary/issue-40936.rs deleted file mode 100644 index b921e52017323..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-40936.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod outermod { - pub mod innermod { - pub use super::*; - } -} diff --git a/src/test/rustdoc/auxiliary/issue-46727.rs b/src/test/rustdoc/auxiliary/issue-46727.rs deleted file mode 100644 index 30dccfa77b5a4..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-46727.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub trait Foo {} - -pub struct Bar { x: T } - -impl Foo for Bar<[T; 1 + 1 + 1]> {} diff --git a/src/test/rustdoc/auxiliary/issue-48414.rs b/src/test/rustdoc/auxiliary/issue-48414.rs deleted file mode 100644 index f442ac722128c..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-48414.rs +++ /dev/null @@ -1,5 +0,0 @@ -/// Woah, this trait links to [OtherTrait](OtherTrait)! -pub trait SomeTrait {} - -/// Woah, this trait links to [SomeTrait](SomeTrait)! -pub trait OtherTrait {} diff --git a/src/test/rustdoc/auxiliary/issue-53689.rs b/src/test/rustdoc/auxiliary/issue-53689.rs deleted file mode 100644 index 5003c2c00f4f5..0000000000000 --- a/src/test/rustdoc/auxiliary/issue-53689.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct MyStruct; diff --git a/src/test/rustdoc/auxiliary/masked.rs b/src/test/rustdoc/auxiliary/masked.rs deleted file mode 100644 index f289359e52ac9..0000000000000 --- a/src/test/rustdoc/auxiliary/masked.rs +++ /dev/null @@ -1,10 +0,0 @@ -#[derive(Clone)] -pub struct MaskedStruct; - -pub trait MaskedTrait { - fn masked_method(); -} - -impl MaskedTrait for String { - fn masked_method() {} -} diff --git a/src/test/rustdoc/auxiliary/mod-stackoverflow.rs b/src/test/rustdoc/auxiliary/mod-stackoverflow.rs deleted file mode 100644 index e0b90f180ee23..0000000000000 --- a/src/test/rustdoc/auxiliary/mod-stackoverflow.rs +++ /dev/null @@ -1,11 +0,0 @@ -// compile-flags: -Cmetadata=aux - -pub mod tree { - pub use tree; -} - -pub mod tree2 { - pub mod prelude { - pub use tree2; - } -} diff --git a/src/test/rustdoc/auxiliary/pub-extern-crate.rs b/src/test/rustdoc/auxiliary/pub-extern-crate.rs deleted file mode 100644 index 8c89c8d6c76c5..0000000000000 --- a/src/test/rustdoc/auxiliary/pub-extern-crate.rs +++ /dev/null @@ -1,2 +0,0 @@ -#![crate_name = "inner"] -pub struct SomeStruct; diff --git a/src/test/rustdoc/auxiliary/pub-use-extern-macros.rs b/src/test/rustdoc/auxiliary/pub-use-extern-macros.rs deleted file mode 100644 index 7934e07339ab7..0000000000000 --- a/src/test/rustdoc/auxiliary/pub-use-extern-macros.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_name="macros"] - -#[macro_export] -macro_rules! foo { - () => {}; -} - -#[macro_export] -macro_rules! bar { - () => {}; -} - -#[macro_export] -macro_rules! baz { - () => {}; -} - -#[macro_export] -macro_rules! quux { - () => {}; -} diff --git a/src/test/rustdoc/auxiliary/reexp-stripped.rs b/src/test/rustdoc/auxiliary/reexp-stripped.rs deleted file mode 100644 index ccc3dc11fd1ec..0000000000000 --- a/src/test/rustdoc/auxiliary/reexp-stripped.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub use private::Quz; -pub use hidden::Bar; - -mod private { - pub struct Quz; -} - -#[doc(hidden)] -pub mod hidden { - pub struct Bar; -} diff --git a/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs b/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs deleted file mode 100644 index 36e2821c5a8b9..0000000000000 --- a/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![feature(optin_builtin_traits)] - -pub mod bar { - use std::marker; - - pub auto trait Bar {} - - pub trait Foo { - fn foo(&self) {} - } - - impl Foo { - pub fn test(&self) {} - } - - pub struct TypeId; - - impl TypeId { - pub fn of() -> TypeId { - panic!() - } - } -} diff --git a/src/test/rustdoc/auxiliary/rustdoc-extern-default-method.rs b/src/test/rustdoc/auxiliary/rustdoc-extern-default-method.rs deleted file mode 100644 index 12934238a8e92..0000000000000 --- a/src/test/rustdoc/auxiliary/rustdoc-extern-default-method.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![crate_type="lib"] - -pub trait Trait { - fn provided(&self) {} -} - -pub struct Struct; - -impl Trait for Struct { - fn provided(&self) {} -} diff --git a/src/test/rustdoc/auxiliary/rustdoc-extern-method.rs b/src/test/rustdoc/auxiliary/rustdoc-extern-method.rs deleted file mode 100644 index e493048d9da34..0000000000000 --- a/src/test/rustdoc/auxiliary/rustdoc-extern-method.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_type="lib"] -#![feature(unboxed_closures)] - -pub trait Foo { - extern "rust-call" fn foo(&self, _: ()) -> i32; - extern "rust-call" fn foo_(&self, _: ()) -> i32 { 0 } -} diff --git a/src/test/rustdoc/auxiliary/rustdoc-ffi.rs b/src/test/rustdoc/auxiliary/rustdoc-ffi.rs deleted file mode 100644 index b74d190b52662..0000000000000 --- a/src/test/rustdoc/auxiliary/rustdoc-ffi.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_type="lib"] - -extern "C" { - // @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)' - pub fn foreigner(cold_as_ice: u32); -} diff --git a/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs b/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs deleted file mode 100644 index 869aebc774ad4..0000000000000 --- a/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![feature(optin_builtin_traits)] - -pub auto trait AnOibit {} diff --git a/src/test/rustdoc/auxiliary/src-links-external.rs b/src/test/rustdoc/auxiliary/src-links-external.rs deleted file mode 100644 index 4a835673a596b..0000000000000 --- a/src/test/rustdoc/auxiliary/src-links-external.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct Foo; diff --git a/src/test/rustdoc/auxiliary/unit-return.rs b/src/test/rustdoc/auxiliary/unit-return.rs deleted file mode 100644 index 7b9986162c630..0000000000000 --- a/src/test/rustdoc/auxiliary/unit-return.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub fn f2(f: F) {} - -pub fn f3 () + Clone>(f: F) {} diff --git a/src/test/rustdoc/auxiliary/variant-struct.rs b/src/test/rustdoc/auxiliary/variant-struct.rs deleted file mode 100644 index 0f3d2e5f1b7a0..0000000000000 --- a/src/test/rustdoc/auxiliary/variant-struct.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub enum Foo { - Bar { - qux: (), - } -} diff --git a/src/test/rustdoc/bad-codeblock-syntax.rs b/src/test/rustdoc/bad-codeblock-syntax.rs deleted file mode 100644 index 0ab2f68fcdebe..0000000000000 --- a/src/test/rustdoc/bad-codeblock-syntax.rs +++ /dev/null @@ -1,27 +0,0 @@ -// @has bad_codeblock_syntax/fn.foo.html -// @has - '//*[@class="docblock"]/pre/code' '\_' -/// ``` -/// \_ -/// ``` -pub fn foo() {} - -// @has bad_codeblock_syntax/fn.bar.html -// @has - '//*[@class="docblock"]/pre/code' '`baz::foobar`' -/// ``` -/// `baz::foobar` -/// ``` -pub fn bar() {} - -// @has bad_codeblock_syntax/fn.quux.html -// @has - '//*[@class="docblock"]/pre/code' '\_' -/// ```rust -/// \_ -/// ``` -pub fn quux() {} - -// @has bad_codeblock_syntax/fn.ok.html -// @has - '//*[@class="docblock"]/pre/code[@class="language-text"]' '\_' -/// ```text -/// \_ -/// ``` -pub fn ok() {} diff --git a/src/test/rustdoc/blanket-reexport-item.rs b/src/test/rustdoc/blanket-reexport-item.rs deleted file mode 100644 index f247ee637b975..0000000000000 --- a/src/test/rustdoc/blanket-reexport-item.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/struct.S.html '//h3[@id="impl-Into%3CU%3E"]//code' 'impl Into for T' -pub struct S2 {} -mod m { - pub struct S {} -} -pub use m::*; diff --git a/src/test/rustdoc/cap-lints.rs b/src/test/rustdoc/cap-lints.rs deleted file mode 100644 index b66f75695f2ab..0000000000000 --- a/src/test/rustdoc/cap-lints.rs +++ /dev/null @@ -1,10 +0,0 @@ -// This should fail a normal compile due to non_camel_case_types, -// It should pass a doc-compile as it only needs to type-check and -// therefore should not concern itself with the lints. -#[deny(warnings)] - -// @has cap_lints/struct.Foo.html //pre '#[must_use]' -#[must_use] -pub struct Foo { - field: i32, -} diff --git a/src/test/rustdoc/check-styled-link.rs b/src/test/rustdoc/check-styled-link.rs deleted file mode 100644 index b479820dfb2ec..0000000000000 --- a/src/test/rustdoc/check-styled-link.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![crate_name = "foo"] - -pub struct Foo; - -// @has foo/struct.Bar.html '//a[@href="../foo/struct.Foo.html"]' 'Foo' - -/// Code-styled reference to [`Foo`]. -pub struct Bar; diff --git a/src/test/rustdoc/codeblock-title.rs b/src/test/rustdoc/codeblock-title.rs deleted file mode 100644 index 2f77929c74e37..0000000000000 --- a/src/test/rustdoc/codeblock-title.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]/span' "This example deliberately fails to compile" -// @has foo/fn.bar.html '//*[@class="tooltip ignore"]/span' "This example is not tested" - -/// foo -/// -/// ```compile_fail -/// foo(); -/// ``` -/// -/// ```ignore (tidy) -/// goo(); -/// ``` -/// -/// ``` -/// let x = 0; -/// ``` -pub fn bar() -> usize { 2 } diff --git a/src/test/rustdoc/comment-in-doctest.rs b/src/test/rustdoc/comment-in-doctest.rs deleted file mode 100644 index e4e41bc7ce308..0000000000000 --- a/src/test/rustdoc/comment-in-doctest.rs +++ /dev/null @@ -1,20 +0,0 @@ -// compile-flags:--test - -// comments, both doc comments and regular ones, used to trick rustdoc's doctest parser into -// thinking that everything after it was part of the regular program. combined with the libsyntax -// parser loop failing to detect the manual main function, it would wrap everything in `fn main`, -// which would cause the doctest to fail as the "extern crate" declaration was no longer valid. -// oddly enough, it would pass in 2018 if a crate was in the extern prelude. see -// https://github.com/rust-lang/rust/issues/56727 - -//! ``` -//! // crate: proc-macro-test -//! //! this is a test -//! -//! // used to pull in proc-macro specific items -//! extern crate proc_macro; -//! -//! use proc_macro::TokenStream; -//! -//! # fn main() {} -//! ``` diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs deleted file mode 100644 index 9df0368c40dfd..0000000000000 --- a/src/test/rustdoc/const-display.rs +++ /dev/null @@ -1,32 +0,0 @@ -#![crate_name = "foo"] - -#![unstable(feature = "humans", - reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] - -#![feature(rustc_const_unstable, const_fn, foo, foo2)] -#![feature(staged_api)] - -// @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32' -#[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo")] -pub const unsafe fn foo() -> u32 { 42 } - -// @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32' -#[unstable(feature = "humans", issue="0")] -pub const fn foo2() -> u32 { 42 } - -// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' -#[stable(feature = "rust1", since = "1.0.0")] -pub const fn bar2() -> u32 { 42 } - -// @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32' -#[unstable(feature = "foo2", issue="0")] -pub const unsafe fn foo2_gated() -> u32 { 42 } - -// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' -#[stable(feature = "rust1", since = "1.0.0")] -pub const unsafe fn bar2_gated() -> u32 { 42 } - -// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32' -pub const unsafe fn bar_not_gated() -> u32 { 42 } diff --git a/src/test/rustdoc/const-doc.rs b/src/test/rustdoc/const-doc.rs deleted file mode 100644 index 74ab4af61acba..0000000000000 --- a/src/test/rustdoc/const-doc.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::marker::PhantomData; - -pub struct Foo<'a> { - f: PhantomData<&'a u32>, -} - -pub struct ContentType { - pub ttype: Foo<'static>, - pub subtype: Foo<'static>, - pub params: Option>, -} - -impl ContentType { - // @has const_doc/struct.ContentType.html - // @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType' - pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, }, - subtype: Foo { f: PhantomData, }, - params: None, }; -} diff --git a/src/test/rustdoc/const-evalutation-ice.rs b/src/test/rustdoc/const-evalutation-ice.rs deleted file mode 100644 index 68c7f9c5686ff..0000000000000 --- a/src/test/rustdoc/const-evalutation-ice.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Just check we don't get an ICE for `N`. - -use std::cell::Cell; -use std::mem; - -pub struct S { - s: Cell -} - -pub const N: usize = 0 - (mem::size_of::() != 4) as usize; diff --git a/src/test/rustdoc/const-fn.rs b/src/test/rustdoc/const-fn.rs deleted file mode 100644 index 9ea7343e0757a..0000000000000 --- a/src/test/rustdoc/const-fn.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.bar.html -// @has - '//*[@class="rust fn"]' 'pub const fn bar() -> ' -/// foo -pub const fn bar() -> usize { - 2 -} - -// @has foo/struct.Foo.html -// @has - '//*[@class="method"]' 'const fn new()' -pub struct Foo(usize); - -impl Foo { - pub const fn new() -> Foo { Foo(0) } -} diff --git a/src/test/rustdoc/const.rs b/src/test/rustdoc/const.rs deleted file mode 100644 index c33db5809cc7c..0000000000000 --- a/src/test/rustdoc/const.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_type="lib"] - -pub struct Foo; - -impl Foo { - // @has const/struct.Foo.html '//code[@id="new.v"]' 'const unsafe fn new' - pub const unsafe fn new() -> Foo { - Foo - } -} diff --git a/src/test/rustdoc/constructor-imports.rs b/src/test/rustdoc/constructor-imports.rs deleted file mode 100644 index 26795c274447d..0000000000000 --- a/src/test/rustdoc/constructor-imports.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_name = "foo"] - -pub mod a { - pub struct Foo; - pub enum Bar { - Baz, - } -} - -// @count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1 -#[doc(no_inline)] -pub use a::Foo; -// @count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1 -#[doc(no_inline)] -pub use a::Bar::Baz; diff --git a/src/test/rustdoc/crate-version.rs b/src/test/rustdoc/crate-version.rs deleted file mode 100644 index 9ea84ac031211..0000000000000 --- a/src/test/rustdoc/crate-version.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --crate-version=1.3.37 -Z unstable-options - -// @has 'crate_version/index.html' '//div[@class="block version"]/p' 'Version 1.3.37' diff --git a/src/test/rustdoc/cross-crate-links.rs b/src/test/rustdoc/cross-crate-links.rs deleted file mode 100644 index 7c736a4cc1153..0000000000000 --- a/src/test/rustdoc/cross-crate-links.rs +++ /dev/null @@ -1,59 +0,0 @@ -// aux-build:all-item-types.rs -// build-aux-docs - -#![crate_name = "foo"] - -#[macro_use] -extern crate all_item_types; - -// @has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod' -#[doc(no_inline)] -pub use all_item_types::foo_mod; - -// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn' -#[doc(no_inline)] -pub use all_item_types::foo_ffn; - -// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC' -#[doc(no_inline)] -pub use all_item_types::FOO_FSTATIC; - -// @has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType' -#[doc(no_inline)] -pub use all_item_types::FooFType; - -// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn' -#[doc(no_inline)] -pub use all_item_types::foo_fn; - -// @has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait' -#[doc(no_inline)] -pub use all_item_types::FooTrait; - -// @has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct' -#[doc(no_inline)] -pub use all_item_types::FooStruct; - -// @has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum' -#[doc(no_inline)] -pub use all_item_types::FooEnum; - -// @has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion' -#[doc(no_inline)] -pub use all_item_types::FooUnion; - -// @has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType' -#[doc(no_inline)] -pub use all_item_types::FooType; - -// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC' -#[doc(no_inline)] -pub use all_item_types::FOO_STATIC; - -// @has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT' -#[doc(no_inline)] -pub use all_item_types::FOO_CONSTANT; - -// @has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro' -#[doc(no_inline)] -pub use all_item_types::foo_macro; diff --git a/src/test/rustdoc/default-impl.rs b/src/test/rustdoc/default-impl.rs deleted file mode 100644 index f11b3b29b9372..0000000000000 --- a/src/test/rustdoc/default-impl.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:rustdoc-default-impl.rs -// ignore-cross-compile - -extern crate rustdoc_default_impl as foo; - -pub use foo::bar; - -pub fn wut() { -} diff --git a/src/test/rustdoc/default-trait-method-link.rs b/src/test/rustdoc/default-trait-method-link.rs deleted file mode 100644 index e4f0bdab16292..0000000000000 --- a/src/test/rustdoc/default-trait-method-link.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/trait.Foo.html '//a[@href="../foo/trait.Foo.html#tymethod.req"]' 'req' -// @has foo/trait.Foo.html '//a[@href="../foo/trait.Foo.html#method.prov"]' 'prov' - -/// Always make sure to implement [`req`], but you don't have to implement [`prov`]. -/// -/// [`req`]: Foo::req -/// [`prov`]: Foo::prov -pub trait Foo { - /// Required - fn req(); - /// Provided - fn prov() {} -} diff --git a/src/test/rustdoc/default-trait-method.rs b/src/test/rustdoc/default-trait-method.rs deleted file mode 100644 index 3d6ebef5a1d5b..0000000000000 --- a/src/test/rustdoc/default-trait-method.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![feature(specialization)] - -// @has default_trait_method/trait.Item.html -// @has - '//*[@id="tymethod.foo"]' 'fn foo()' -// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' -// @has - '//*[@id="tymethod.bar"]' 'fn bar()' -// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' -pub trait Item { - fn foo(); - fn bar(); - fn baz() {} -} - -// @has default_trait_method/struct.Foo.html -// @has - '//*[@id="method.foo"]' 'default fn foo()' -// @has - '//*[@id="method.bar"]' 'fn bar()' -// @!has - '//*[@id="method.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' -pub struct Foo; -impl Item for Foo { - default fn foo() {} - fn bar() {} -} diff --git a/src/test/rustdoc/deprecated-future.rs b/src/test/rustdoc/deprecated-future.rs deleted file mode 100644 index c5248c52fb973..0000000000000 --- a/src/test/rustdoc/deprecated-future.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(deprecated)] - -// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \ -// 'Deprecated' -// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ -// 'Deprecated since 99.99.99: effectively never' -#[deprecated(since = "99.99.99", note = "effectively never")] -pub struct S; diff --git a/src/test/rustdoc/deprecated-impls.rs b/src/test/rustdoc/deprecated-impls.rs deleted file mode 100644 index efd250ce9f00f..0000000000000 --- a/src/test/rustdoc/deprecated-impls.rs +++ /dev/null @@ -1,118 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/struct.Foo0.html -pub struct Foo0; - -impl Foo0 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc' - // @has - 'fn_with_doc short' - // @has - 'fn_with_doc full' - /// fn_with_doc short - /// - /// fn_with_doc full - #[deprecated(since = "1.0.1", note = "fn_with_doc")] - pub fn fn_with_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc' - #[deprecated(since = "1.0.2", note = "fn_without_doc")] - pub fn fn_without_doc() {} -} - -pub trait Bar { - /// fn_empty_with_doc short - /// - /// fn_empty_with_doc full - #[deprecated(since = "1.0.3", note = "fn_empty_with_doc")] - fn fn_empty_with_doc(); - - #[deprecated(since = "1.0.4", note = "fn_empty_without_doc")] - fn fn_empty_without_doc(); - - /// fn_def_with_doc short - /// - /// fn_def_with_doc full - #[deprecated(since = "1.0.5", note = "fn_def_with_doc")] - fn fn_def_with_doc() {} - - #[deprecated(since = "1.0.6", note = "fn_def_without_doc")] - fn fn_def_without_doc() {} - - /// fn_def_def_with_doc short - /// - /// fn_def_def_with_doc full - #[deprecated(since = "1.0.7", note = "fn_def_def_with_doc")] - fn fn_def_def_with_doc() {} - - #[deprecated(since = "1.0.8", note = "fn_def_def_without_doc")] - fn fn_def_def_without_doc() {} -} - -// @has foo/struct.Foo1.html -pub struct Foo1; - -impl Bar for Foo1 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' - // @has - 'fn_empty_with_doc_impl short' - // @has - 'fn_empty_with_doc_impl full' - /// fn_empty_with_doc_impl short - /// - /// fn_empty_with_doc_impl full - fn fn_empty_with_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' - fn fn_empty_without_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' - // @has - 'fn_def_with_doc_impl short' - // @has - 'fn_def_with_doc_impl full' - /// fn_def_with_doc_impl short - /// - /// fn_def_with_doc_impl full - fn fn_def_with_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' - fn fn_def_without_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' - // @has - 'fn_def_def_with_doc short' - // @!has - 'fn_def_def_with_doc full' - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' -} - -// @has foo/struct.Foo2.html -pub struct Foo2; - -impl Bar for Foo2 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' - // @has - 'fn_empty_with_doc short' - // @!has - 'fn_empty_with_doc full' - fn fn_empty_with_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' - // @has - 'fn_empty_without_doc_impl short' - // @has - 'fn_empty_without_doc_impl full' - /// fn_empty_without_doc_impl short - /// - /// fn_empty_without_doc_impl full - fn fn_empty_without_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' - // @has - 'fn_def_with_doc short' - // @!has - 'fn_def_with_doc full' - fn fn_def_with_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' - // @has - 'fn_def_without_doc_impl short' - // @has - 'fn_def_without_doc_impl full' - /// fn_def_without_doc_impl short - /// - /// fn_def_without_doc_impl full - fn fn_def_without_doc() {} - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' - // @has - 'fn_def_def_with_doc short' - // @!has - 'fn_def_def_with_doc full' - - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' -} diff --git a/src/test/rustdoc/deprecated.rs b/src/test/rustdoc/deprecated.rs deleted file mode 100644 index 18a33438a2346..0000000000000 --- a/src/test/rustdoc/deprecated.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![feature(deprecated)] - -// @has deprecated/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \ -// 'Deprecated' -// @has - '//*[@class="docblock-short"]' 'Deprecated docs' - -// @has deprecated/struct.S.html '//*[@class="stab deprecated"]' \ -// 'Deprecated since 1.0.0: text' -/// Deprecated docs -#[deprecated(since = "1.0.0", note = "text")] -pub struct S; - -// @matches deprecated/index.html '//*[@class="docblock-short"]' '^Docs' -/// Docs -pub struct T; - -// @matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \ -// 'Deprecated since 1.0.0$' -#[deprecated(since = "1.0.0")] -pub struct U; - -// @matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \ -// 'Deprecated: text$' -#[deprecated(note = "text")] -pub struct V; - -// @matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \ -// 'Deprecated$' -#[deprecated] -pub struct W; - -// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \ -// 'Deprecated: shorthand reason$' -#[deprecated = "shorthand reason"] -pub struct X; diff --git a/src/test/rustdoc/doc-assoc-item.rs b/src/test/rustdoc/doc-assoc-item.rs deleted file mode 100644 index 4d5c9f83e1ee0..0000000000000 --- a/src/test/rustdoc/doc-assoc-item.rs +++ /dev/null @@ -1,18 +0,0 @@ -pub struct Foo { - x: T, -} - -pub trait Bar { - type Fuu; - - fn foo(foo: Self::Fuu); -} - -// @has doc_assoc_item/struct.Foo.html '//*[@class="impl"]' 'impl> Foo' -impl> Foo { - pub fn new(t: T) -> Foo { - Foo { - x: t, - } - } -} diff --git a/src/test/rustdoc/doc-cfg-target-feature.rs b/src/test/rustdoc/doc-cfg-target-feature.rs deleted file mode 100644 index f1b000dc82362..0000000000000 --- a/src/test/rustdoc/doc-cfg-target-feature.rs +++ /dev/null @@ -1,21 +0,0 @@ -// only-x86_64 -// compile-flags:--test -// should-fail -// no-system-llvm - -// #49723: rustdoc didn't add target features when extracting or running doctests - -#![feature(doc_cfg)] - -/// Foo -/// -/// # Examples -/// -/// ``` -/// #![feature(cfg_target_feature)] -/// -/// #[cfg(target_feature = "sse")] -/// assert!(false); -/// ``` -#[doc(cfg(target_feature = "sse"))] -pub unsafe fn foo() {} diff --git a/src/test/rustdoc/doc-cfg.rs b/src/test/rustdoc/doc-cfg.rs deleted file mode 100644 index aa407b7e92618..0000000000000 --- a/src/test/rustdoc/doc-cfg.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![feature(doc_cfg)] -#![feature(target_feature, cfg_target_feature)] - -// @has doc_cfg/struct.Portable.html -// @!has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' '' -// @has - '//*[@id="method.unix_and_arm_only_function"]' 'fn unix_and_arm_only_function()' -// @has - '//*[@class="stab portability"]' 'This is supported on Unix and ARM only.' -pub struct Portable; - -// @has doc_cfg/unix_only/index.html \ -// '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \ -// 'This is supported on Unix only.' -// @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\AUnix\Z' -// @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\AUnix and ARM\Z' -// @count - '//*[@class="stab portability"]' 3 -#[doc(cfg(unix))] -pub mod unix_only { - // @has doc_cfg/unix_only/fn.unix_only_function.html \ - // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \ - // 'This is supported on Unix only.' - // @count - '//*[@class="stab portability"]' 1 - pub fn unix_only_function() { - content::should::be::irrelevant(); - } - - // @has doc_cfg/unix_only/trait.ArmOnly.html \ - // '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \ - // 'This is supported on Unix and ARM only.' - // @count - '//*[@class="stab portability"]' 3 - #[doc(cfg(target_arch = "arm"))] - pub trait ArmOnly { - fn unix_and_arm_only_function(); - } - - impl ArmOnly for super::Portable { - fn unix_and_arm_only_function() {} - } -} - -// tagging a function with `#[target_feature]` creates a doc(cfg(target_feature)) node for that -// item as well - -// the portability header is different on the module view versus the full view -// @has doc_cfg/index.html -// @matches - '//*[@class="module-item"]//*[@class="stab portability"]' '\Aavx\Z' - -// @has doc_cfg/fn.uses_target_feature.html -// @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \ -// 'This is supported with target feature avx only.' -#[target_feature(enable = "avx")] -pub unsafe fn uses_target_feature() { - content::should::be::irrelevant(); -} - -// @has doc_cfg/fn.uses_cfg_target_feature.html -// @has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' \ -// 'This is supported with target feature avx only.' -#[doc(cfg(target_feature = "avx"))] -pub fn uses_cfg_target_feature() { - uses_target_feature(); -} diff --git a/src/test/rustdoc/doc-proc-macro.rs b/src/test/rustdoc/doc-proc-macro.rs deleted file mode 100644 index 19172ffa41deb..0000000000000 --- a/src/test/rustdoc/doc-proc-macro.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Issue #52129: ICE when trying to document the `quote` proc-macro from proc_macro - -// As of this writing, we don't currently attempt to document proc-macros. However, we shouldn't -// crash when we try. - -extern crate proc_macro; - -pub use proc_macro::*; diff --git a/src/test/rustdoc/doc-spotlight.rs b/src/test/rustdoc/doc-spotlight.rs deleted file mode 100644 index ddd46c3c2155f..0000000000000 --- a/src/test/rustdoc/doc-spotlight.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![feature(doc_spotlight)] - -pub struct Wrapper { - inner: T, -} - -impl SomeTrait for Wrapper {} - -#[doc(spotlight)] -pub trait SomeTrait { - // @has doc_spotlight/trait.SomeTrait.html - // @has - '//code[@class="content"]' 'impl SomeTrait for Wrapper' - fn wrap_me(self) -> Wrapper where Self: Sized { - Wrapper { - inner: self, - } - } -} - -pub struct SomeStruct; -impl SomeTrait for SomeStruct {} - -impl SomeStruct { - // @has doc_spotlight/struct.SomeStruct.html - // @has - '//code[@class="content"]' 'impl SomeTrait for SomeStruct' - // @has - '//code[@class="content"]' 'impl SomeTrait for Wrapper' - pub fn new() -> SomeStruct { - SomeStruct - } -} - -// @has doc_spotlight/fn.bare_fn.html -// @has - '//code[@class="content"]' 'impl SomeTrait for SomeStruct' -pub fn bare_fn() -> SomeStruct { - SomeStruct -} diff --git a/src/test/rustdoc/doctest-manual-crate-name.rs b/src/test/rustdoc/doctest-manual-crate-name.rs deleted file mode 100644 index 3a5e3734e140d..0000000000000 --- a/src/test/rustdoc/doctest-manual-crate-name.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags:--test - -//! ``` -//! #![crate_name="asdf"] -//! -//! println!("yo"); -//! ``` diff --git a/src/test/rustdoc/dont-show-const-contents.rs b/src/test/rustdoc/dont-show-const-contents.rs deleted file mode 100644 index 656d579e4f3bc..0000000000000 --- a/src/test/rustdoc/dont-show-const-contents.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Test that the contents of constants are not displayed as part of the -// documentation. - -// @!has dont_show_const_contents/constant.CONST_S.html 'dont show this' -pub const CONST_S: &'static str = "dont show this"; diff --git a/src/test/rustdoc/double-quote-escape.rs b/src/test/rustdoc/double-quote-escape.rs deleted file mode 100644 index 243d8ad7965b8..0000000000000 --- a/src/test/rustdoc/double-quote-escape.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -pub trait Foo { - fn foo() {} -} - -pub struct Bar; - -// @has foo/struct.Bar.html -// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo%3Cunsafe%20extern%20%22C%22%20fn()%3E"]' 'Foo' -impl Foo for Bar {} diff --git a/src/test/rustdoc/duplicate_impls/impls.rs b/src/test/rustdoc/duplicate_impls/impls.rs deleted file mode 100644 index 6875ad2726d32..0000000000000 --- a/src/test/rustdoc/duplicate_impls/impls.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub struct Foo; - -// just so that `Foo` doesn't show up on `Bar`s sidebar -pub mod bar { - pub trait Bar {} -} - -impl Foo { - pub fn new() -> Foo { Foo } -} - -impl bar::Bar for Foo {} diff --git a/src/test/rustdoc/duplicate_impls/issue-33054.rs b/src/test/rustdoc/duplicate_impls/issue-33054.rs deleted file mode 100644 index 3f7cec1856331..0000000000000 --- a/src/test/rustdoc/duplicate_impls/issue-33054.rs +++ /dev/null @@ -1,12 +0,0 @@ -// @has issue_33054/impls/struct.Foo.html -// @has - '//code' 'impl Foo' -// @has - '//code' 'impl Bar for Foo' -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1 -// @count - '//*[@id="main"]/*[@class="impl"]' 1 -// @has issue_33054/impls/bar/trait.Bar.html -// @has - '//code' 'impl Bar for Foo' -// @count - '//*[@class="struct"]' 1 -pub mod impls; - -#[doc(inline)] -pub use impls as impls2; diff --git a/src/test/rustdoc/edition-doctest.rs b/src/test/rustdoc/edition-doctest.rs deleted file mode 100644 index 6de25996bedd6..0000000000000 --- a/src/test/rustdoc/edition-doctest.rs +++ /dev/null @@ -1,44 +0,0 @@ -// compile-flags:--test - -/// ```rust,edition2018 -/// #![feature(try_blocks)] -/// -/// use std::num::ParseIntError; -/// -/// let result: Result = try { -/// "1".parse::()? -/// + "2".parse::()? -/// + "3".parse::()? -/// }; -/// assert_eq!(result, Ok(6)); -/// -/// let result: Result = try { -/// "1".parse::()? -/// + "foo".parse::()? -/// + "3".parse::()? -/// }; -/// assert!(result.is_err()); -/// ``` - - -/// ```rust,edition2015,compile_fail,E0574 -/// #![feature(try_blocks)] -/// -/// use std::num::ParseIntError; -/// -/// let result: Result = try { -/// "1".parse::()? -/// + "2".parse::()? -/// + "3".parse::()? -/// }; -/// assert_eq!(result, Ok(6)); -/// -/// let result: Result = try { -/// "1".parse::()? -/// + "foo".parse::()? -/// + "3".parse::()? -/// }; -/// assert!(result.is_err()); -/// ``` - -pub fn foo() {} diff --git a/src/test/rustdoc/edition-flag.rs b/src/test/rustdoc/edition-flag.rs deleted file mode 100644 index 5571245f28ddb..0000000000000 --- a/src/test/rustdoc/edition-flag.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--test -Z unstable-options -// edition:2018 - -#![feature(async_await)] - -/// ```rust -/// #![feature(async_await)] -/// fn main() { -/// let _ = async { }; -/// } -/// ``` -fn main() { - let _ = async { }; -} diff --git a/src/test/rustdoc/empty-mod-private.rs b/src/test/rustdoc/empty-mod-private.rs deleted file mode 100644 index c2a98049a48cb..0000000000000 --- a/src/test/rustdoc/empty-mod-private.rs +++ /dev/null @@ -1,16 +0,0 @@ -// compile-flags: --document-private-items - -// @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo' -// @has 'empty_mod_private/sidebar-items.js' 'foo' -// @matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo' -mod foo {} - -// @has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar' -// @has 'empty_mod_private/sidebar-items.js' 'bar' -// @matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar' -mod bar { - // @has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz' - // @has 'empty_mod_private/bar/sidebar-items.js' 'baz' - // @matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz' - mod baz {} -} diff --git a/src/test/rustdoc/empty-mod-public.rs b/src/test/rustdoc/empty-mod-public.rs deleted file mode 100644 index d097fcf839cba..0000000000000 --- a/src/test/rustdoc/empty-mod-public.rs +++ /dev/null @@ -1,14 +0,0 @@ -// @has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo' -// @has 'empty_mod_public/sidebar-items.js' 'foo' -// @matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo' -pub mod foo {} - -// @has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar' -// @has 'empty_mod_public/sidebar-items.js' 'bar' -// @matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar' -pub mod bar { - // @has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz' - // @has 'empty_mod_public/bar/sidebar-items.js' 'baz' - // @matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz' - pub mod baz {} -} diff --git a/src/test/rustdoc/empty-section.rs b/src/test/rustdoc/empty-section.rs deleted file mode 100644 index 619f2d688a1b0..0000000000000 --- a/src/test/rustdoc/empty-section.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_name = "foo"] - -#![feature(optin_builtin_traits)] - -pub struct Foo; - -// @has foo/struct.Foo.html -// @!has - 'Auto Trait Implementations' -impl !Send for Foo {} -impl !Sync for Foo {} diff --git a/src/test/rustdoc/escape-deref-methods.rs b/src/test/rustdoc/escape-deref-methods.rs deleted file mode 100644 index a62ad2c400173..0000000000000 --- a/src/test/rustdoc/escape-deref-methods.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![crate_name = "foo"] - -use std::ops::{Deref, DerefMut}; - -#[derive(Debug, Clone)] -pub struct Title { - name: String, -} - -#[derive(Debug, Clone)] -pub struct TitleList { - pub members: Vec, -} - -impl TitleList { - pub fn new() -> Self { - TitleList { members: Vec::new() } - } -} - -impl Deref for TitleList { - type Target = Vec<Title>; - - fn deref(&self) -> &Self::Target { - &self.members - } -} - -// @has foo/struct.TitleList.html -// @has - '//*[@class="sidebar-title"]' 'Methods from Deref<Target=Vec<Title>>' -impl DerefMut for TitleList { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.members - } -} diff --git a/src/test/rustdoc/extern-default-method.rs b/src/test/rustdoc/extern-default-method.rs deleted file mode 100644 index 810c591c53e1e..0000000000000 --- a/src/test/rustdoc/extern-default-method.rs +++ /dev/null @@ -1,7 +0,0 @@ -// aux-build:rustdoc-extern-default-method.rs -// ignore-cross-compile - -extern crate rustdoc_extern_default_method as ext; - -// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1 -pub use ext::Struct; diff --git a/src/test/rustdoc/extern-html-root-url.rs b/src/test/rustdoc/extern-html-root-url.rs deleted file mode 100644 index 60b7b28ae4acf..0000000000000 --- a/src/test/rustdoc/extern-html-root-url.rs +++ /dev/null @@ -1,6 +0,0 @@ -// compile-flags:-Z unstable-options --extern-html-root-url core=https://example.com/core/0.1.0 - -// @has extern_html_root_url/index.html -// @has - '//a/@href' 'https://example.com/core/0.1.0/core/iter/index.html' -#[doc(no_inline)] -pub use std::iter; diff --git a/src/test/rustdoc/extern-impl-trait.rs b/src/test/rustdoc/extern-impl-trait.rs deleted file mode 100644 index 58bd650feb466..0000000000000 --- a/src/test/rustdoc/extern-impl-trait.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:extern-impl-trait.rs - -#![crate_name = "foo"] - -extern crate extern_impl_trait; - -// @has 'foo/struct.X.html' '//code' "impl Foo<Associated = ()> + 'a" -pub use extern_impl_trait::X; - -// @has 'foo/struct.Y.html' '//code' "impl ?Sized + Foo<Associated = ()> + 'a" -pub use extern_impl_trait::Y; diff --git a/src/test/rustdoc/extern-impl.rs b/src/test/rustdoc/extern-impl.rs deleted file mode 100644 index f68e10a4d092c..0000000000000 --- a/src/test/rustdoc/extern-impl.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/struct.Foo.html -pub struct Foo; - -impl Foo { - // @has - '//code' 'fn rust0()' - pub fn rust0() {} - // @has - '//code' 'fn rust1()' - pub extern "Rust" fn rust1() {} - // @has - '//code' 'extern "C" fn c0()' - pub extern fn c0() {} - // @has - '//code' 'extern "C" fn c1()' - pub extern "C" fn c1() {} - // @has - '//code' 'extern "system" fn system0()' - pub extern "system" fn system0() {} -} - -// @has foo/trait.Bar.html -pub trait Bar {} - -// @has - '//code' 'impl Bar for fn()' -impl Bar for fn() {} -// @has - '//code' 'impl Bar for extern "C" fn()' -impl Bar for extern fn() {} -// @has - '//code' 'impl Bar for extern "system" fn()' -impl Bar for extern "system" fn() {} diff --git a/src/test/rustdoc/extern-links.rs b/src/test/rustdoc/extern-links.rs deleted file mode 100644 index 991f869138d93..0000000000000 --- a/src/test/rustdoc/extern-links.rs +++ /dev/null @@ -1,21 +0,0 @@ -// aux-build:extern-links.rs -// ignore-cross-compile - -#![crate_name = "foo"] - -extern crate extern_links; - -// @!has foo/index.html '//a' 'extern_links' -#[doc(no_inline)] -pub use extern_links as extern_links2; - -// @!has foo/index.html '//a' 'Foo' -#[doc(no_inline)] -pub use extern_links::Foo; - -#[doc(hidden)] -pub mod hidden { - // @!has foo/hidden/extern_links/index.html - // @!has foo/hidden/extern_links/struct.Foo.html - pub use extern_links; -} diff --git a/src/test/rustdoc/extern-method.rs b/src/test/rustdoc/extern-method.rs deleted file mode 100644 index 7fbe5fe43274d..0000000000000 --- a/src/test/rustdoc/extern-method.rs +++ /dev/null @@ -1,19 +0,0 @@ -// aux-build:rustdoc-extern-method.rs -// ignore-cross-compile - -#![feature(unboxed_closures)] - -extern crate rustdoc_extern_method as foo; - -// @has extern_method/trait.Foo.html //pre "pub trait Foo" -// @has - '//*[@id="tymethod.foo"]//code' 'extern "rust-call" fn foo' -// @has - '//*[@id="method.foo_"]//code' 'extern "rust-call" fn foo_' -pub use foo::Foo; - -// @has extern_method/trait.Bar.html //pre "pub trait Bar" -pub trait Bar { - // @has - '//*[@id="tymethod.bar"]//code' 'extern "rust-call" fn bar' - extern "rust-call" fn bar(&self, _: ()); - // @has - '//*[@id="method.bar_"]//code' 'extern "rust-call" fn bar_' - extern "rust-call" fn bar_(&self, _: ()) { } -} diff --git a/src/test/rustdoc/external-cross.rs b/src/test/rustdoc/external-cross.rs deleted file mode 100644 index 056ed3534624b..0000000000000 --- a/src/test/rustdoc/external-cross.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:external-cross.rs -// ignore-cross-compile - -#![crate_name="host"] - -extern crate external_cross; - -// @has host/struct.NeedMoreDocs.html -// @has - '//h1' 'Cross-crate imported docs' -pub use external_cross::NeedMoreDocs; diff --git a/src/test/rustdoc/external-doc.rs b/src/test/rustdoc/external-doc.rs deleted file mode 100644 index 4a13f4069c40a..0000000000000 --- a/src/test/rustdoc/external-doc.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(external_doc)] - -// @has external_doc/struct.CanHasDocs.html -// @has - '//h1' 'External Docs' -// @has - '//h2' 'Inline Docs' -#[doc(include = "auxiliary/external-doc.md")] -/// ## Inline Docs -pub struct CanHasDocs; diff --git a/src/test/rustdoc/ffi.rs b/src/test/rustdoc/ffi.rs deleted file mode 100644 index 8140dfc723c75..0000000000000 --- a/src/test/rustdoc/ffi.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:rustdoc-ffi.rs -// ignore-cross-compile - -extern crate rustdoc_ffi as lib; - -// @has ffi/fn.foreigner.html //pre 'pub unsafe extern "C" fn foreigner(cold_as_ice: u32)' -pub use lib::foreigner; - -extern "C" { - // @has ffi/fn.another.html //pre 'pub unsafe extern "C" fn another(cold_as_ice: u32)' - pub fn another(cold_as_ice: u32); -} diff --git a/src/test/rustdoc/fn-pointer-arg-name.rs b/src/test/rustdoc/fn-pointer-arg-name.rs deleted file mode 100644 index 4293d849df52c..0000000000000 --- a/src/test/rustdoc/fn-pointer-arg-name.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.f.html -// @has - '//*[@class="rust fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))' -pub fn f(callback: fn(len: usize, foo: u32)) {} diff --git a/src/test/rustdoc/fn-sidebar.rs b/src/test/rustdoc/fn-sidebar.rs deleted file mode 100644 index 2fe8ebec1c580..0000000000000 --- a/src/test/rustdoc/fn-sidebar.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.bar.html -// @has - '//*[@class="sidebar-elems"]' '' -pub fn bar() {} - -// @has foo/constant.BAR.html -// @has - '//*[@class="sidebar-elems"]' '' -pub const BAR: u32 = 0; diff --git a/src/test/rustdoc/force-target-feature.rs b/src/test/rustdoc/force-target-feature.rs deleted file mode 100644 index b6c10e8341b43..0000000000000 --- a/src/test/rustdoc/force-target-feature.rs +++ /dev/null @@ -1,11 +0,0 @@ -// only-x86_64 -// compile-flags:--test -C target-feature=+avx -// should-fail - -/// (written on a spider's web) Some Struct -/// -/// ``` -/// panic!("oh no"); -/// ``` -#[doc(cfg(target_feature = "avx"))] -pub struct SomeStruct; diff --git a/src/test/rustdoc/foreigntype-reexport.rs b/src/test/rustdoc/foreigntype-reexport.rs deleted file mode 100644 index 616826ce7b4a8..0000000000000 --- a/src/test/rustdoc/foreigntype-reexport.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![feature(extern_types)] - -mod sub { - extern { - /// Another extern type. - pub type C2; - pub fn f2(); - pub static K: usize; - } -} - -pub mod sub2 { - extern { - // @has foreigntype_reexport/sub2/foreigntype.C.html - pub type C; - // @has foreigntype_reexport/sub2/fn.f.html - pub fn f(); - // @has foreigntype_reexport/sub2/static.K3.html - pub static K3: usize; - } -} - -mod sub3 { - extern { - pub type C4; - pub fn f4(); - pub static K4: usize; - type X4; - } -} - -// @has foreigntype_reexport/foreigntype.C2.html -// @has foreigntype_reexport/fn.f2.html -// @has foreigntype_reexport/static.K2.html -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C2' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f2' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K2' -pub use self::sub::{C2, f2, K as K2}; - -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K3' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::C as C3;' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::f as f3;' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::K3;' -pub use self::sub2::{C as C3, f as f3, K3}; - -// @has foreigntype_reexport/foreigntype.C4.html -// @has foreigntype_reexport/fn.f4.html -// @has foreigntype_reexport/static.K4.html -// @!has foreigntype_reexport/foreigntype.X4.html -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C4' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f4' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K4' -// @!has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'X4' -pub use self::sub3::*; diff --git a/src/test/rustdoc/foreigntype.rs b/src/test/rustdoc/foreigntype.rs deleted file mode 100644 index bd8766c0cf13a..0000000000000 --- a/src/test/rustdoc/foreigntype.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![feature(extern_types)] - -extern { - // @has foreigntype/foreigntype.ExtType.html - pub type ExtType; -} - -impl ExtType { - // @has - '//a[@class="fnname"]' 'do_something' - pub fn do_something(&self) {} -} - -pub trait Trait {} - -// @has foreigntype/trait.Trait.html '//a[@class="foreigntype"]' 'ExtType' -impl Trait for ExtType {} - -// @has foreigntype/index.html '//a[@class="foreigntype"]' 'ExtType' diff --git a/src/test/rustdoc/generic-impl.rs b/src/test/rustdoc/generic-impl.rs deleted file mode 100644 index 03a4d19749967..0000000000000 --- a/src/test/rustdoc/generic-impl.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![crate_name = "foo"] - -use std::fmt; - -// @!has foo/struct.Bar.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' -pub struct Bar; - -// @has foo/struct.Foo.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' -pub struct Foo; -// @has foo/struct.Foo.html '//div[@class="sidebar-links"]/a[@href="#impl-ToString"]' 'ToString' - -impl fmt::Display for Foo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Foo") - } -} diff --git a/src/test/rustdoc/hidden-impls.rs b/src/test/rustdoc/hidden-impls.rs deleted file mode 100644 index 935bfb268637f..0000000000000 --- a/src/test/rustdoc/hidden-impls.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![crate_name = "foo"] - -mod hidden { - #[derive(Clone)] - pub struct Foo; -} - -#[doc(hidden)] -pub mod __hidden { - pub use hidden::Foo; -} - -// @has foo/trait.Clone.html -// @!has - 'Foo' -// @has implementors/foo/trait.Clone.js -// @!has - 'Foo' -pub use std::clone::Clone; diff --git a/src/test/rustdoc/hidden-line.rs b/src/test/rustdoc/hidden-line.rs deleted file mode 100644 index f2f6173d26db9..0000000000000 --- a/src/test/rustdoc/hidden-line.rs +++ /dev/null @@ -1,19 +0,0 @@ -/// The '# ' lines should be removed from the output, but the #[derive] should be -/// retained. -/// -/// ```rust -/// # #[derive(PartialEq)] // invisible -/// # struct Foo; // invisible -/// -/// #[derive(PartialEq)] // Bar -/// struct Bar(Foo); -/// -/// fn test() { -/// let x = Bar(Foo); -/// assert_eq!(x, x); // check that the derivings worked -/// } -/// ``` -pub fn foo() {} - -// @!has hidden_line/fn.foo.html invisible -// @matches - //pre "#\[derive\(PartialEq\)\] // Bar" diff --git a/src/test/rustdoc/hidden-methods.rs b/src/test/rustdoc/hidden-methods.rs deleted file mode 100644 index 27181d489f59d..0000000000000 --- a/src/test/rustdoc/hidden-methods.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![crate_name = "foo"] - -#[doc(hidden)] -pub mod hidden { - pub struct Foo; - - impl Foo { - #[doc(hidden)] - pub fn this_should_be_hidden() {} - } - - pub struct Bar; - - impl Bar { - fn this_should_be_hidden() {} - } -} - -// @has foo/struct.Foo.html -// @!has - 'Methods' -// @!has - '//code' 'impl Foo' -// @!has - 'this_should_be_hidden' -pub use hidden::Foo; - -// @has foo/struct.Bar.html -// @!has - 'Methods' -// @!has - '//code' 'impl Bar' -// @!has - 'this_should_be_hidden' -pub use hidden::Bar; diff --git a/src/test/rustdoc/hidden-trait-struct-impls.rs b/src/test/rustdoc/hidden-trait-struct-impls.rs deleted file mode 100644 index 1be956ef39308..0000000000000 --- a/src/test/rustdoc/hidden-trait-struct-impls.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![crate_name = "foo"] - -#[doc(hidden)] -pub trait Foo {} - -trait Dark {} - -pub trait Bam {} - -pub struct Bar; - -struct Hidden; - -// @!has foo/struct.Bar.html '//*[@id="impl-Foo"]' 'impl Foo for Bar' -impl Foo for Bar {} -// @!has foo/struct.Bar.html '//*[@id="impl-Dark"]' 'impl Dark for Bar' -impl Dark for Bar {} -// @has foo/struct.Bar.html '//*[@id="impl-Bam"]' 'impl Bam for Bar' -// @has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Bar' -impl Bam for Bar {} -// @!has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Hidden' -impl Bam for Hidden {} diff --git a/src/test/rustdoc/impl-disambiguation.rs b/src/test/rustdoc/impl-disambiguation.rs deleted file mode 100644 index 9f55318563937..0000000000000 --- a/src/test/rustdoc/impl-disambiguation.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![crate_name = "foo"] - -pub trait Foo {} - -pub struct Bar<T> { field: T } - -// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \ -// "impl Foo for Bar<u8>" -impl Foo for Bar<u8> {} -// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \ -// "impl Foo for Bar<u16>" -impl Foo for Bar<u16> {} -// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \ -// "impl<'a> Foo for &'a Bar<u8>" -impl<'a> Foo for &'a Bar<u8> {} - -pub mod mod1 { - pub struct Baz {} -} - -pub mod mod2 { - pub enum Baz {} -} - -// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \ -// "impl Foo for foo::mod1::Baz" -impl Foo for mod1::Baz {} -// @has foo/trait.Foo.html '//*[@class="item-list"]//code' \ -// "impl<'a> Foo for &'a foo::mod2::Baz" -impl<'a> Foo for &'a mod2::Baz {} diff --git a/src/test/rustdoc/impl-everywhere.rs b/src/test/rustdoc/impl-everywhere.rs deleted file mode 100644 index 9d86dd3c29e98..0000000000000 --- a/src/test/rustdoc/impl-everywhere.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![crate_name = "foo"] - -pub trait Foo {} -pub trait Foo2 {} - -pub struct Bar; - -impl Foo for Bar {} -impl Foo2 for Bar {} - -// @!has foo/fn.foo.html '//section[@id="main"]//pre' "x: &\'x impl Foo" -// @!has foo/fn.foo.html '//section[@id="main"]//pre' "-> &\'x impl Foo {" -pub fn foo<'x>(x: &'x impl Foo) -> &'x impl Foo { - x -} - -// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &\'x impl Foo" -// @!has foo/fn.foo2.html '//section[@id="main"]//pre' '-> impl Foo2 {' -pub fn foo2<'x>(_x: &'x impl Foo) -> impl Foo2 { - Bar -} - -// @!has foo/fn.foo_foo.html '//section[@id="main"]//pre' '-> impl Foo + Foo2 {' -pub fn foo_foo() -> impl Foo + Foo2 { - Bar -} - -// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &'x (impl Foo + Foo2)" -pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) { -} diff --git a/src/test/rustdoc/impl-parts-crosscrate.rs b/src/test/rustdoc/impl-parts-crosscrate.rs deleted file mode 100644 index f9583d1a72296..0000000000000 --- a/src/test/rustdoc/impl-parts-crosscrate.rs +++ /dev/null @@ -1,20 +0,0 @@ -// aux-build:rustdoc-impl-parts-crosscrate.rs -// ignore-cross-compile - -#![feature(optin_builtin_traits)] - -extern crate rustdoc_impl_parts_crosscrate; - -pub struct Bar<T> { t: T } - -// The output file is html embedded in javascript, so the html tags -// aren't stripped by the processing script and we can't check for the -// full impl string. Instead, just make sure something from each part -// is mentioned. - -// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnOibit.js Bar -// @has - Send -// @has - !AnOibit -// @has - Copy -impl<T: Send> !rustdoc_impl_parts_crosscrate::AnOibit for Bar<T> - where T: Copy {} diff --git a/src/test/rustdoc/impl-parts.rs b/src/test/rustdoc/impl-parts.rs deleted file mode 100644 index fbb4e725481c0..0000000000000 --- a/src/test/rustdoc/impl-parts.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(optin_builtin_traits)] - -pub auto trait AnOibit {} - -pub struct Foo<T> { field: T } - -// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \ -// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync," -// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \ -// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync," -impl<T: Clone> !AnOibit for Foo<T> where T: Sync {} diff --git a/src/test/rustdoc/index-page.rs b/src/test/rustdoc/index-page.rs deleted file mode 100644 index f0476f083b8a1..0000000000000 --- a/src/test/rustdoc/index-page.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:all-item-types.rs -// build-aux-docs -// compile-flags: -Z unstable-options --enable-index-page - -#![crate_name = "foo"] - -// @has foo/../index.html -// @has - '//span[@class="in-band"]' 'List of all crates' -// @has - '//ul[@class="mod"]//a[@href="foo/index.html"]' 'foo' -// @has - '//ul[@class="mod"]//a[@href="all_item_types/index.html"]' 'all_item_types' -pub struct Foo; diff --git a/src/test/rustdoc/inline-default-methods.rs b/src/test/rustdoc/inline-default-methods.rs deleted file mode 100644 index c97644e7f8723..0000000000000 --- a/src/test/rustdoc/inline-default-methods.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:inline-default-methods.rs -// ignore-cross-compile - -extern crate inline_default_methods; - -// @has inline_default_methods/trait.Foo.html -// @has - '//*[@class="rust trait"]' 'fn bar(&self);' -// @has - '//*[@class="rust trait"]' 'fn foo(&mut self) { ... }' -pub use inline_default_methods::Foo; diff --git a/src/test/rustdoc/inline_cross/assoc-items.rs b/src/test/rustdoc/inline_cross/assoc-items.rs deleted file mode 100644 index d4f05bab5cabf..0000000000000 --- a/src/test/rustdoc/inline_cross/assoc-items.rs +++ /dev/null @@ -1,42 +0,0 @@ -// aux-build:assoc-items.rs -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "foo"] - -extern crate assoc_items; - -// @has foo/struct.MyStruct.html -// @!has - 'PrivateConst' -// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8' -// @has - '//*[@class="docblock"]' 'docs for PublicConst' -// @!has - 'private_method' -// @has - '//*[@id="method.public_method"]' 'pub fn public_method()' -// @has - '//*[@class="docblock"]' 'docs for public_method' -// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' -// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault' -// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' -// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32' -// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault' -// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32' -// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault' -// @has - '//*[@id="method.method_no_default"]' 'fn method_no_default()' -// @has - '//*[@class="docblock"]' 'dox for method_no_default' -// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' -// @has - '//*[@class="docblock"]' 'docs for method_with_default' -pub use assoc_items::MyStruct; - -// @has foo/trait.MyTrait.html -// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' -// @has - '//*[@class="docblock"]' 'docs for ConstNoDefault' -// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' -// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault' -// @has - '//*[@class="docblock"]' 'docs for TypeNoDefault' -// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault' -// @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()' -// @has - '//*[@class="docblock"]' 'docs for method_no_default' -// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' -// @has - '//*[@class="docblock"]' 'docs for method_with_default' -pub use assoc_items::MyTrait; diff --git a/src/test/rustdoc/inline_cross/auxiliary/assoc-items.rs b/src/test/rustdoc/inline_cross/auxiliary/assoc-items.rs deleted file mode 100644 index 5fa299914f626..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/assoc-items.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![feature(associated_type_defaults)] - -pub struct MyStruct; - -impl MyStruct { - /// docs for PrivateConst - const PrivateConst: i8 = -123; - /// docs for PublicConst - pub const PublicConst: u8 = 123; - /// docs for private_method - fn private_method() {} - /// docs for public_method - pub fn public_method() {} -} - -pub trait MyTrait { - /// docs for ConstNoDefault - const ConstNoDefault: i16; - /// docs for ConstWithDefault - const ConstWithDefault: u16 = 12345; - /// docs for TypeNoDefault - type TypeNoDefault; - /// docs for TypeWithDefault - type TypeWithDefault = u32; - /// docs for method_no_default - fn method_no_default(); - /// docs for method_with_default - fn method_with_default() {} -} - -impl MyTrait for MyStruct { - /// dox for ConstNoDefault - const ConstNoDefault: i16 = -12345; - /// dox for TypeNoDefault - type TypeNoDefault = i32; - /// dox for method_no_default - fn method_no_default() {} -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/cross-glob.rs b/src/test/rustdoc/inline_cross/auxiliary/cross-glob.rs deleted file mode 100644 index cde7f68ff0182..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/cross-glob.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "inner"] - -pub struct SomeStruct; - -pub fn some_fn() {} diff --git a/src/test/rustdoc/inline_cross/auxiliary/default-trait-method.rs b/src/test/rustdoc/inline_cross/auxiliary/default-trait-method.rs deleted file mode 100644 index ce60bbfb4b0de..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/default-trait-method.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(specialization)] - -#![crate_name = "foo"] - -pub trait Item { - fn foo(); - fn bar(); - fn baz() {} -} - -pub struct Foo; - -impl Item for Foo { - default fn foo() {} - fn bar() {} -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs b/src/test/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs deleted file mode 100644 index 401a6a44af9a4..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub trait MyTrait { - /// docs for my_trait_method - fn my_trait_method() {} -} - -pub struct MyStruct; - -impl MyTrait for MyStruct {} diff --git a/src/test/rustdoc/inline_cross/auxiliary/issue-33113.rs b/src/test/rustdoc/inline_cross/auxiliary/issue-33113.rs deleted file mode 100644 index 4e1f1918e2193..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/issue-33113.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_name="bar"] - -pub trait Bar {} -pub struct Foo; - -impl<'a> Bar for &'a char {} -impl Bar for Foo {} diff --git a/src/test/rustdoc/inline_cross/auxiliary/macro-vis.rs b/src/test/rustdoc/inline_cross/auxiliary/macro-vis.rs deleted file mode 100644 index 5615a4fdd3dc8..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/macro-vis.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![crate_name = "qwop"] - -/// (written on a spider's web) Some Macro -#[macro_export] -macro_rules! some_macro { - () => { - println!("this is some macro, for sure"); - }; -} - -/// Some other macro, to fill space. -#[macro_export] -macro_rules! other_macro { - () => { - println!("this is some other macro, whatev"); - }; -} - -/// This macro is so cool, it's Super. -#[macro_export] -macro_rules! super_macro { - () => { - println!("is it a bird? a plane? no, it's Super Macro!"); - }; -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/macros.rs b/src/test/rustdoc/inline_cross/auxiliary/macros.rs deleted file mode 100644 index 6189b018037ea..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/macros.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(staged_api)] - -#![stable(feature = "rust1", since = "1.0.0")] - -/// docs for my_macro -#[unstable(feature = "macro_test", issue = "0")] -#[rustc_deprecated(since = "1.2.3", reason = "text")] -#[macro_export] -macro_rules! my_macro { - () => () -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs b/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs deleted file mode 100644 index c99ef74433358..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs +++ /dev/null @@ -1,27 +0,0 @@ -// force-host -// no-prefer-dynamic - -#![crate_type="proc-macro"] -#![crate_name="some_macros"] - -extern crate proc_macro; - -use proc_macro::TokenStream; - -/// a proc-macro that swallows its input and does nothing. -#[proc_macro] -pub fn some_proc_macro(_input: TokenStream) -> TokenStream { - TokenStream::new() -} - -/// a proc-macro attribute that passes its item through verbatim. -#[proc_macro_attribute] -pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { - item -} - -/// a derive attribute that adds nothing to its input. -#[proc_macro_derive(SomeDerive)] -pub fn some_derive(_item: TokenStream) -> TokenStream { - TokenStream::new() -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/renamed-via-module.rs b/src/test/rustdoc/inline_cross/auxiliary/renamed-via-module.rs deleted file mode 100644 index 2e529078239b0..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/renamed-via-module.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "foo"] - -pub mod iter { - mod range { - pub struct StepBy; - } - pub use self::range::StepBy as DeprecatedStepBy; - pub struct StepBy; -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs b/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs deleted file mode 100644 index 6357b76df0c7a..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub struct Bar; - -impl Bar { - pub fn bar(_: u8) -> hidden::Hidden { - hidden::Hidden - } -} - -#[doc(hidden)] -pub mod hidden { - pub struct Hidden; -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs b/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs deleted file mode 100644 index 0c75b3127cf58..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[doc(hidden)] -pub struct Foo; - -pub struct Bar; diff --git a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs b/src/test/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs deleted file mode 100644 index 4e461d3bc3759..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs +++ /dev/null @@ -1,34 +0,0 @@ -pub struct Foo; - -pub trait Woof {} -pub trait Bark {} - -mod private { - // should be shown - impl ::Woof for ::Foo {} - - pub trait Bar {} - pub struct Wibble; - - // these should not be shown - impl Bar for ::Foo {} - impl Bar for Wibble {} - impl ::Bark for Wibble {} - impl ::Woof for Wibble {} -} - -#[doc(hidden)] -pub mod hidden { - // should be shown - impl ::Bark for ::Foo {} - - pub trait Qux {} - pub struct Wobble; - - - // these should only be shown if they're re-exported correctly - impl Qux for ::Foo {} - impl Qux for Wobble {} - impl ::Bark for Wobble {} - impl ::Woof for Wobble {} -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs b/src/test/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs deleted file mode 100644 index 11d8733c40d12..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::fmt; - -pub trait Bar {} - -impl<'a> Bar + 'a { - pub fn bar(&self) -> usize { 42 } -} - -impl<'a> fmt::Debug for Bar + 'a { - fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { - Ok(()) - } -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/trait-vis.rs b/src/test/rustdoc/inline_cross/auxiliary/trait-vis.rs deleted file mode 100644 index e5bc7969b5c6c..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/trait-vis.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name = "inner"] - -pub struct SomeStruct; - -fn asdf() { - const _FOO: () = { - impl Clone for SomeStruct { - fn clone(&self) -> Self { - SomeStruct - } - } - }; -} diff --git a/src/test/rustdoc/inline_cross/auxiliary/use_crate.rs b/src/test/rustdoc/inline_cross/auxiliary/use_crate.rs deleted file mode 100644 index 75efbe0dbe7a1..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/use_crate.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod asdf { - pub struct SomeStruct; -} - -pub trait SomeTrait {} diff --git a/src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs b/src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs deleted file mode 100644 index 25b4c202efe09..0000000000000 --- a/src/test/rustdoc/inline_cross/auxiliary/use_crate_2.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct SomethingElse; diff --git a/src/test/rustdoc/inline_cross/cross-glob.rs b/src/test/rustdoc/inline_cross/cross-glob.rs deleted file mode 100644 index f97da11a90149..0000000000000 --- a/src/test/rustdoc/inline_cross/cross-glob.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:cross-glob.rs -// build-aux-docs -// ignore-cross-compile - -extern crate inner; - -// @has cross_glob/struct.SomeStruct.html -// @has cross_glob/fn.some_fn.html -// @!has cross_glob/index.html '//code' 'pub use inner::*;' -#[doc(inline)] -pub use inner::*; diff --git a/src/test/rustdoc/inline_cross/default-trait-method.rs b/src/test/rustdoc/inline_cross/default-trait-method.rs deleted file mode 100644 index a4ec73a127d4e..0000000000000 --- a/src/test/rustdoc/inline_cross/default-trait-method.rs +++ /dev/null @@ -1,20 +0,0 @@ -// aux-build:default-trait-method.rs - -extern crate foo; - -// @has default_trait_method/trait.Item.html -// @has - '//*[@id="tymethod.foo"]' 'fn foo()' -// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' -// @has - '//*[@id="tymethod.bar"]' 'fn bar()' -// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' -pub use foo::Item; - -// @has default_trait_method/struct.Foo.html -// @has - '//*[@id="method.foo"]' 'default fn foo()' -// @has - '//*[@id="method.bar"]' 'fn bar()' -// @!has - '//*[@id="method.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' -pub use foo::Foo; diff --git a/src/test/rustdoc/inline_cross/hidden-use.rs b/src/test/rustdoc/inline_cross/hidden-use.rs deleted file mode 100644 index 97715737fd90d..0000000000000 --- a/src/test/rustdoc/inline_cross/hidden-use.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:rustdoc-hidden.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_hidden; - -// @has hidden_use/index.html -// @!has - 'rustdoc_hidden' -// @!has - 'Bar' -// @!has hidden_use/struct.Bar.html -#[doc(hidden)] -pub use rustdoc_hidden::Bar; diff --git a/src/test/rustdoc/inline_cross/impl-inline-without-trait.rs b/src/test/rustdoc/inline_cross/impl-inline-without-trait.rs deleted file mode 100644 index cadeccb60c817..0000000000000 --- a/src/test/rustdoc/inline_cross/impl-inline-without-trait.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:impl-inline-without-trait.rs -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "foo"] - -extern crate impl_inline_without_trait; - -// @has 'foo/struct.MyStruct.html' -// @has - '//*[@id="method.my_trait_method"]' 'fn my_trait_method()' -// @has - '//*[@class="docblock"]' 'docs for my_trait_method' -pub use impl_inline_without_trait::MyStruct; diff --git a/src/test/rustdoc/inline_cross/inline_hidden.rs b/src/test/rustdoc/inline_cross/inline_hidden.rs deleted file mode 100644 index dcceaadb9680e..0000000000000 --- a/src/test/rustdoc/inline_cross/inline_hidden.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:rustdoc-hidden.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_hidden; - -#[doc(no_inline)] -pub use rustdoc_hidden::Foo; - -// @has inline_hidden/fn.foo.html -// @!has - '//a/@title' 'Foo' -pub fn foo(_: Foo) {} diff --git a/src/test/rustdoc/inline_cross/issue-28480.rs b/src/test/rustdoc/inline_cross/issue-28480.rs deleted file mode 100644 index 99f5b90077142..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-28480.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:rustdoc-hidden-sig.rs -// build-aux-docs -// ignore-cross-compile - -// @has rustdoc_hidden_sig/struct.Bar.html -// @!has - '//a/@title' 'Hidden' -// @has - '//a' 'u8' -extern crate rustdoc_hidden_sig; - -// @has issue_28480/struct.Bar.html -// @!has - '//a/@title' 'Hidden' -// @has - '//a' 'u8' -pub use rustdoc_hidden_sig::Bar; diff --git a/src/test/rustdoc/inline_cross/issue-31948-1.rs b/src/test/rustdoc/inline_cross/issue-31948-1.rs deleted file mode 100644 index f47056223fe89..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-31948-1.rs +++ /dev/null @@ -1,27 +0,0 @@ -// aux-build:rustdoc-nonreachable-impls.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -// @has issue_31948_1/struct.Wobble.html -// @has - '//*[@class="impl"]//code' 'Bark for' -// @has - '//*[@class="impl"]//code' 'Woof for' -// @!has - '//*[@class="impl"]//code' 'Bar for' -// @!has - '//*[@class="impl"]//code' 'Qux for' -pub use rustdoc_nonreachable_impls::hidden::Wobble; - -// @has issue_31948_1/trait.Bark.html -// @has - '//code' 'for Foo' -// @has - '//code' 'for Wobble' -// @!has - '//code' 'for Wibble' -pub use rustdoc_nonreachable_impls::Bark; - -// @has issue_31948_1/trait.Woof.html -// @has - '//code' 'for Foo' -// @has - '//code' 'for Wobble' -// @!has - '//code' 'for Wibble' -pub use rustdoc_nonreachable_impls::Woof; - -// @!has issue_31948_1/trait.Bar.html -// @!has issue_31948_1/trait.Qux.html diff --git a/src/test/rustdoc/inline_cross/issue-31948-2.rs b/src/test/rustdoc/inline_cross/issue-31948-2.rs deleted file mode 100644 index 282f0679e9839..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-31948-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// aux-build:rustdoc-nonreachable-impls.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -// @has issue_31948_2/struct.Wobble.html -// @has - '//*[@class="impl"]//code' 'Qux for' -// @has - '//*[@class="impl"]//code' 'Bark for' -// @has - '//*[@class="impl"]//code' 'Woof for' -// @!has - '//*[@class="impl"]//code' 'Bar for' -pub use rustdoc_nonreachable_impls::hidden::Wobble; - -// @has issue_31948_2/trait.Qux.html -// @has - '//code' 'for Foo' -// @has - '//code' 'for Wobble' -pub use rustdoc_nonreachable_impls::hidden::Qux; - -// @!has issue_31948_2/trait.Bar.html -// @!has issue_31948_2/trait.Woof.html -// @!has issue_31948_2/trait.Bark.html diff --git a/src/test/rustdoc/inline_cross/issue-31948.rs b/src/test/rustdoc/inline_cross/issue-31948.rs deleted file mode 100644 index d5725175e3f0a..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-31948.rs +++ /dev/null @@ -1,29 +0,0 @@ -// aux-build:rustdoc-nonreachable-impls.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_nonreachable_impls; - -// @has issue_31948/struct.Foo.html -// @has - '//*[@class="impl"]//code' 'Bark for' -// @has - '//*[@class="impl"]//code' 'Woof for' -// @!has - '//*[@class="impl"]//code' 'Bar for' -// @!has - '//*[@class="impl"]//code' 'Qux for' -pub use rustdoc_nonreachable_impls::Foo; - -// @has issue_31948/trait.Bark.html -// @has - '//code' 'for Foo' -// @!has - '//code' 'for Wibble' -// @!has - '//code' 'for Wobble' -pub use rustdoc_nonreachable_impls::Bark; - -// @has issue_31948/trait.Woof.html -// @has - '//code' 'for Foo' -// @!has - '//code' 'for Wibble' -// @!has - '//code' 'for Wobble' -pub use rustdoc_nonreachable_impls::Woof; - -// @!has issue_31948/trait.Bar.html -// @!has issue_31948/trait.Qux.html -// @!has issue_31948/struct.Wibble.html -// @!has issue_31948/struct.Wobble.html diff --git a/src/test/rustdoc/inline_cross/issue-32881.rs b/src/test/rustdoc/inline_cross/issue-32881.rs deleted file mode 100644 index 5f31e6cd3ad1f..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-32881.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:rustdoc-trait-object-impl.rs -// build-aux-docs -// ignore-cross-compile - -extern crate rustdoc_trait_object_impl; - -// @has issue_32881/trait.Bar.html -// @has - '//code' "impl<'a> dyn Bar" -// @has - '//code' "impl<'a> Debug for dyn Bar" - -pub use rustdoc_trait_object_impl::Bar; diff --git a/src/test/rustdoc/inline_cross/issue-33113.rs b/src/test/rustdoc/inline_cross/issue-33113.rs deleted file mode 100644 index 1e633600aeff1..0000000000000 --- a/src/test/rustdoc/inline_cross/issue-33113.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:issue-33113.rs -// build-aux-docs -// ignore-cross-compile - -extern crate bar; - -// @has issue_33113/trait.Bar.html -// @has - '//code' "for &'a char" -// @has - '//code' "for Foo" -pub use bar::Bar; diff --git a/src/test/rustdoc/inline_cross/macro-vis.rs b/src/test/rustdoc/inline_cross/macro-vis.rs deleted file mode 100644 index 9fefd38ad2c1a..0000000000000 --- a/src/test/rustdoc/inline_cross/macro-vis.rs +++ /dev/null @@ -1,36 +0,0 @@ -// aux-build:macro-vis.rs -// build-aux-docs -// ignore-cross-compile - -#[macro_use] extern crate qwop; - -// @has macro_vis/macro.some_macro.html -// @has macro_vis/index.html '//a/@href' 'macro.some_macro.html' -pub use qwop::some_macro; - -// @has macro_vis/macro.renamed_macro.html -// @!has - '//pre' 'some_macro' -// @has macro_vis/index.html '//a/@href' 'macro.renamed_macro.html' -#[doc(inline)] -pub use qwop::some_macro as renamed_macro; - -// @!has macro_vis/macro.other_macro.html -// @!has macro_vis/index.html '//a/@href' 'macro.other_macro.html' -// @!has - '//code' 'pub use qwop::other_macro;' -#[doc(hidden)] -pub use qwop::other_macro; - -// @has macro_vis/index.html '//code' 'pub use qwop::super_macro;' -// @!has macro_vis/macro.super_macro.html -#[doc(no_inline)] -pub use qwop::super_macro; - -// @has macro_vis/macro.this_is_dope.html -// @has macro_vis/index.html '//a/@href' 'macro.this_is_dope.html' -/// What it says on the tin. -#[macro_export] -macro_rules! this_is_dope { - () => { - println!("yo check this out"); - }; -} diff --git a/src/test/rustdoc/inline_cross/macros.rs b/src/test/rustdoc/inline_cross/macros.rs deleted file mode 100644 index f9bf982659e02..0000000000000 --- a/src/test/rustdoc/inline_cross/macros.rs +++ /dev/null @@ -1,18 +0,0 @@ -// aux-build:macros.rs -// build-aux-docs - -#![feature(macro_test)] - -#![crate_name = "foo"] - -extern crate macros; - -// @has foo/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' Deprecated -// @has - '//*[@class="docblock-short"]/span[@class="stab unstable"]' Experimental - -// @has foo/macro.my_macro.html -// @has - '//*[@class="docblock"]' 'docs for my_macro' -// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' -// @has - '//*[@class="stab unstable"]' 'macro_test' -// @has - '//a/@href' '../src/macros/macros.rs.html#9-11' -pub use macros::my_macro; diff --git a/src/test/rustdoc/inline_cross/proc_macro.rs b/src/test/rustdoc/inline_cross/proc_macro.rs deleted file mode 100644 index e1cdcf4940244..0000000000000 --- a/src/test/rustdoc/inline_cross/proc_macro.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:proc_macro.rs -// build-aux-docs - -// FIXME: if/when proc-macros start exporting their doc attributes across crates, we can turn on -// cross-crate inlining for them - -extern crate some_macros; - -// @has proc_macro/index.html -// @has - '//a/@href' '../some_macros/macro.some_proc_macro.html' -// @has - '//a/@href' '../some_macros/attr.some_proc_attr.html' -// @has - '//a/@href' '../some_macros/derive.SomeDerive.html' -// @!has proc_macro/macro.some_proc_macro.html -// @!has proc_macro/attr.some_proc_attr.html -// @!has proc_macro/derive.SomeDerive.html -pub use some_macros::{some_proc_macro, some_proc_attr, SomeDerive}; diff --git a/src/test/rustdoc/inline_cross/renamed-via-module.rs b/src/test/rustdoc/inline_cross/renamed-via-module.rs deleted file mode 100644 index cdedbf0707985..0000000000000 --- a/src/test/rustdoc/inline_cross/renamed-via-module.rs +++ /dev/null @@ -1,24 +0,0 @@ -// aux-build:renamed-via-module.rs -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "bar"] - -extern crate foo; - -// @has foo/iter/index.html -// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" -// @has - '//a/[@href="struct.StepBy.html"]' "StepBy" -// @has foo/iter/struct.DeprecatedStepBy.html -// @has - '//h1' "Struct foo::iter::DeprecatedStepBy" -// @has foo/iter/struct.StepBy.html -// @has - '//h1' "Struct foo::iter::StepBy" - -// @has bar/iter/index.html -// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" -// @has - '//a/[@href="struct.StepBy.html"]' "StepBy" -// @has bar/iter/struct.DeprecatedStepBy.html -// @has - '//h1' "Struct bar::iter::DeprecatedStepBy" -// @has bar/iter/struct.StepBy.html -// @has - '//h1' "Struct bar::iter::StepBy" -pub use foo::iter; diff --git a/src/test/rustdoc/inline_cross/trait-vis.rs b/src/test/rustdoc/inline_cross/trait-vis.rs deleted file mode 100644 index e6585449cb64e..0000000000000 --- a/src/test/rustdoc/inline_cross/trait-vis.rs +++ /dev/null @@ -1,7 +0,0 @@ -// aux-build:trait-vis.rs - -extern crate inner; - -// @has trait_vis/struct.SomeStruct.html -// @has - '//code' 'impl Clone for SomeStruct' -pub use inner::SomeStruct; diff --git a/src/test/rustdoc/inline_cross/use_crate.rs b/src/test/rustdoc/inline_cross/use_crate.rs deleted file mode 100644 index f678ba0a46c0d..0000000000000 --- a/src/test/rustdoc/inline_cross/use_crate.rs +++ /dev/null @@ -1,27 +0,0 @@ -// aux-build:use_crate.rs -// aux-build:use_crate_2.rs -// build-aux-docs -// edition:2018 -// compile-flags:--extern use_crate --extern use_crate_2 -Z unstable-options - -// During the buildup to Rust 2018, rustdoc would eagerly inline `pub use some_crate;` as if it -// were a module, so we changed it to make `pub use`ing crate roots remain as a `pub use` statement -// in docs... unless you added `#[doc(inline)]`. - -#![crate_name = "local"] - -// @!has-dir local/use_crate -// @has local/index.html -// @has - '//code' 'pub use use_crate' -pub use use_crate; - -// @has-dir local/asdf -// @has local/asdf/index.html -// @has local/index.html '//a/@href' 'asdf/index.html' -pub use use_crate::asdf; - -// @has-dir local/use_crate_2 -// @has local/use_crate_2/index.html -// @has local/index.html '//a/@href' 'use_crate_2/index.html' -#[doc(inline)] -pub use use_crate_2; diff --git a/src/test/rustdoc/inline_local/glob-extern-no-defaults.rs b/src/test/rustdoc/inline_local/glob-extern-no-defaults.rs deleted file mode 100644 index 276e4091c0273..0000000000000 --- a/src/test/rustdoc/inline_local/glob-extern-no-defaults.rs +++ /dev/null @@ -1,25 +0,0 @@ -// compile-flags: --no-defaults - -#![crate_name = "foo"] - -mod mod1 { - extern { - pub fn public_fn(); - fn private_fn(); - } -} - -pub use mod1::*; - -// @has foo/index.html -// @has - "mod1" -// @has - "public_fn" -// @!has - "private_fn" -// @has foo/fn.public_fn.html -// @!has foo/fn.private_fn.html - -// @has foo/mod1/index.html -// @has - "public_fn" -// @has - "private_fn" -// @has foo/mod1/fn.public_fn.html -// @has foo/mod1/fn.private_fn.html diff --git a/src/test/rustdoc/inline_local/glob-extern.rs b/src/test/rustdoc/inline_local/glob-extern.rs deleted file mode 100644 index a23ec3640eea7..0000000000000 --- a/src/test/rustdoc/inline_local/glob-extern.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_name = "foo"] - -mod mod1 { - extern { - pub fn public_fn(); - fn private_fn(); - } -} - -pub use mod1::*; - -// @has foo/index.html -// @!has - "mod1" -// @has - "public_fn" -// @!has - "private_fn" -// @has foo/fn.public_fn.html -// @!has foo/fn.private_fn.html - -// @!has foo/mod1/index.html -// @has foo/mod1/fn.public_fn.html -// @!has foo/mod1/fn.private_fn.html diff --git a/src/test/rustdoc/inline_local/glob-private-no-defaults.rs b/src/test/rustdoc/inline_local/glob-private-no-defaults.rs deleted file mode 100644 index ac854ac4320ab..0000000000000 --- a/src/test/rustdoc/inline_local/glob-private-no-defaults.rs +++ /dev/null @@ -1,48 +0,0 @@ -// compile-flags: --no-defaults - -#![crate_name = "foo"] - -mod mod1 { - mod mod2 { - pub struct Mod2Public; - struct Mod2Private; - } - pub use self::mod2::*; - - pub struct Mod1Public; - struct Mod1Private; -} -pub use mod1::*; - -// @has foo/index.html -// @has - "mod1" -// @has - "Mod1Public" -// @!has - "Mod1Private" -// @!has - "mod2" -// @has - "Mod2Public" -// @!has - "Mod2Private" -// @has foo/struct.Mod1Public.html -// @!has foo/struct.Mod1Private.html -// @has foo/struct.Mod2Public.html -// @!has foo/struct.Mod2Private.html - -// @has foo/mod1/index.html -// @has - "mod2" -// @has - "Mod1Public" -// @has - "Mod1Private" -// @!has - "Mod2Public" -// @!has - "Mod2Private" -// @has foo/mod1/struct.Mod1Public.html -// @has foo/mod1/struct.Mod1Private.html -// @!has foo/mod1/struct.Mod2Public.html -// @!has foo/mod1/struct.Mod2Private.html - -// @has foo/mod1/mod2/index.html -// @has - "Mod2Public" -// @has - "Mod2Private" -// @has foo/mod1/mod2/struct.Mod2Public.html -// @has foo/mod1/mod2/struct.Mod2Private.html - -// @!has foo/mod2/index.html -// @!has foo/mod2/struct.Mod2Public.html -// @!has foo/mod2/struct.Mod2Private.html diff --git a/src/test/rustdoc/inline_local/glob-private.rs b/src/test/rustdoc/inline_local/glob-private.rs deleted file mode 100644 index d294d590e1b62..0000000000000 --- a/src/test/rustdoc/inline_local/glob-private.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![crate_name = "foo"] - -mod mod1 { - mod mod2 { - pub struct Mod2Public; - struct Mod2Private; - } - pub use self::mod2::*; - - pub struct Mod1Public; - struct Mod1Private; -} -pub use mod1::*; - -// @has foo/index.html -// @!has - "mod1" -// @has - "Mod1Public" -// @!has - "Mod1Private" -// @!has - "mod2" -// @has - "Mod2Public" -// @!has - "Mod2Private" -// @has foo/struct.Mod1Public.html -// @!has foo/struct.Mod1Private.html -// @has foo/struct.Mod2Public.html -// @!has foo/struct.Mod2Private.html - -// @has-dir foo/mod1 -// @!has foo/mod1/index.html -// @has foo/mod1/struct.Mod1Public.html -// @!has foo/mod1/struct.Mod1Private.html -// @!has foo/mod1/struct.Mod2Public.html -// @!has foo/mod1/struct.Mod2Private.html - -// @has-dir foo/mod1/mod2 -// @!has foo/mod1/mod2/index.html -// @has foo/mod1/mod2/struct.Mod2Public.html -// @!has foo/mod1/mod2/struct.Mod2Private.html - -// @!has-dir foo/mod2 -// @!has foo/mod2/index.html -// @!has foo/mod2/struct.Mod2Public.html -// @!has foo/mod2/struct.Mod2Private.html diff --git a/src/test/rustdoc/inline_local/hidden-use.rs b/src/test/rustdoc/inline_local/hidden-use.rs deleted file mode 100644 index a972d376aab33..0000000000000 --- a/src/test/rustdoc/inline_local/hidden-use.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod private { - pub struct Foo {} -} - -// @has hidden_use/index.html -// @!has - 'private' -// @!has - 'Foo' -// @!has hidden_use/struct.Foo.html -#[doc(hidden)] -pub use private::Foo; diff --git a/src/test/rustdoc/inline_local/issue-28537.rs b/src/test/rustdoc/inline_local/issue-28537.rs deleted file mode 100644 index da9cc4c940dbe..0000000000000 --- a/src/test/rustdoc/inline_local/issue-28537.rs +++ /dev/null @@ -1,17 +0,0 @@ -#[doc(hidden)] -pub mod foo { - pub struct Foo; -} - -mod bar { - pub use self::bar::Bar; - mod bar { - pub struct Bar; - } -} - -// @has issue_28537/struct.Foo.html -pub use foo::Foo; - -// @has issue_28537/struct.Bar.html -pub use self::bar::Bar; diff --git a/src/test/rustdoc/inline_local/issue-32343.rs b/src/test/rustdoc/inline_local/issue-32343.rs deleted file mode 100644 index 5620ae0dced01..0000000000000 --- a/src/test/rustdoc/inline_local/issue-32343.rs +++ /dev/null @@ -1,23 +0,0 @@ -// @!has issue_32343/struct.Foo.html -// @has issue_32343/index.html -// @has - '//code' 'pub use foo::Foo' -// @!has - '//code/a' 'Foo' -#[doc(no_inline)] -pub use foo::Foo; - -// @!has issue_32343/struct.Bar.html -// @has issue_32343/index.html -// @has - '//code' 'pub use foo::Bar' -// @has - '//code/a' 'Bar' -#[doc(no_inline)] -pub use foo::Bar; - -mod foo { - pub struct Foo; - pub struct Bar; -} - -pub mod bar { - // @has issue_32343/bar/struct.Bar.html - pub use ::foo::Bar; -} diff --git a/src/test/rustdoc/inline_local/macro_by_example.rs b/src/test/rustdoc/inline_local/macro_by_example.rs deleted file mode 100644 index dacc7cfb3cb76..0000000000000 --- a/src/test/rustdoc/inline_local/macro_by_example.rs +++ /dev/null @@ -1,17 +0,0 @@ -/// docs for foo -#[deprecated(since = "1.2.3", note = "text")] -#[macro_export] -macro_rules! foo { - ($($tt:tt)*) => {} -} - -// @has macro_by_example/macros/index.html -pub mod macros { - // @!has - 'pub use foo as bar;' - // @has macro_by_example/macros/macro.bar.html - // @has - '//*[@class="docblock"]' 'docs for foo' - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' - // @has - '//a/@href' 'macro_by_example.rs.html#4-6' - #[doc(inline)] - pub use foo as bar; -} diff --git a/src/test/rustdoc/inline_local/please_inline.rs b/src/test/rustdoc/inline_local/please_inline.rs deleted file mode 100644 index 48539361fbfb5..0000000000000 --- a/src/test/rustdoc/inline_local/please_inline.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub mod foo { - pub struct Foo; -} - -// @has please_inline/a/index.html -pub mod a { - // @!has - 'pub use foo::' - // @has please_inline/a/struct.Foo.html - #[doc(inline)] - pub use foo::Foo; -} - -// @has please_inline/b/index.html -pub mod b { - // @has - 'pub use foo::' - // @!has please_inline/b/struct.Foo.html - #[feature(inline)] - pub use foo::Foo; -} diff --git a/src/test/rustdoc/inline_local/trait-vis.rs b/src/test/rustdoc/inline_local/trait-vis.rs deleted file mode 100644 index a997d1e25f053..0000000000000 --- a/src/test/rustdoc/inline_local/trait-vis.rs +++ /dev/null @@ -1,18 +0,0 @@ -pub trait ThisTrait {} - -mod asdf { - use ThisTrait; - - pub struct SomeStruct; - - impl ThisTrait for SomeStruct {} - - trait PrivateTrait {} - - impl PrivateTrait for SomeStruct {} -} - -// @has trait_vis/struct.SomeStruct.html -// @has - '//code' 'impl ThisTrait for SomeStruct' -// !@has - '//code' 'impl PrivateTrait for SomeStruct' -pub use asdf::SomeStruct; diff --git a/src/test/rustdoc/internal.rs b/src/test/rustdoc/internal.rs deleted file mode 100644 index 2cb7c472cc84b..0000000000000 --- a/src/test/rustdoc/internal.rs +++ /dev/null @@ -1,12 +0,0 @@ -// compile-flags: -Z force-unstable-if-unmarked - -// @matches internal/index.html '//*[@class="docblock-short"]/span[@class="stab internal"]' \ -// 'Internal' -// @matches - '//*[@class="docblock-short"]' 'Docs' - -// @has internal/struct.S.html '//*[@class="stab internal"]' \ -// 'This is an internal compiler API. (rustc_private)' -/// Docs -pub struct S; - -fn main() {} diff --git a/src/test/rustdoc/intra-link-extern-crate.rs b/src/test/rustdoc/intra-link-extern-crate.rs deleted file mode 100644 index bbe3edaea8cb2..0000000000000 --- a/src/test/rustdoc/intra-link-extern-crate.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:intra-link-extern-crate.rs - -// When loading `extern crate` statements, we would pull in their docs at the same time, even -// though they would never actually get displayed. This tripped intra-doc-link resolution failures, -// for items that aren't under our control, and not actually getting documented! - -#![deny(intra_doc_link_resolution_failure)] - -extern crate inner; diff --git a/src/test/rustdoc/intra-link-in-bodies.rs b/src/test/rustdoc/intra-link-in-bodies.rs deleted file mode 100644 index 4c693907226ad..0000000000000 --- a/src/test/rustdoc/intra-link-in-bodies.rs +++ /dev/null @@ -1,30 +0,0 @@ -// we need to make sure that intra-doc links on trait impls get resolved in the right scope - -#![deny(intra_doc_link_resolution_failure)] - -pub mod inner { - pub struct SomethingOutOfScope; -} - -pub mod other { - use inner::SomethingOutOfScope; - use SomeTrait; - - pub struct OtherStruct; - - /// Let's link to [SomethingOutOfScope] while we're at it. - impl SomeTrait for OtherStruct {} -} - -pub trait SomeTrait {} - -pub struct SomeStruct; - -fn __implementation_details() { - use inner::SomethingOutOfScope; - - // FIXME: intra-links resolve in their nearest module scope, not their actual scope in cases - // like this - // Let's link to [SomethingOutOfScope] while we're at it. - impl SomeTrait for SomeStruct {} -} diff --git a/src/test/rustdoc/intra-link-prim-methods.rs b/src/test/rustdoc/intra-link-prim-methods.rs deleted file mode 100644 index af0426b22c557..0000000000000 --- a/src/test/rustdoc/intra-link-prim-methods.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![deny(intra_doc_link_resolution_failure)] - -//! A [`char`] and its [`char::len_utf8`]. diff --git a/src/test/rustdoc/intra-link-private.rs b/src/test/rustdoc/intra-link-private.rs deleted file mode 100644 index c99b4d70684aa..0000000000000 --- a/src/test/rustdoc/intra-link-private.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Rustdoc would previously report resolution failures on items that weren't in the public docs. -// These failures were legitimate, but not truly relevant - the docs in question couldn't be -// checked for accuracy anyway. - -#![deny(intra_doc_link_resolution_failure)] - -/// ooh, i'm a [rebel] just for kicks -struct SomeStruct; diff --git a/src/test/rustdoc/intra-link-self.rs b/src/test/rustdoc/intra-link-self.rs deleted file mode 100644 index acf975f5c738e..0000000000000 --- a/src/test/rustdoc/intra-link-self.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/index.html '//a/@href' '../foo/struct.Foo.html#method.new' -// @has foo/struct.Foo.html '//a/@href' '../foo/struct.Foo.html#method.new' - -/// Use [`new`] to create a new instance. -/// -/// [`new`]: Self::new -pub struct Foo; - -impl Foo { - pub fn new() -> Self { - unimplemented!() - } -} - -// @has foo/index.html '//a/@href' '../foo/struct.Bar.html#method.new2' -// @has foo/struct.Bar.html '//a/@href' '../foo/struct.Bar.html#method.new2' - -/// Use [`new2`] to create a new instance. -/// -/// [`new2`]: Self::new2 -pub struct Bar; - -impl Bar { - pub fn new2() -> Self { - unimplemented!() - } -} diff --git a/src/test/rustdoc/intra-links-external-traits.rs b/src/test/rustdoc/intra-links-external-traits.rs deleted file mode 100644 index d6b4a8ad58ad7..0000000000000 --- a/src/test/rustdoc/intra-links-external-traits.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:intra-links-external-traits.rs -// ignore-cross-compile - -#![crate_name = "outer"] -#![deny(intra_doc_link_resolution_failure)] - -// using a trait that has intra-doc links on it from another crate (whether re-exporting or just -// implementing it) used to give spurious resolution failure warnings - -extern crate intra_links_external_traits; - -pub use intra_links_external_traits::ThisTrait; diff --git a/src/test/rustdoc/intra-links.rs b/src/test/rustdoc/intra-links.rs deleted file mode 100644 index c356ab3a8ac52..0000000000000 --- a/src/test/rustdoc/intra-links.rs +++ /dev/null @@ -1,82 +0,0 @@ -// @has intra_links/index.html -// @has - '//a/@href' '../intra_links/struct.ThisType.html' -// @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method' -// @has - '//a/@href' '../intra_links/enum.ThisEnum.html' -// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v' -// @has - '//a/@href' '../intra_links/trait.ThisTrait.html' -// @has - '//a/@href' '../intra_links/trait.ThisTrait.html#tymethod.this_associated_method' -// @has - '//a/@href' '../intra_links/trait.ThisTrait.html#associatedtype.ThisAssociatedType' -// @has - '//a/@href' '../intra_links/trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST' -// @has - '//a/@href' '../intra_links/trait.ThisTrait.html' -// @has - '//a/@href' '../intra_links/type.ThisAlias.html' -// @has - '//a/@href' '../intra_links/union.ThisUnion.html' -// @has - '//a/@href' '../intra_links/fn.this_function.html' -// @has - '//a/@href' '../intra_links/constant.THIS_CONST.html' -// @has - '//a/@href' '../intra_links/static.THIS_STATIC.html' -// @has - '//a/@href' '../intra_links/macro.this_macro.html' -// @has - '//a/@href' '../intra_links/trait.SoAmbiguous.html' -// @has - '//a/@href' '../intra_links/fn.SoAmbiguous.html' -//! In this crate we would like to link to: -//! -//! * [`ThisType`](ThisType) -//! * [`ThisType::this_method`](ThisType::this_method) -//! * [`ThisEnum`](ThisEnum) -//! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant) -//! * [`ThisEnum::ThisVariantCtor`](ThisEnum::ThisVariantCtor) -//! * [`ThisTrait`](ThisTrait) -//! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method) -//! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType) -//! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST) -//! * [`ThisAlias`](ThisAlias) -//! * [`ThisUnion`](ThisUnion) -//! * [`this_function`](this_function()) -//! * [`THIS_CONST`](const@THIS_CONST) -//! * [`THIS_STATIC`](static@THIS_STATIC) -//! * [`this_macro`](this_macro!) -//! -//! In addition, there's some specifics we want to look at. There's [a trait called -//! SoAmbiguous][ambig-trait], but there's also [a function called SoAmbiguous][ambig-fn] too! -//! Whatever shall we do? -//! -//! [ambig-trait]: trait@SoAmbiguous -//! [ambig-fn]: SoAmbiguous() - -#[macro_export] -macro_rules! this_macro { - () => {}; -} - -pub struct ThisType; - -impl ThisType { - pub fn this_method() {} -} -pub enum ThisEnum { ThisVariant, ThisVariantCtor(u32), } -pub trait ThisTrait { - type ThisAssociatedType; - const THIS_ASSOCIATED_CONST: u8; - fn this_associated_method(); -} -pub type ThisAlias = Result<(), ()>; -pub union ThisUnion { this_field: usize, } - -pub fn this_function() {} -pub const THIS_CONST: usize = 5usize; -pub static THIS_STATIC: usize = 5usize; - -pub trait SoAmbiguous {} - -#[allow(nonstandard_style)] -pub fn SoAmbiguous() {} - - -// @has - '//a/@href' '../intra_links/struct.ThisType.html' -// @has - '//a/@href' '../intra_links/struct.ThisType.html#method.this_method' -// @has - '//a/@href' '../intra_links/enum.ThisEnum.html' -// @has - '//a/@href' '../intra_links/enum.ThisEnum.html#ThisVariant.v' -/// Shortcut links for: -/// * [`ThisType`] -/// * [`ThisType::this_method`] -/// * [ThisEnum] -/// * [ThisEnum::ThisVariant] -pub struct SomeOtherType; diff --git a/src/test/rustdoc/invalid.crate.name.rs b/src/test/rustdoc/invalid.crate.name.rs deleted file mode 100644 index c19713b565afe..0000000000000 --- a/src/test/rustdoc/invalid.crate.name.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --crate-name foo - -pub fn foo() {} diff --git a/src/test/rustdoc/issue-12834.rs b/src/test/rustdoc/issue-12834.rs deleted file mode 100644 index 558009e693777..0000000000000 --- a/src/test/rustdoc/issue-12834.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Tests that failing to syntax highlight a rust code-block doesn't cause -// rustdoc to fail, while still rendering the code-block (without highlighting). - - -// @has issue_12834/fn.foo.html -// @has - //pre 'a + b ' - -/// ``` -/// a + b ∈ Self ∀ a, b ∈ Self -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/issue-13698.rs b/src/test/rustdoc/issue-13698.rs deleted file mode 100644 index 3046a8a28627d..0000000000000 --- a/src/test/rustdoc/issue-13698.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:issue-13698.rs -// ignore-cross-compile - -extern crate issue_13698; - -pub struct Foo; -// @!has issue_13698/struct.Foo.html '//*[@id="method.foo"]' 'fn foo' -impl issue_13698::Foo for Foo {} - -pub trait Bar { - #[doc(hidden)] - fn bar(&self) {} -} - -// @!has issue_13698/struct.Foo.html '//*[@id="method.bar"]' 'fn bar' -impl Bar for Foo {} diff --git a/src/test/rustdoc/issue-15169.rs b/src/test/rustdoc/issue-15169.rs deleted file mode 100644 index e525d85e21ec0..0000000000000 --- a/src/test/rustdoc/issue-15169.rs +++ /dev/null @@ -1,3 +0,0 @@ -// @has issue_15169/struct.Foo.html '//*[@id="method.eq"]' 'fn eq' -#[derive(PartialEq)] -pub struct Foo; diff --git a/src/test/rustdoc/issue-15318-2.rs b/src/test/rustdoc/issue-15318-2.rs deleted file mode 100644 index 2af811ad5bbe8..0000000000000 --- a/src/test/rustdoc/issue-15318-2.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:issue-15318.rs -// ignore-cross-compile - -extern crate issue_15318; - -pub use issue_15318::ptr; - -// @has issue_15318_2/fn.bar.html \ -// '//*[@href="primitive.pointer.html"]' \ -// '*mut T' -pub fn bar<T>(ptr: *mut T) {} diff --git a/src/test/rustdoc/issue-15318-3.rs b/src/test/rustdoc/issue-15318-3.rs deleted file mode 100644 index 1f7443a657240..0000000000000 --- a/src/test/rustdoc/issue-15318-3.rs +++ /dev/null @@ -1,5 +0,0 @@ -// @has issue_15318_3/primitive.pointer.html - -/// dox -#[doc(primitive = "pointer")] -pub mod ptr {} diff --git a/src/test/rustdoc/issue-15318.rs b/src/test/rustdoc/issue-15318.rs deleted file mode 100644 index 0349fe2854c8a..0000000000000 --- a/src/test/rustdoc/issue-15318.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:issue-15318.rs -// ignore-cross-compile - -#![no_std] - -extern crate issue_15318; - -// @has issue_15318/fn.bar.html \ -// '//*[@href="http://example.com/issue_15318/primitive.pointer.html"]' \ -// '*mut T' -pub fn bar<T>(ptr: *mut T) {} diff --git a/src/test/rustdoc/issue-15347.rs b/src/test/rustdoc/issue-15347.rs deleted file mode 100644 index fa67da840b7b4..0000000000000 --- a/src/test/rustdoc/issue-15347.rs +++ /dev/null @@ -1,5 +0,0 @@ -// compile-flags: --no-defaults --passes collapse-docs --passes unindent-comments - -// @has issue_15347/fn.foo.html -#[doc(hidden)] -pub fn foo() {} diff --git a/src/test/rustdoc/issue-16019.rs b/src/test/rustdoc/issue-16019.rs deleted file mode 100644 index 239d92378d9bb..0000000000000 --- a/src/test/rustdoc/issue-16019.rs +++ /dev/null @@ -1,9 +0,0 @@ -macro_rules! define_struct { - ($rounds:expr) => ( - struct Struct { - sk: [u32; $rounds + 1] - } - ) -} - -define_struct!(2); diff --git a/src/test/rustdoc/issue-16265-1.rs b/src/test/rustdoc/issue-16265-1.rs deleted file mode 100644 index 653fd4c5e34e6..0000000000000 --- a/src/test/rustdoc/issue-16265-1.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub struct Foo; - -// @has issue_16265_1/traits/index.html '[src]' -pub mod traits { - impl PartialEq for super::Foo { - fn eq(&self, _: &super::Foo) -> bool { true } - } -} diff --git a/src/test/rustdoc/issue-16265-2.rs b/src/test/rustdoc/issue-16265-2.rs deleted file mode 100644 index 00453a3633328..0000000000000 --- a/src/test/rustdoc/issue-16265-2.rs +++ /dev/null @@ -1,4 +0,0 @@ -// @has issue_16265_2/index.html '[src]' - -trait Y {} -impl Y for Option<u32>{} diff --git a/src/test/rustdoc/issue-17476.rs b/src/test/rustdoc/issue-17476.rs deleted file mode 100644 index a5b484c985fff..0000000000000 --- a/src/test/rustdoc/issue-17476.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:issue-17476.rs -// ignore-cross-compile - -extern crate issue_17476; - -pub struct Foo; - -// @has issue_17476/struct.Foo.html \ -// '//*[@href="http://example.com/issue_17476/trait.Foo.html#method.foo"]' \ -// 'foo' -impl issue_17476::Foo for Foo {} diff --git a/src/test/rustdoc/issue-18199.rs b/src/test/rustdoc/issue-18199.rs deleted file mode 100644 index bc0c4a5650294..0000000000000 --- a/src/test/rustdoc/issue-18199.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags:--test - -#![doc(test(attr(feature(staged_api))))] - -/// ``` -/// #![unstable(feature="test", issue="18199")] -/// fn main() {} -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/issue-19055.rs b/src/test/rustdoc/issue-19055.rs deleted file mode 100644 index dbaf744dc4712..0000000000000 --- a/src/test/rustdoc/issue-19055.rs +++ /dev/null @@ -1,20 +0,0 @@ -// @has issue_19055/trait.Any.html -pub trait Any {} - -impl<'any> Any + 'any { - // @has - '//*[@id="method.is"]' 'fn is' - pub fn is<T: 'static>(&self) -> bool { loop {} } - - // @has - '//*[@id="method.downcast_ref"]' 'fn downcast_ref' - pub fn downcast_ref<T: 'static>(&self) -> Option<&T> { loop {} } - - // @has - '//*[@id="method.downcast_mut"]' 'fn downcast_mut' - pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> { loop {} } -} - -pub trait Foo { - fn foo(&self) {} -} - -// @has - '//*[@id="method.foo"]' 'fn foo' -impl Foo for Any {} diff --git a/src/test/rustdoc/issue-19181.rs b/src/test/rustdoc/issue-19181.rs deleted file mode 100644 index 3dea152fc6ecb..0000000000000 --- a/src/test/rustdoc/issue-19181.rs +++ /dev/null @@ -1,5 +0,0 @@ -// compile-flags:--test - -// rustdoc should not panic when target crate has compilation errors - -fn main() { 0 } diff --git a/src/test/rustdoc/issue-19190-2.rs b/src/test/rustdoc/issue-19190-2.rs deleted file mode 100644 index b6416e2e5b97e..0000000000000 --- a/src/test/rustdoc/issue-19190-2.rs +++ /dev/null @@ -1,12 +0,0 @@ -use std::ops::Deref; - -pub struct Bar; - -impl Deref for Bar { - type Target = String; - fn deref(&self) -> &String { loop {} } -} - -// @has issue_19190_2/struct.Bar.html -// @!has - '//*[@id="method.new"]' 'fn new() -> String' -// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' diff --git a/src/test/rustdoc/issue-19190-3.rs b/src/test/rustdoc/issue-19190-3.rs deleted file mode 100644 index 4d34ce6509fe3..0000000000000 --- a/src/test/rustdoc/issue-19190-3.rs +++ /dev/null @@ -1,27 +0,0 @@ -// aux-build:issue-19190-3.rs -// ignore-cross-compile - -extern crate issue_19190_3; - -use std::ops::Deref; -use issue_19190_3::Baz; - -// @has issue_19190_3/struct.Foo.html -// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' -// @!has - '//*[@id="method.new"]' 'fn new() -> String' -pub use issue_19190_3::Foo; - -// @has issue_19190_3/struct.Bar.html -// @has - '//*[@id="method.baz"]' 'fn baz(&self)' -// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()' -pub use issue_19190_3::Bar; - -// @has issue_19190_3/struct.MyBar.html -// @has - '//*[@id="method.baz"]' 'fn baz(&self)' -// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()' -pub struct MyBar; - -impl Deref for MyBar { - type Target = Baz; - fn deref(&self) -> &Baz { loop {} } -} diff --git a/src/test/rustdoc/issue-19190.rs b/src/test/rustdoc/issue-19190.rs deleted file mode 100644 index c6bac51c5740d..0000000000000 --- a/src/test/rustdoc/issue-19190.rs +++ /dev/null @@ -1,23 +0,0 @@ -// compile-flags:-Z unstable-options --generate-redirect-pages - -use std::ops::Deref; - -pub struct Foo; -pub struct Bar; - -impl Foo { - pub fn foo(&self) {} - pub fn static_foo() {} -} - -impl Deref for Bar { - type Target = Foo; - 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-20175.rs b/src/test/rustdoc/issue-20175.rs deleted file mode 100644 index 6a42e2afbf43c..0000000000000 --- a/src/test/rustdoc/issue-20175.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub trait Foo { - fn foo(&self) {} -} - -pub struct Bar; - -// @has issue_20175/struct.Bar.html \ -// '//*[@id="method.foo"]' \ -// 'fn foo' -impl<'a> Foo for &'a Bar {} diff --git a/src/test/rustdoc/issue-20646.rs b/src/test/rustdoc/issue-20646.rs deleted file mode 100644 index 2589e27f21502..0000000000000 --- a/src/test/rustdoc/issue-20646.rs +++ /dev/null @@ -1,26 +0,0 @@ -// aux-build:issue-20646.rs -// ignore-cross-compile - -#![feature(associated_types)] - -extern crate issue_20646; - -// @has issue_20646/trait.Trait.html \ -// '//*[@id="associatedtype.Output"]' \ -// 'type Output' -pub trait Trait { - type Output; -} - -// @has issue_20646/fn.fun.html \ -// '//*[@class="rust fn"]' 'where T: Trait<Output = i32>' -pub fn fun<T>(_: T) where T: Trait<Output=i32> {} - -pub mod reexport { - // @has issue_20646/reexport/trait.Trait.html \ - // '//*[@id="associatedtype.Output"]' \ - // 'type Output' - // @has issue_20646/reexport/fn.fun.html \ - // '//*[@class="rust fn"]' 'where T: Trait<Output = i32>' - pub use issue_20646::{Trait, fun}; -} diff --git a/src/test/rustdoc/issue-20727-2.rs b/src/test/rustdoc/issue-20727-2.rs deleted file mode 100644 index 022ff290e1a71..0000000000000 --- a/src/test/rustdoc/issue-20727-2.rs +++ /dev/null @@ -1,22 +0,0 @@ -// aux-build:issue-20727.rs -// ignore-cross-compile - -extern crate issue_20727; - -// @has issue_20727_2/trait.Add.html -pub trait Add<RHS = Self> { - // @has - '//*[@class="rust trait"]' 'trait Add<RHS = Self> {' - // @has - '//*[@class="rust trait"]' 'type Output;' - type Output; - - // @has - '//*[@class="rust trait"]' 'fn add(self, rhs: RHS) -> Self::Output;' - fn add(self, rhs: RHS) -> Self::Output; -} - -// @has issue_20727_2/reexport/trait.Add.html -pub mod reexport { - // @has - '//*[@class="rust trait"]' 'trait Add<RHS = Self> {' - // @has - '//*[@class="rust trait"]' 'type Output;' - // @has - '//*[@class="rust trait"]' 'fn add(self, rhs: RHS) -> Self::Output;' - pub use issue_20727::Add; -} diff --git a/src/test/rustdoc/issue-20727-3.rs b/src/test/rustdoc/issue-20727-3.rs deleted file mode 100644 index 52032b75aeaf5..0000000000000 --- a/src/test/rustdoc/issue-20727-3.rs +++ /dev/null @@ -1,24 +0,0 @@ -// aux-build:issue-20727.rs -// ignore-cross-compile - -extern crate issue_20727; - -pub trait Bar {} - -// @has issue_20727_3/trait.Deref2.html -pub trait Deref2 { - // @has - '//*[@class="rust trait"]' 'trait Deref2 {' - // @has - '//*[@class="rust trait"]' 'type Target: Bar;' - type Target: Bar; - - // @has - '//*[@class="rust trait"]' 'fn deref(&self) -> Self::Target;' - fn deref(&self) -> Self::Target; -} - -// @has issue_20727_3/reexport/trait.Deref2.html -pub mod reexport { - // @has - '//*[@class="rust trait"]' 'trait Deref2 {' - // @has - '//*[@class="rust trait"]' 'type Target: Bar;' - // @has - '//*[@class="rust trait"]' 'fn deref(&self) -> Self::Target;' - pub use issue_20727::Deref2; -} diff --git a/src/test/rustdoc/issue-20727-4.rs b/src/test/rustdoc/issue-20727-4.rs deleted file mode 100644 index 84fc6f94a265a..0000000000000 --- a/src/test/rustdoc/issue-20727-4.rs +++ /dev/null @@ -1,40 +0,0 @@ -// aux-build:issue-20727.rs -// ignore-cross-compile - -extern crate issue_20727; - -// @has issue_20727_4/trait.Index.html -pub trait Index<Idx: ?Sized> { - // @has - '//*[@class="rust trait"]' 'trait Index<Idx: ?Sized> {' - // @has - '//*[@class="rust trait"]' 'type Output: ?Sized' - type Output: ?Sized; - - // @has - '//*[@class="rust trait"]' \ - // 'fn index(&self, index: Idx) -> &Self::Output' - fn index(&self, index: Idx) -> &Self::Output; -} - -// @has issue_20727_4/trait.IndexMut.html -pub trait IndexMut<Idx: ?Sized>: Index<Idx> { - // @has - '//*[@class="rust trait"]' \ - // 'trait IndexMut<Idx: ?Sized>: Index<Idx> {' - // @has - '//*[@class="rust trait"]' \ - // 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;' - fn index_mut(&mut self, index: Idx) -> &mut Self::Output; -} - -pub mod reexport { - // @has issue_20727_4/reexport/trait.Index.html - // @has - '//*[@class="rust trait"]' 'trait Index<Idx> where Idx: ?Sized, {' - // @has - '//*[@class="rust trait"]' 'type Output: ?Sized' - // @has - '//*[@class="rust trait"]' \ - // 'fn index(&self, index: Idx) -> &Self::Output' - pub use issue_20727::Index; - - // @has issue_20727_4/reexport/trait.IndexMut.html - // @has - '//*[@class="rust trait"]' \ - // 'trait IndexMut<Idx>: Index<Idx> where Idx: ?Sized, {' - // @has - '//*[@class="rust trait"]' \ - // 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;' - pub use issue_20727::IndexMut; -} diff --git a/src/test/rustdoc/issue-20727.rs b/src/test/rustdoc/issue-20727.rs deleted file mode 100644 index f7acffcb4e56a..0000000000000 --- a/src/test/rustdoc/issue-20727.rs +++ /dev/null @@ -1,24 +0,0 @@ -// aux-build:issue-20727.rs -// ignore-cross-compile - -extern crate issue_20727; - -// @has issue_20727/trait.Deref.html -pub trait Deref { - // @has - '//*[@class="rust trait"]' 'trait Deref {' - // @has - '//*[@class="rust trait"]' 'type Target: ?Sized;' - type Target: ?Sized; - - // @has - '//*[@class="rust trait"]' \ - // "fn deref<'a>(&'a self) -> &'a Self::Target;" - fn deref<'a>(&'a self) -> &'a Self::Target; -} - -// @has issue_20727/reexport/trait.Deref.html -pub mod reexport { - // @has - '//*[@class="rust trait"]' 'trait Deref {' - // @has - '//*[@class="rust trait"]' 'type Target: ?Sized;' - // @has - '//*[@class="rust trait"]' \ - // "fn deref(&'a self) -> &'a Self::Target;" - pub use issue_20727::Deref; -} diff --git a/src/test/rustdoc/issue-21092.rs b/src/test/rustdoc/issue-21092.rs deleted file mode 100644 index b054145a4831a..0000000000000 --- a/src/test/rustdoc/issue-21092.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:issue-21092.rs -// ignore-cross-compile - -extern crate issue_21092; - -// @has issue_21092/struct.Bar.html -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32' -pub use issue_21092::{Foo, Bar}; diff --git a/src/test/rustdoc/issue-21474.rs b/src/test/rustdoc/issue-21474.rs deleted file mode 100644 index 4c530f72b8ab6..0000000000000 --- a/src/test/rustdoc/issue-21474.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub use inner::*; - -mod inner { - impl super::Blah for super::What { } -} - -pub trait Blah { } - -// @count issue_21474/struct.What.html \ -// '//*[@id="implementations-list"]/*[@class="impl"]' 1 -pub struct What; diff --git a/src/test/rustdoc/issue-21801.rs b/src/test/rustdoc/issue-21801.rs deleted file mode 100644 index 2a586b6ff6cdc..0000000000000 --- a/src/test/rustdoc/issue-21801.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:issue-21801.rs -// ignore-cross-compile - -extern crate issue_21801; - -// @has issue_21801/struct.Foo.html -// @has - '//*[@id="method.new"]' \ -// 'fn new<F>(f: F) -> Foo where F: FnMut() -> i32' -pub use issue_21801::Foo; diff --git a/src/test/rustdoc/issue-22025.rs b/src/test/rustdoc/issue-22025.rs deleted file mode 100644 index a721a15f463b4..0000000000000 --- a/src/test/rustdoc/issue-22025.rs +++ /dev/null @@ -1,6 +0,0 @@ -// aux-build:issue-22025.rs -// ignore-cross-compile - -extern crate issue_22025; - -pub use issue_22025::foo::{Foo, Bar}; diff --git a/src/test/rustdoc/issue-22038.rs b/src/test/rustdoc/issue-22038.rs deleted file mode 100644 index 2db42b561f7f7..0000000000000 --- a/src/test/rustdoc/issue-22038.rs +++ /dev/null @@ -1,19 +0,0 @@ -extern { - // @has issue_22038/fn.foo1.html \ - // '//*[@class="rust fn"]' 'pub unsafe extern "C" fn foo1()' - pub fn foo1(); -} - -extern "system" { - // @has issue_22038/fn.foo2.html \ - // '//*[@class="rust fn"]' 'pub unsafe extern "system" fn foo2()' - pub fn foo2(); -} - -// @has issue_22038/fn.bar.html \ -// '//*[@class="rust fn"]' 'pub extern "C" fn bar()' -pub extern fn bar() {} - -// @has issue_22038/fn.baz.html \ -// '//*[@class="rust fn"]' 'pub extern "system" fn baz()' -pub extern "system" fn baz() {} diff --git a/src/test/rustdoc/issue-23106.rs b/src/test/rustdoc/issue-23106.rs deleted file mode 100644 index 8cda2fc33805d..0000000000000 --- a/src/test/rustdoc/issue-23106.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags:--test - -/// ``` -/// # -/// ``` -pub fn main() { -} diff --git a/src/test/rustdoc/issue-23207.rs b/src/test/rustdoc/issue-23207.rs deleted file mode 100644 index 1a4b849ee8209..0000000000000 --- a/src/test/rustdoc/issue-23207.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:issue-23207-1.rs -// aux-build:issue-23207-2.rs -// ignore-cross-compile - -extern crate issue_23207_2; - -// @has issue_23207/fmt/index.html -// @count - '//*[@class="struct"]' 1 -pub use issue_23207_2::fmt; diff --git a/src/test/rustdoc/issue-23511.rs b/src/test/rustdoc/issue-23511.rs deleted file mode 100644 index 4972a9fb47fff..0000000000000 --- a/src/test/rustdoc/issue-23511.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(lang_items)] -#![no_std] - -pub mod str { - #![doc(primitive = "str")] - - #[lang = "str_alloc"] - impl str { - // @has search-index.js foo - pub fn foo(&self) {} - } -} diff --git a/src/test/rustdoc/issue-23744.rs b/src/test/rustdoc/issue-23744.rs deleted file mode 100644 index 642817396b2a0..0000000000000 --- a/src/test/rustdoc/issue-23744.rs +++ /dev/null @@ -1,12 +0,0 @@ -// compile-flags:--test - -/// Example of rustdoc incorrectly parsing <code>```rust,should_panic</code>. -/// -/// ```should_panic -/// fn main() { panic!("fee"); } -/// ``` -/// -/// ```rust,should_panic -/// fn main() { panic!("fum"); } -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/issue-23812.rs b/src/test/rustdoc/issue-23812.rs deleted file mode 100644 index 5dac8d87b089c..0000000000000 --- a/src/test/rustdoc/issue-23812.rs +++ /dev/null @@ -1,36 +0,0 @@ -macro_rules! doc { - (#[$outer:meta] mod $i:ident { #![$inner:meta] }) => - ( - #[$outer] - pub mod $i { - #![$inner] - } - ) -} - -doc! { - /// Outer comment - mod Foo { - //! Inner comment - } -} - -// @has issue_23812/Foo/index.html -// @has - 'Outer comment' -// @!has - '/// Outer comment' -// @has - 'Inner comment' -// @!has - '//! Inner comment' - - -doc! { - /** Outer block comment */ - mod Bar { - /*! Inner block comment */ - } -} - -// @has issue_23812/Bar/index.html -// @has - 'Outer block comment' -// @!has - '/** Outer block comment */' -// @has - 'Inner block comment' -// @!has - '/*! Inner block comment */' diff --git a/src/test/rustdoc/issue-25001.rs b/src/test/rustdoc/issue-25001.rs deleted file mode 100644 index 55d8ee394385b..0000000000000 --- a/src/test/rustdoc/issue-25001.rs +++ /dev/null @@ -1,46 +0,0 @@ -// @has issue_25001/struct.Foo.html -pub struct Foo<T>(T); - -pub trait Bar { - type Item; - - fn quux(self); -} - -impl Foo<u8> { - // @has - '//*[@id="method.pass"]//code' 'fn pass()' - // @has - '//code[@id="pass.v"]' 'fn pass()' - pub fn pass() {} -} -impl Foo<u16> { - // @has - '//*[@id="method.pass-1"]//code' 'fn pass() -> usize' - // @has - '//code[@id="pass.v-1"]' 'fn pass() -> usize' - pub fn pass() -> usize { 42 } -} -impl Foo<u32> { - // @has - '//*[@id="method.pass-2"]//code' 'fn pass() -> isize' - // @has - '//code[@id="pass.v-2"]' 'fn pass() -> isize' - pub fn pass() -> isize { 42 } -} - -impl<T> Bar for Foo<T> { - // @has - '//*[@id="associatedtype.Item"]//code' 'type Item = T' - type Item=T; - - // @has - '//*[@id="method.quux"]//code' 'fn quux(self)' - fn quux(self) {} -} -impl<'a, T> Bar for &'a Foo<T> { - // @has - '//*[@id="associatedtype.Item-1"]//code' "type Item = &'a T" - type Item=&'a T; - - // @has - '//*[@id="method.quux-1"]//code' 'fn quux(self)' - fn quux(self) {} -} -impl<'a, T> Bar for &'a mut Foo<T> { - // @has - '//*[@id="associatedtype.Item-2"]//code' "type Item = &'a mut T" - type Item=&'a mut T; - - // @has - '//*[@id="method.quux-2"]//code' 'fn quux(self)' - fn quux(self) {} -} diff --git a/src/test/rustdoc/issue-25944.rs b/src/test/rustdoc/issue-25944.rs deleted file mode 100644 index 49625294bbea0..0000000000000 --- a/src/test/rustdoc/issue-25944.rs +++ /dev/null @@ -1,11 +0,0 @@ -// compile-flags:--test - -/// ``` -/// let a = r#" -/// foo -/// bar"#; -/// let b = "\nfoo\nbar"; -/// assert_eq!(a, b); -/// ``` -pub fn main() { -} diff --git a/src/test/rustdoc/issue-26606.rs b/src/test/rustdoc/issue-26606.rs deleted file mode 100644 index 6de419ec571df..0000000000000 --- a/src/test/rustdoc/issue-26606.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:issue-26606-macro.rs -// ignore-cross-compile -// build-aux-docs - -// @has issue_26606_macro/macro.make_item.html -#[macro_use] -extern crate issue_26606_macro; - -// @has issue_26606/constant.FOO.html -// @!has - '//a/@href' '../src/' -make_item!(FOO); diff --git a/src/test/rustdoc/issue-26995.rs b/src/test/rustdoc/issue-26995.rs deleted file mode 100644 index fedc9f5174920..0000000000000 --- a/src/test/rustdoc/issue-26995.rs +++ /dev/null @@ -1,7 +0,0 @@ -// ignore-windows -// compile-flags: --no-defaults - -// @has src/issue_26995/dev/null.html -// @has issue_26995/null/index.html '//a/@href' '../../src/issue_26995/dev/null.html' -#[path="/dev/null"] -pub mod null; diff --git a/src/test/rustdoc/issue-27104.rs b/src/test/rustdoc/issue-27104.rs deleted file mode 100644 index b74c3eb78ace4..0000000000000 --- a/src/test/rustdoc/issue-27104.rs +++ /dev/null @@ -1,10 +0,0 @@ -// compile-flags:--no-defaults --passes strip-priv-imports -// aux-build:empty.rs -// ignore-cross-compile - -// @has issue_27104/index.html -// @!has - 'extern crate std' -// @!has - 'use std::prelude::' - -// @has - 'pub extern crate empty' -pub extern crate empty; diff --git a/src/test/rustdoc/issue-27362.rs b/src/test/rustdoc/issue-27362.rs deleted file mode 100644 index 3f3878350d515..0000000000000 --- a/src/test/rustdoc/issue-27362.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:issue-27362.rs -// ignore-cross-compile -// ignore-test This test fails on beta/stable #32019 - -extern crate issue_27362; -pub use issue_27362 as quux; - -// @matches issue_27362/quux/fn.foo.html '//pre' "pub const fn foo()" -// @matches issue_27362/quux/fn.bar.html '//pre' "pub const unsafe fn bar()" -// @matches issue_27362/quux/struct.Foo.html '//code' "const unsafe fn baz()" diff --git a/src/test/rustdoc/issue-27759.rs b/src/test/rustdoc/issue-27759.rs deleted file mode 100644 index f3739dafdf2f1..0000000000000 --- a/src/test/rustdoc/issue-27759.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(staged_api)] -#![doc(issue_tracker_base_url = "http://issue_url/")] - -#![unstable(feature="test", issue="27759")] - -// @has issue_27759/unstable/index.html -// @has - '<code>test</code> <a href="http://issue_url/27759">#27759</a>' -#[unstable(feature="test", issue="27759")] -pub mod unstable { - // @has issue_27759/unstable/fn.issue.html - // @has - '<code>test_function</code> <a href="http://issue_url/12345">#12345</a>' - #[unstable(feature="test_function", issue="12345")] - pub fn issue() {} -} diff --git a/src/test/rustdoc/issue-27862.rs b/src/test/rustdoc/issue-27862.rs deleted file mode 100644 index 77522f1be2307..0000000000000 --- a/src/test/rustdoc/issue-27862.rs +++ /dev/null @@ -1,4 +0,0 @@ -/// Tests | Table -/// ------|------------- -/// t = b | id = \|x\| x -pub struct Foo; // @has issue_27862/struct.Foo.html //td 'id = |x| x' diff --git a/src/test/rustdoc/issue-28478.rs b/src/test/rustdoc/issue-28478.rs deleted file mode 100644 index 4cc4056025463..0000000000000 --- a/src/test/rustdoc/issue-28478.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![feature(associated_type_defaults)] - -// @has issue_28478/trait.Bar.html -pub trait Bar { - // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()' - // @has - '//*[@href="#associatedtype.Bar"]' 'Bar' - type Bar = (); - // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize' - // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz' - const Baz: usize = 7; - // @has - '//*[@id="tymethod.bar"]' 'fn bar' - fn bar(); - // @has - '//*[@id="method.baz"]' 'fn baz' - fn baz() { } -} - -// @has issue_28478/struct.Foo.html -pub struct Foo; - -impl Foo { - // @has - '//*[@href="#method.foo"]' 'foo' - pub fn foo() {} -} - -impl Bar for Foo { - // @has - '//*[@href="../issue_28478/trait.Bar.html#associatedtype.Bar"]' 'Bar' - // @has - '//*[@href="../issue_28478/trait.Bar.html#associatedconstant.Baz"]' 'Baz' - // @has - '//*[@href="../issue_28478/trait.Bar.html#tymethod.bar"]' 'bar' - fn bar() {} - // @has - '//*[@href="../issue_28478/trait.Bar.html#method.baz"]' 'baz' -} diff --git a/src/test/rustdoc/issue-28927.rs b/src/test/rustdoc/issue-28927.rs deleted file mode 100644 index 7b535f33bf7e3..0000000000000 --- a/src/test/rustdoc/issue-28927.rs +++ /dev/null @@ -1,6 +0,0 @@ -// aux-build:issue-28927-2.rs -// aux-build:issue-28927-1.rs -// ignore-cross-compile - -extern crate issue_28927_1 as inner1; -pub use inner1 as foo; diff --git a/src/test/rustdoc/issue-29449.rs b/src/test/rustdoc/issue-29449.rs deleted file mode 100644 index 0d829cf6fcffe..0000000000000 --- a/src/test/rustdoc/issue-29449.rs +++ /dev/null @@ -1,20 +0,0 @@ -// @has issue_29449/struct.Foo.html -pub struct Foo; - -impl Foo { - // @has - '//*[@id="examples"]//a' 'Examples' - // @has - '//*[@id="panics"]//a' 'Panics' - /// # Examples - /// # Panics - pub fn bar() {} - - // @has - '//*[@id="examples-1"]//a' 'Examples' - /// # Examples - pub fn bar_1() {} - - // @has - '//*[@id="examples-2"]//a' 'Examples' - // @has - '//*[@id="panics-1"]//a' 'Panics' - /// # Examples - /// # Panics - pub fn bar_2() {} -} diff --git a/src/test/rustdoc/issue-29503.rs b/src/test/rustdoc/issue-29503.rs deleted file mode 100644 index d7e0f37b2866f..0000000000000 --- a/src/test/rustdoc/issue-29503.rs +++ /dev/null @@ -1,18 +0,0 @@ -// ignore-tidy-linelength - -use std::fmt; - -// @has issue_29503/trait.MyTrait.html -pub trait MyTrait { - fn my_string(&self) -> String; -} - -// @has - "//div[@id='implementors-list']/h3[@id='impl-MyTrait']//code" "impl<T> MyTrait for T where T: Debug" -impl<T> MyTrait for T where T: fmt::Debug { - fn my_string(&self) -> String { - format!("{:?}", self) - } -} - -pub fn main() { -} diff --git a/src/test/rustdoc/issue-29584.rs b/src/test/rustdoc/issue-29584.rs deleted file mode 100644 index 28e1efec608dc..0000000000000 --- a/src/test/rustdoc/issue-29584.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:issue-29584.rs -// ignore-cross-compile - -extern crate issue_29584; - -// @has issue_29584/struct.Foo.html -// @!has - 'impl Bar for' -pub use issue_29584::Foo; diff --git a/src/test/rustdoc/issue-30109.rs b/src/test/rustdoc/issue-30109.rs deleted file mode 100644 index e9447538ad782..0000000000000 --- a/src/test/rustdoc/issue-30109.rs +++ /dev/null @@ -1,14 +0,0 @@ -// build-aux-docs -// aux-build:issue-30109-1.rs -// ignore-cross-compile - -pub mod quux { - extern crate issue_30109_1 as bar; - use self::bar::Bar; - - pub trait Foo {} - - // @has issue_30109/quux/trait.Foo.html \ - // '//a/@href' '../issue_30109_1/struct.Bar.html' - impl Foo for Bar {} -} diff --git a/src/test/rustdoc/issue-30252.rs b/src/test/rustdoc/issue-30252.rs deleted file mode 100644 index c3777362a66d9..0000000000000 --- a/src/test/rustdoc/issue-30252.rs +++ /dev/null @@ -1,6 +0,0 @@ -// compile-flags:--test --cfg feature="bar" - -/// ```rust -/// assert_eq!(cfg!(feature = "bar"), true); -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/issue-30366.rs b/src/test/rustdoc/issue-30366.rs deleted file mode 100644 index c6274a058b0e5..0000000000000 --- a/src/test/rustdoc/issue-30366.rs +++ /dev/null @@ -1,6 +0,0 @@ -// @has issue_30366/index.html '//a/@href' 'http://www.rust-lang.org/' - -/// Describe it. [Link somewhere][1]. -/// -/// [1]: http://www.rust-lang.org/ -pub fn here_is_a_fn() { } diff --git a/src/test/rustdoc/issue-31808.rs b/src/test/rustdoc/issue-31808.rs deleted file mode 100644 index e55c5bd4f7cee..0000000000000 --- a/src/test/rustdoc/issue-31808.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that associated item impls on primitive types don't crash rustdoc - -pub trait Foo { - const BAR: usize; - type BAZ; -} - -impl Foo for () { - const BAR: usize = 0; - type BAZ = usize; -} diff --git a/src/test/rustdoc/issue-31899.rs b/src/test/rustdoc/issue-31899.rs deleted file mode 100644 index e7a8ee239e2f9..0000000000000 --- a/src/test/rustdoc/issue-31899.rs +++ /dev/null @@ -1,59 +0,0 @@ -// @has issue_31899/index.html -// @has - 'Make this line a bit longer.' -// @!has - 'rust rust-example-rendered' -// @!has - 'use ndarray::arr2' -// @!has - 'prohibited' - -/// A tuple or fixed size array that can be used to index an array. -/// Make this line a bit longer. -/// -/// ``` -/// use ndarray::arr2; -/// -/// let mut a = arr2(&[[0, 1], [0, 0]]); -/// a[[1, 1]] = 1; -/// assert_eq!(a[[0, 1]], 1); -/// assert_eq!(a[[1, 1]], 1); -/// ``` -/// -/// **Note** the blanket implementation that's not visible in rustdoc: -/// `impl<D> NdIndex for D where D: Dimension { ... }` -pub fn bar() {} - -/// Some line -/// -/// # prohibited -pub fn foo() {} - -/// Some line -/// -/// 1. prohibited -/// 2. bar -pub fn baz() {} - -/// Some line -/// -/// - prohibited -/// - bar -pub fn qux() {} - -/// Some line -/// -/// * prohibited -/// * bar -pub fn quz() {} - -/// Some line -/// -/// > prohibited -/// > bar -pub fn qur() {} - -/// Some line -/// -/// prohibited -/// ===== -/// -/// Second -/// ------ -pub fn qut() {} diff --git a/src/test/rustdoc/issue-32374.rs b/src/test/rustdoc/issue-32374.rs deleted file mode 100644 index 7babfaf6060f4..0000000000000 --- a/src/test/rustdoc/issue-32374.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![feature(staged_api)] -#![doc(issue_tracker_base_url = "http://issue_url/")] - -#![unstable(feature="test", issue = "32374")] - -// @matches issue_32374/index.html '//*[@class="docblock-short"]/span[@class="stab deprecated"]' \ -// 'Deprecated' -// @matches issue_32374/index.html '//*[@class="docblock-short"]/span[@class="stab unstable"]' \ -// 'Experimental' -// @matches issue_32374/index.html '//*[@class="docblock-short"]/text()' 'Docs' - -// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \ -// 'Deprecated since 1.0.0: text' -// @has - '<code>test</code> <a href="http://issue_url/32374">#32374</a>' -// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \ -// '🔬 This is a nightly-only experimental API. \(test\s#32374\)$' -/// Docs -#[rustc_deprecated(since = "1.0.0", reason = "text")] -#[unstable(feature = "test", issue = "32374")] -pub struct T; - -// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \ -// 'Deprecated since 1.0.0: deprecated' -// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \ -// '🔬 This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//details' \ -// '🔬 This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//summary' \ -// '🔬 This is a nightly-only experimental API. (test #32374)' -// @has issue_32374/struct.U.html '//details/p' \ -// 'unstable' -#[rustc_deprecated(since = "1.0.0", reason = "deprecated")] -#[unstable(feature = "test", issue = "32374", reason = "unstable")] -pub struct U; diff --git a/src/test/rustdoc/issue-32395.rs b/src/test/rustdoc/issue-32395.rs deleted file mode 100644 index 91d185796139c..0000000000000 --- a/src/test/rustdoc/issue-32395.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:variant-struct.rs -// build-aux-docs -// ignore-cross-compile - -// @has variant_struct/enum.Foo.html -// @!has - 'pub qux' -// @!has - 'pub Bar' -extern crate variant_struct; - -// @has issue_32395/enum.Foo.html -// @!has - 'pub qux' -// @!has - 'pub Bar' -pub use variant_struct::Foo; diff --git a/src/test/rustdoc/issue-32556.rs b/src/test/rustdoc/issue-32556.rs deleted file mode 100644 index e1cf115099726..0000000000000 --- a/src/test/rustdoc/issue-32556.rs +++ /dev/null @@ -1,5 +0,0 @@ -/// Blah blah blah -/// ```ignore (testing rustdoc's handling of ignore) -/// bad_assert!(); -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/issue-32890.rs b/src/test/rustdoc/issue-32890.rs deleted file mode 100644 index 970954433ec72..0000000000000 --- a/src/test/rustdoc/issue-32890.rs +++ /dev/null @@ -1,17 +0,0 @@ -// @has issue_32890/struct.Foo.html -pub struct Foo<T>(T); - -impl Foo<u8> { - // @has - '//a[@href="#method.pass"]' 'pass' - pub fn pass() {} -} - -impl Foo<u16> { - // @has - '//a[@href="#method.pass-1"]' 'pass' - pub fn pass() {} -} - -impl Foo<u32> { - // @has - '//a[@href="#method.pass-2"]' 'pass' - pub fn pass() {} -} diff --git a/src/test/rustdoc/issue-33069.rs b/src/test/rustdoc/issue-33069.rs deleted file mode 100644 index 0213a53cab5d7..0000000000000 --- a/src/test/rustdoc/issue-33069.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub trait Bar {} - -#[doc(hidden)] -pub mod hidden { - pub struct Foo; -} - -// @has issue_33069/trait.Bar.html -// @!has - '//code' 'impl Bar for Foo' -impl Bar for hidden::Foo {} diff --git a/src/test/rustdoc/issue-33178-1.rs b/src/test/rustdoc/issue-33178-1.rs deleted file mode 100644 index 4dc425346abb2..0000000000000 --- a/src/test/rustdoc/issue-33178-1.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:empty.rs -// aux-build:variant-struct.rs -// ignore-cross-compile - -// @has issue_33178_1/index.html -// @!has - //a/@title empty -pub extern crate empty; - -// @!has - //a/@title variant_struct -pub extern crate variant_struct as foo; diff --git a/src/test/rustdoc/issue-33178.rs b/src/test/rustdoc/issue-33178.rs deleted file mode 100644 index 1f45fe7239186..0000000000000 --- a/src/test/rustdoc/issue-33178.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:empty.rs -// aux-build:variant-struct.rs -// build-aux-docs -// ignore-cross-compile - -// @has issue_33178/index.html -// @has - //a/@title empty -// @has - //a/@href ../empty/index.html -pub extern crate empty; - -// @has - //a/@title variant_struct -// @has - //a/@href ../variant_struct/index.html -pub extern crate variant_struct as foo; diff --git a/src/test/rustdoc/issue-33302.rs b/src/test/rustdoc/issue-33302.rs deleted file mode 100644 index 21356b513ee61..0000000000000 --- a/src/test/rustdoc/issue-33302.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Ensure constant and array length values are not taken from source -// code, which wreaks havoc with macros. - - -macro_rules! make { - ($n:expr) => { - pub struct S; - - // @has issue_33302/constant.CST.html \ - // '//pre[@class="rust const"]' 'pub const CST: i32' - pub const CST: i32 = ($n * $n); - // @has issue_33302/static.ST.html \ - // '//pre[@class="rust static"]' 'pub static ST: i32' - pub static ST: i32 = ($n * $n); - - pub trait T<X> { - fn ignore(_: &X) {} - const C: X; - // @has issue_33302/trait.T.html \ - // '//*[@class="rust trait"]' 'const D: i32' - // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' - const D: i32 = ($n * $n); - } - - // @has issue_33302/struct.S.html \ - // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' - // @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' - // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' - impl T<[i32; ($n * $n)]> for S { - const C: [i32; ($n * $n)] = [0; ($n * $n)]; - } - - // @has issue_33302/struct.S.html \ - // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' - // @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' - // @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' - impl T<(i32,)> for S { - const C: (i32,) = ($n,); - } - - // @has issue_33302/struct.S.html \ - // '//h3[@class="impl"]' 'impl T<(i32, i32)> for S' - // @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' - // @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' - impl T<(i32, i32)> for S { - const C: (i32, i32) = ($n, $n); - const D: i32 = ($n / $n); - } - } -} - -make!(4); diff --git a/src/test/rustdoc/issue-33592.rs b/src/test/rustdoc/issue-33592.rs deleted file mode 100644 index 81450f15c2078..0000000000000 --- a/src/test/rustdoc/issue-33592.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name = "foo"] - -pub trait Foo<T> {} - -pub struct Bar; - -pub struct Baz; - -// @has foo/trait.Foo.html '//code' 'impl Foo<i32> for Bar' -impl Foo<i32> for Bar {} - -// @has foo/trait.Foo.html '//code' 'impl<T> Foo<T> for Baz' -impl<T> Foo<T> for Baz {} diff --git a/src/test/rustdoc/issue-34025.rs b/src/test/rustdoc/issue-34025.rs deleted file mode 100644 index 9b9f21cb31694..0000000000000 --- a/src/test/rustdoc/issue-34025.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![crate_name = "foo"] - -// @!has 'foo/sys/index.html' -// @!has 'foo/sys/sidebar-items.js' -#[doc(hidden)] -pub mod sys { - extern "C" { - // @!has 'foo/sys/fn.foo.html' - #[doc(hidden)] - pub fn foo(); - } -} diff --git a/src/test/rustdoc/issue-34274.rs b/src/test/rustdoc/issue-34274.rs deleted file mode 100644 index ce5be84a5491f..0000000000000 --- a/src/test/rustdoc/issue-34274.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:issue-34274.rs -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "foo"] - -extern crate issue_34274; - -// @has foo/fn.extern_c_fn.html '//a/@href' '../src/issue_34274/issue-34274.rs.html#2' -pub use issue_34274::extern_c_fn; diff --git a/src/test/rustdoc/issue-34423.rs b/src/test/rustdoc/issue-34423.rs deleted file mode 100644 index b429bf8c9ba73..0000000000000 --- a/src/test/rustdoc/issue-34423.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub struct Foo; - -pub trait Bar { - #[doc(hidden)] - fn bar() {} -} - -impl Bar for Foo { - fn bar() {} -} diff --git a/src/test/rustdoc/issue-34473.rs b/src/test/rustdoc/issue-34473.rs deleted file mode 100644 index d96301f3ae736..0000000000000 --- a/src/test/rustdoc/issue-34473.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![crate_name = "foo"] - -mod second { - pub struct SomeTypeWithLongName; -} - -// @has foo/index.html -// @!has - SomeTypeWithLongName -// @has foo/struct.SomeType.html -// @!has foo/struct.SomeTypeWithLongName.html -pub use second::{SomeTypeWithLongName as SomeType}; diff --git a/src/test/rustdoc/issue-34928.rs b/src/test/rustdoc/issue-34928.rs deleted file mode 100644 index 4184086f622ab..0000000000000 --- a/src/test/rustdoc/issue-34928.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_name = "foo"] - -pub trait Bar {} - -// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T) where T: Bar;' -pub struct Foo<T>(pub T) where T: Bar; diff --git a/src/test/rustdoc/issue-35169-2.rs b/src/test/rustdoc/issue-35169-2.rs deleted file mode 100644 index 33f7646ced68b..0000000000000 --- a/src/test/rustdoc/issue-35169-2.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::ops::Deref; -use std::ops::DerefMut; - -pub struct Foo; -pub struct Bar; - -impl Foo { - pub fn by_ref(&self) {} - pub fn by_explicit_ref(self: &Foo) {} - pub fn by_mut_ref(&mut self) {} - pub fn by_explicit_mut_ref(self: &mut Foo) {} - pub fn by_explicit_box(self: Box<Foo>) {} - pub fn by_explicit_self_box(self: Box<Self>) {} - pub fn static_foo() {} -} - -impl Deref for Bar { - type Target = Foo; - fn deref(&self) -> &Foo { loop {} } -} - -impl DerefMut for Bar { - fn deref_mut(&mut self) -> &mut Foo { loop {} } -} - -// @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 deleted file mode 100644 index 04fffc40572a6..0000000000000 --- a/src/test/rustdoc/issue-35169.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::ops::Deref; - -pub struct Foo; -pub struct Bar; - -impl Foo { - pub fn by_ref(&self) {} - pub fn by_explicit_ref(self: &Foo) {} - pub fn by_mut_ref(&mut self) {} - pub fn by_explicit_mut_ref(self: &mut Foo) {} - pub fn by_explicit_box(self: Box<Foo>) {} - pub fn by_explicit_self_box(self: Box<Self>) {} - pub fn static_foo() {} -} - -impl Deref for Bar { - type Target = Foo; - fn deref(&self) -> &Foo { loop {} } -} - -// @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/issue-35488.rs b/src/test/rustdoc/issue-35488.rs deleted file mode 100644 index c1bf9ceeac1cc..0000000000000 --- a/src/test/rustdoc/issue-35488.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod foo { - pub enum Foo { - Bar, - } - pub use self::Foo::*; -} - -// @has 'issue_35488/index.html' '//code' 'pub use self::Foo::*;' -// @has 'issue_35488/enum.Foo.html' -pub use self::foo::*; - -// @has 'issue_35488/index.html' '//code' 'pub use std::option::Option::None;' -pub use std::option::Option::None; diff --git a/src/test/rustdoc/issue-36031.rs b/src/test/rustdoc/issue-36031.rs deleted file mode 100644 index af1b32fd22b17..0000000000000 --- a/src/test/rustdoc/issue-36031.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:issue-36031.rs -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "foo"] - -extern crate issue_36031; - -pub use issue_36031::Foo; diff --git a/src/test/rustdoc/issue-38129.rs b/src/test/rustdoc/issue-38129.rs deleted file mode 100644 index 156d50fa52a64..0000000000000 --- a/src/test/rustdoc/issue-38129.rs +++ /dev/null @@ -1,99 +0,0 @@ -// compile-flags:--test - -// This file tests the source-partitioning behavior of rustdoc. -// Each test contains some code that should be put into the generated -// `fn main` and some attributes should be left outside (except the first -// one, which has no attributes). -// If the #![recursion_limit] attribute is incorrectly left inside, -// then the tests will fail because the macro recurses 128 times. - -/// ``` -/// assert_eq!(1 + 1, 2); -/// ``` -pub fn simple() {} - -/// ``` -/// #![recursion_limit = "1024"] -/// macro_rules! recurse { -/// (()) => {}; -/// (() $($rest:tt)*) => { recurse!($($rest)*); } -/// } -/// recurse!(() () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () ()); -/// assert_eq!(1 + 1, 2); -/// ``` -pub fn non_feature_attr() {} - -/// ``` -/// #![feature(core_intrinsics)] -/// assert_eq!(1 + 1, 2); -/// ``` -pub fn feature_attr() {} - -/// ``` -/// #![feature(core_intrinsics)] -/// #![recursion_limit = "1024"] -/// macro_rules! recurse { -/// (()) => {}; -/// (() $($rest:tt)*) => { recurse!($($rest)*); } -/// } -/// recurse!(() () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () ()); -/// assert_eq!(1 + 1, 2); -/// ``` -pub fn both_attrs() {} - -/// ``` -/// #![recursion_limit = "1024"] -/// #![feature(core_intrinsics)] -/// macro_rules! recurse { -/// (()) => {}; -/// (() $($rest:tt)*) => { recurse!($($rest)*); } -/// } -/// recurse!(() () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () () -/// () () () () () () () ()); -/// assert_eq!(1 + 1, 2); -/// ``` -pub fn both_attrs_reverse() {} diff --git a/src/test/rustdoc/issue-38219.rs b/src/test/rustdoc/issue-38219.rs deleted file mode 100644 index fa57c58c76184..0000000000000 --- a/src/test/rustdoc/issue-38219.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags:--test -// should-fail - -/// ``` -/// fail -/// ``` -#[macro_export] -macro_rules! foo { () => {} } diff --git a/src/test/rustdoc/issue-40936.rs b/src/test/rustdoc/issue-40936.rs deleted file mode 100644 index 4d2e4c17b1f9e..0000000000000 --- a/src/test/rustdoc/issue-40936.rs +++ /dev/null @@ -1,6 +0,0 @@ -// aux-build:issue-40936.rs -// build-aux-docs - -#![crate_name = "foo"] - -extern crate issue_40936; diff --git a/src/test/rustdoc/issue-41783.rs b/src/test/rustdoc/issue-41783.rs deleted file mode 100644 index cb9b9b1538951..0000000000000 --- a/src/test/rustdoc/issue-41783.rs +++ /dev/null @@ -1,19 +0,0 @@ -// @has issue_41783/struct.Foo.html -// @!has - 'space' -// @!has - 'comment' -// @has - '# <span class="ident">single' -// @has - '## <span class="ident">double</span>' -// @has - '### <span class="ident">triple</span>' -// @has - '<span class="attribute">#[<span class="ident">outer</span>]</span>' -// @has - '<span class="attribute">#![<span class="ident">inner</span>]</span>' - -/// ```no_run -/// # # space -/// # comment -/// ## single -/// ### double -/// #### triple -/// ##[outer] -/// ##![inner] -/// ``` -pub struct Foo; diff --git a/src/test/rustdoc/issue-42760.rs b/src/test/rustdoc/issue-42760.rs deleted file mode 100644 index b07dc3f6e967b..0000000000000 --- a/src/test/rustdoc/issue-42760.rs +++ /dev/null @@ -1,13 +0,0 @@ -// @has issue_42760/struct.NonGen.html -// @has - '//h1' 'Example' - -/// Item docs. -/// -#[doc="Hello there!"] -/// -/// # Example -/// -/// ```rust -/// // some code here -/// ``` -pub struct NonGen; diff --git a/src/test/rustdoc/issue-42875.rs b/src/test/rustdoc/issue-42875.rs deleted file mode 100644 index 292c2077688de..0000000000000 --- a/src/test/rustdoc/issue-42875.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags: --no-defaults - -#![crate_name = "foo"] - -// @has foo/a/index.html '//code' 'use *;' -mod a { - use *; -} - -// @has foo/b/index.html '//code' 'pub use *;' -pub mod b { - pub use *; -} diff --git a/src/test/rustdoc/issue-43153.rs b/src/test/rustdoc/issue-43153.rs deleted file mode 100644 index 0fe680f10af34..0000000000000 --- a/src/test/rustdoc/issue-43153.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Test that `include!` in a doc test searches relative to the directory in -// which the test is declared. - -// compile-flags:--test - -/// ```rust -/// include!("auxiliary/empty.rs"); -/// fn main() {} -/// ``` -pub struct Foo; diff --git a/src/test/rustdoc/issue-43701.rs b/src/test/rustdoc/issue-43701.rs deleted file mode 100644 index 44335e961f90d..0000000000000 --- a/src/test/rustdoc/issue-43701.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -pub use std::vec::Vec; - -// @!has implementors/core/clone/trait.Clone.js diff --git a/src/test/rustdoc/issue-43869.rs b/src/test/rustdoc/issue-43869.rs deleted file mode 100644 index 44356848fbfad..0000000000000 --- a/src/test/rustdoc/issue-43869.rs +++ /dev/null @@ -1,71 +0,0 @@ -pub fn g() -> impl Iterator<Item=u8> { - Some(1u8).into_iter() -} - -pub fn h() -> (impl Iterator<Item=u8>) { - Some(1u8).into_iter() -} - -pub fn i() -> impl Iterator<Item=u8> + 'static { - Some(1u8).into_iter() -} - -pub fn j() -> impl Iterator<Item=u8> + Clone { - Some(1u8).into_iter() -} - -pub fn k() -> [impl Clone; 2] { - [123u32, 456u32] -} - -pub fn l() -> (impl Clone, impl Default) { - (789u32, -123i32) -} - -pub fn m() -> &'static impl Clone { - &1u8 -} - -pub fn n() -> *const impl Clone { - &1u8 -} - -pub fn o() -> &'static [impl Clone] { - b":)" -} - -// issue #44731 -pub fn test_44731_0() -> Box<impl Iterator<Item=u8>> { - Box::new(g()) -} - -pub fn test_44731_1() -> Result<Box<impl Clone>, ()> { - Ok(Box::new(j())) -} - -// NOTE these involve Fn sugar, where impl Trait is disallowed for now, see issue #45994 -// -//pub fn test_44731_2() -> Box<Fn(impl Clone)> { -// Box::new(|_: u32| {}) -//} -// -//pub fn test_44731_3() -> Box<Fn() -> impl Clone> { -// Box::new(|| 0u32) -//} - -pub fn test_44731_4() -> Box<Iterator<Item=impl Clone>> { - Box::new(g()) -} - -// @has issue_43869/fn.g.html -// @has issue_43869/fn.h.html -// @has issue_43869/fn.i.html -// @has issue_43869/fn.j.html -// @has issue_43869/fn.k.html -// @has issue_43869/fn.l.html -// @has issue_43869/fn.m.html -// @has issue_43869/fn.n.html -// @has issue_43869/fn.o.html -// @has issue_43869/fn.test_44731_0.html -// @has issue_43869/fn.test_44731_1.html -// @has issue_43869/fn.test_44731_4.html diff --git a/src/test/rustdoc/issue-43893.rs b/src/test/rustdoc/issue-43893.rs deleted file mode 100644 index 95d5519345936..0000000000000 --- a/src/test/rustdoc/issue-43893.rs +++ /dev/null @@ -1,19 +0,0 @@ -// ignore-cross-compile - -#![crate_name = "foo"] - -pub trait SomeTrait {} -pub struct SomeStruct; - -// @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#9' -impl SomeTrait for usize {} - -// @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#12-14' -impl SomeTrait for SomeStruct { - // deliberately multi-line impl -} - -pub trait AnotherTrait {} - -// @has foo/trait.AnotherTrait.html '//a/@href' '../src/foo/issue-43893.rs.html#19' -impl<T> AnotherTrait for T {} diff --git a/src/test/rustdoc/issue-45584.rs b/src/test/rustdoc/issue-45584.rs deleted file mode 100644 index cd8c275d8527b..0000000000000 --- a/src/test/rustdoc/issue-45584.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_name = "foo"] - -pub trait Bar<T, U> {} - -// @has 'foo/struct.Foo1.html' -pub struct Foo1; -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1 -// @has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1" -impl Bar<Foo1, &'static Foo1> for Foo1 {} - -// @has 'foo/struct.Foo2.html' -pub struct Foo2; -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1 -// @has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8" -impl Bar<&'static Foo2, Foo2> for u8 {} diff --git a/src/test/rustdoc/issue-46271.rs b/src/test/rustdoc/issue-46271.rs deleted file mode 100644 index b38ef20c551fb..0000000000000 --- a/src/test/rustdoc/issue-46271.rs +++ /dev/null @@ -1,5 +0,0 @@ -// hopefully this doesn't cause an ICE - -pub fn foo() { - extern crate std; -} diff --git a/src/test/rustdoc/issue-46377.rs b/src/test/rustdoc/issue-46377.rs deleted file mode 100644 index 236afb20be53e..0000000000000 --- a/src/test/rustdoc/issue-46377.rs +++ /dev/null @@ -1,3 +0,0 @@ -// @has 'issue_46377/index.html' '//*[@class="docblock-short"]' 'Check out this struct!' -/// # Check out this struct! -pub struct SomeStruct; diff --git a/src/test/rustdoc/issue-46380-2.rs b/src/test/rustdoc/issue-46380-2.rs deleted file mode 100644 index 7004d18dc66c9..0000000000000 --- a/src/test/rustdoc/issue-46380-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub trait PublicTrait<T> {} - -// @has issue_46380_2/struct.PublicStruct.html -pub struct PublicStruct; - -// @!has - '//*[@class="impl"]' 'impl PublicTrait<PrivateStruct> for PublicStruct' -impl PublicTrait<PrivateStruct> for PublicStruct {} - -struct PrivateStruct; diff --git a/src/test/rustdoc/issue-46380.rs b/src/test/rustdoc/issue-46380.rs deleted file mode 100644 index 8837a6b463e88..0000000000000 --- a/src/test/rustdoc/issue-46380.rs +++ /dev/null @@ -1,5 +0,0 @@ -// compile-flags: --document-private-items - -// @has issue_46380/struct.Hidden.html -#[doc(hidden)] -pub struct Hidden; diff --git a/src/test/rustdoc/issue-46727.rs b/src/test/rustdoc/issue-46727.rs deleted file mode 100644 index 0f991cf676ff7..0000000000000 --- a/src/test/rustdoc/issue-46727.rs +++ /dev/null @@ -1,7 +0,0 @@ -// aux-build:issue-46727.rs - -extern crate issue_46727; - -// @has issue_46727/trait.Foo.html -// @has - '//code' 'impl<T> Foo for Bar<[T; 3]>' -pub use issue_46727::{Foo, Bar}; diff --git a/src/test/rustdoc/issue-46766.rs b/src/test/rustdoc/issue-46766.rs deleted file mode 100644 index 36ab739565b8e..0000000000000 --- a/src/test/rustdoc/issue-46766.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_name = "foo"] - -pub enum Enum{Variant} -pub use self::Enum::Variant; - -// @!has foo/index.html '//a/@href' './Enum/index.html' diff --git a/src/test/rustdoc/issue-46767.rs b/src/test/rustdoc/issue-46767.rs deleted file mode 100644 index ef6ed104b743b..0000000000000 --- a/src/test/rustdoc/issue-46767.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "foo"] - -mod private { - pub enum Enum{Variant} -} -pub use self::private::Enum::*; - -// @!has-dir foo/private -// @!has foo/index.html '//a/@href' 'private/index.html' diff --git a/src/test/rustdoc/issue-46976.rs b/src/test/rustdoc/issue-46976.rs deleted file mode 100644 index c59f8c72e64c2..0000000000000 --- a/src/test/rustdoc/issue-46976.rs +++ /dev/null @@ -1 +0,0 @@ -pub fn ice(f: impl Fn()) {} diff --git a/src/test/rustdoc/issue-47038.rs b/src/test/rustdoc/issue-47038.rs deleted file mode 100644 index 810ddca3eab80..0000000000000 --- a/src/test/rustdoc/issue-47038.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(decl_macro)] - -#![crate_name = "foo"] - -use std::vec; - -// @has 'foo/index.html' -// @!has - '//*[@id="macros"]' 'Macros' -// @!has - '//a/@href' 'macro.vec.html' -// @!has 'foo/macro.vec.html' diff --git a/src/test/rustdoc/issue-47197-blank-line-in-doc-block.rs b/src/test/rustdoc/issue-47197-blank-line-in-doc-block.rs deleted file mode 100644 index 19994475de27c..0000000000000 --- a/src/test/rustdoc/issue-47197-blank-line-in-doc-block.rs +++ /dev/null @@ -1,8 +0,0 @@ -// @has issue_47197_blank_line_in_doc_block/fn.whose_woods_these_are_i_think_i_know.html - -/** -* snow - -* ice -*/ -pub fn whose_woods_these_are_i_think_i_know() {} diff --git a/src/test/rustdoc/issue-47639.rs b/src/test/rustdoc/issue-47639.rs deleted file mode 100644 index 4b3456b86c5e6..0000000000000 --- a/src/test/rustdoc/issue-47639.rs +++ /dev/null @@ -1,6 +0,0 @@ -// This should not ICE -pub fn test() { - macro_rules! foo { - () => () - } -} diff --git a/src/test/rustdoc/issue-48377.rs b/src/test/rustdoc/issue-48377.rs deleted file mode 100644 index c32bcf380ea3b..0000000000000 --- a/src/test/rustdoc/issue-48377.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags:--test - -//! This is a doc comment -//! -//! ```rust -//! fn main() {} -//! ``` -//! -//! With a trailing code fence -//! ``` - -/// Some foo function -pub fn foo() {} diff --git a/src/test/rustdoc/issue-48414.rs b/src/test/rustdoc/issue-48414.rs deleted file mode 100644 index b35743d887bf3..0000000000000 --- a/src/test/rustdoc/issue-48414.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:issue-48414.rs - -// ICE when resolving paths for a trait that linked to another trait, when both were in an external -// crate - -#![crate_name = "base"] - -extern crate issue_48414; - -#[doc(inline)] -pub use issue_48414::{SomeTrait, OtherTrait}; diff --git a/src/test/rustdoc/issue-50159.rs b/src/test/rustdoc/issue-50159.rs deleted file mode 100644 index d175c82ec87be..0000000000000 --- a/src/test/rustdoc/issue-50159.rs +++ /dev/null @@ -1,20 +0,0 @@ -pub trait Signal { - type Item; -} - -pub trait Signal2 { - type Item2; -} - -impl<B, C> Signal2 for B where B: Signal<Item = C> { - type Item2 = C; -} - -// @has issue_50159/struct.Switch.html -// @has - '//code' 'impl<B> Send for Switch<B> where <B as Signal>::Item: Send' -// @has - '//code' 'impl<B> Sync for Switch<B> where <B as Signal>::Item: Sync' -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 0 -// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 2 -pub struct Switch<B: Signal> { - pub inner: <B as Signal2>::Item2, -} diff --git a/src/test/rustdoc/issue-51236.rs b/src/test/rustdoc/issue-51236.rs deleted file mode 100644 index d9accf9c5998b..0000000000000 --- a/src/test/rustdoc/issue-51236.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::marker::PhantomData; - -pub mod traits { - pub trait Owned<'a> { - type Reader; - } -} - -// @has issue_51236/struct.Owned.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> Send for \ -// Owned<T> where <T as Owned<'static>>::Reader: Send" -pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> { - marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>, -} diff --git a/src/test/rustdoc/issue-52873.rs b/src/test/rustdoc/issue-52873.rs deleted file mode 100644 index 9138dd50defa0..0000000000000 --- a/src/test/rustdoc/issue-52873.rs +++ /dev/null @@ -1,171 +0,0 @@ -// Regression test for #52873. We used to ICE due to unexpected -// overflows when checking for "blanket impl inclusion". - -use std::marker::PhantomData; -use std::cmp::Ordering; -use std::ops::{Add, Mul}; - -pub type True = B1; -pub type False = B0; -pub type U0 = UTerm; -pub type U1 = UInt<UTerm, B1>; - -pub trait NonZero {} - -pub trait Bit { -} - -pub trait Unsigned { -} - -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash, Debug, Default)] -pub struct B0; - -impl B0 { - #[inline] - pub fn new() -> B0 { - B0 - } -} - -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash, Debug, Default)] -pub struct B1; - -impl B1 { - #[inline] - pub fn new() -> B1 { - B1 - } -} - -impl Bit for B0 { -} - -impl Bit for B1 { -} - -impl NonZero for B1 {} - -pub trait PrivatePow<Y, N> { - type Output; -} -pub type PrivatePowOut<A, Y, N> = <A as PrivatePow<Y, N>>::Output; - -pub type Add1<A> = <A as Add<::B1>>::Output; -pub type Prod<A, B> = <A as Mul<B>>::Output; -pub type Square<A> = <A as Mul>::Output; -pub type Sum<A, B> = <A as Add<B>>::Output; - -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash, Debug, Default)] -pub struct UTerm; - -impl UTerm { - #[inline] - pub fn new() -> UTerm { - UTerm - } -} - -impl Unsigned for UTerm { -} - -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash, Debug, Default)] -pub struct UInt<U, B> { - _marker: PhantomData<(U, B)>, -} - -impl<U: Unsigned, B: Bit> UInt<U, B> { - #[inline] - pub fn new() -> UInt<U, B> { - UInt { - _marker: PhantomData, - } - } -} - -impl<U: Unsigned, B: Bit> Unsigned for UInt<U, B> { -} - -impl<U: Unsigned, B: Bit> NonZero for UInt<U, B> {} - -impl Add<B0> for UTerm { - type Output = UTerm; - fn add(self, _: B0) -> Self::Output { - UTerm - } -} - -impl<U: Unsigned, B: Bit> Add<B0> for UInt<U, B> { - type Output = UInt<U, B>; - fn add(self, _: B0) -> Self::Output { - UInt::new() - } -} - -impl<U: Unsigned> Add<U> for UTerm { - type Output = U; - fn add(self, _: U) -> Self::Output { - unsafe { ::std::mem::uninitialized() } - } -} - -impl<U: Unsigned, B: Bit> Mul<B0> for UInt<U, B> { - type Output = UTerm; - fn mul(self, _: B0) -> Self::Output { - UTerm - } -} - -impl<U: Unsigned, B: Bit> Mul<B1> for UInt<U, B> { - type Output = UInt<U, B>; - fn mul(self, _: B1) -> Self::Output { - UInt::new() - } -} - -impl<U: Unsigned> Mul<U> for UTerm { - type Output = UTerm; - fn mul(self, _: U) -> Self::Output { - UTerm - } -} - -impl<Ul: Unsigned, B: Bit, Ur: Unsigned> Mul<UInt<Ur, B>> for UInt<Ul, B0> -where - Ul: Mul<UInt<Ur, B>>, -{ - type Output = UInt<Prod<Ul, UInt<Ur, B>>, B0>; - fn mul(self, _: UInt<Ur, B>) -> Self::Output { - unsafe { ::std::mem::uninitialized() } - } -} - -pub trait Pow<Exp> { - type Output; -} - -impl<X: Unsigned, N: Unsigned> Pow<N> for X -where - X: PrivatePow<U1, N>, -{ - type Output = PrivatePowOut<X, U1, N>; -} - -impl<Y: Unsigned, X: Unsigned> PrivatePow<Y, U0> for X { - type Output = Y; -} - -impl<Y: Unsigned, X: Unsigned> PrivatePow<Y, U1> for X -where - X: Mul<Y>, -{ - type Output = Prod<X, Y>; -} - -impl<Y: Unsigned, U: Unsigned, B: Bit, X: Unsigned> PrivatePow<Y, UInt<UInt<U, B>, B0>> for X -where - X: Mul, - Square<X>: PrivatePow<Y, UInt<U, B>>, -{ - type Output = PrivatePowOut<Square<X>, Y, UInt<U, B>>; -} diff --git a/src/test/rustdoc/issue-53689.rs b/src/test/rustdoc/issue-53689.rs deleted file mode 100644 index 7fe962c506188..0000000000000 --- a/src/test/rustdoc/issue-53689.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:issue-53689.rs - -#![crate_name = "foo"] - -extern crate issue_53689; - -// @has foo/trait.MyTrait.html -// @!has - 'MyStruct' -// @count - '//*[code="impl<T> MyTrait for T"]' 1 -pub trait MyTrait {} - -impl<T> MyTrait for T {} - -mod a { - pub use issue_53689::MyStruct; -} diff --git a/src/test/rustdoc/issue-53812.rs b/src/test/rustdoc/issue-53812.rs deleted file mode 100644 index 3ebf154077f49..0000000000000 --- a/src/test/rustdoc/issue-53812.rs +++ /dev/null @@ -1,20 +0,0 @@ -pub trait MyIterator { -} - -pub struct MyStruct<T>(T); - -macro_rules! array_impls { - ($($N:expr)+) => { - $( - impl<'a, T> MyIterator for &'a MyStruct<[T; $N]> { - } - )+ - } -} - -// @has issue_53812/trait.MyIterator.html '//*[@id="implementors-list"]//h3[1]' 'MyStruct<[T; 0]>' -// @has - '//*[@id="implementors-list"]//h3[2]' 'MyStruct<[T; 1]>' -// @has - '//*[@id="implementors-list"]//h3[3]' 'MyStruct<[T; 2]>' -// @has - '//*[@id="implementors-list"]//h3[4]' 'MyStruct<[T; 3]>' -// @has - '//*[@id="implementors-list"]//h3[5]' 'MyStruct<[T; 10]>' -array_impls! { 10 3 2 1 0 } diff --git a/src/test/rustdoc/issue-54478-demo-allocator.rs b/src/test/rustdoc/issue-54478-demo-allocator.rs deleted file mode 100644 index 4811f363bc97a..0000000000000 --- a/src/test/rustdoc/issue-54478-demo-allocator.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Issue #54478: regression test showing that we can demonstrate -// `#[global_allocator]` in code blocks built by `rustdoc`. -// -// ## Background -// -// Changes in lang-item visibility injected failures that were only -// exposed when compiling with `-C prefer-dynamic`. But `rustdoc` used -// `-C prefer-dynamic` (and had done so for years, for reasons we did -// not document at that time). -// -// Rather than try to revise the visbility semanics, we instead -// decided to change `rustdoc` to behave more like the compiler's -// default setting, by leaving off `-C prefer-dynamic`. - -// compile-flags:--test - -//! This is a doc comment -//! -//! ```rust -//! use std::alloc::*; -//! -//! #[global_allocator] -//! static ALLOC: A = A; -//! -//! static mut HIT: bool = false; -//! -//! struct A; -//! -//! unsafe impl GlobalAlloc for A { -//! unsafe fn alloc(&self, layout: Layout) -> *mut u8 { -//! HIT = true; -//! System.alloc(layout) -//! } -//! unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { -//! System.dealloc(ptr, layout); -//! } -//! } -//! -//! fn main() { -//! assert!(unsafe { HIT }); -//! } -//! ``` diff --git a/src/test/rustdoc/issue-54705.rs b/src/test/rustdoc/issue-54705.rs deleted file mode 100644 index 263b1eb0bd65a..0000000000000 --- a/src/test/rustdoc/issue-54705.rs +++ /dev/null @@ -1,29 +0,0 @@ -pub trait ScopeHandle<'scope> {} - - - -// @has issue_54705/struct.ScopeFutureContents.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'scope, S> \ -// Send for ScopeFutureContents<'scope, S> where S: Sync" -// -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'scope, S> \ -// Sync for ScopeFutureContents<'scope, S> where S: Sync" -pub struct ScopeFutureContents<'scope, S> - where S: ScopeHandle<'scope>, -{ - dummy: &'scope S, - this: Box<ScopeFuture<'scope, S>>, -} - -struct ScopeFuture<'scope, S> - where S: ScopeHandle<'scope>, -{ - contents: ScopeFutureContents<'scope, S>, -} - -unsafe impl<'scope, S> Send for ScopeFuture<'scope, S> - where S: ScopeHandle<'scope>, -{} -unsafe impl<'scope, S> Sync for ScopeFuture<'scope, S> - where S: ScopeHandle<'scope>, -{} diff --git a/src/test/rustdoc/issue-55001.rs b/src/test/rustdoc/issue-55001.rs deleted file mode 100644 index f6c7f9a3d082c..0000000000000 --- a/src/test/rustdoc/issue-55001.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Regression test for issue #55001. Previously, we would incorrectly -// cache certain trait selection results when checking for blanket impls, -// resulting in an ICE when we tried to confirm the cached ParamCandidate -// against an obligation. - -pub struct DefaultAllocator; -pub struct Standard; -pub struct Inner; - -pub trait Rand {} - -pub trait Distribution<T> {} -pub trait Allocator<N> {} - -impl<T> Rand for T where Standard: Distribution<T> {} - -impl<A> Distribution<Point<A>> for Standard -where -DefaultAllocator: Allocator<A>, -Standard: Distribution<A> {} - -impl Distribution<Inner> for Standard {} - - -pub struct Point<N> -where DefaultAllocator: Allocator<N> -{ - field: N -} - -fn main() {} diff --git a/src/test/rustdoc/issue-55321.rs b/src/test/rustdoc/issue-55321.rs deleted file mode 100644 index 257cb32c65c25..0000000000000 --- a/src/test/rustdoc/issue-55321.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(optin_builtin_traits)] - -// @has issue_55321/struct.A.html -// @has - '//*[@id="implementations-list"]/*[@class="impl"]//code' "impl !Send for A" -// @has - '//*[@id="implementations-list"]/*[@class="impl"]//code' "impl !Sync for A" -pub struct A(); - -impl !Send for A {} -impl !Sync for A {} - -// @has issue_55321/struct.B.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> !Send for \ -// B<T>" -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> !Sync for \ -// B<T>" -pub struct B<T: ?Sized>(A, Box<T>); diff --git a/src/test/rustdoc/issue-56701.rs b/src/test/rustdoc/issue-56701.rs deleted file mode 100644 index ba00743fcd12e..0000000000000 --- a/src/test/rustdoc/issue-56701.rs +++ /dev/null @@ -1,33 +0,0 @@ -// This shouldn't cause a stack overflow when rustdoc is run - -use std::ops::Deref; -use std::ops::DerefMut; - -pub trait SimpleTrait { - type SimpleT; -} - -impl<Inner: SimpleTrait, Outer: Deref<Target = Inner>> SimpleTrait for Outer { - type SimpleT = Inner::SimpleT; -} - -pub trait AnotherTrait { - type AnotherT; -} - -impl<T, Simple: SimpleTrait<SimpleT = Vec<T>>> AnotherTrait for Simple { - type AnotherT = T; -} - -pub struct Unrelated<Inner, UnrelatedT: DerefMut<Target = Vec<Inner>>>(UnrelatedT); - -impl<Inner, UnrelatedT: DerefMut<Target = Vec<Inner>>> Deref for Unrelated<Inner, UnrelatedT> { - type Target = Vec<Inner>; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - - -pub fn main() { } diff --git a/src/test/rustdoc/issue-56822.rs b/src/test/rustdoc/issue-56822.rs deleted file mode 100644 index 5b67817fa4caa..0000000000000 --- a/src/test/rustdoc/issue-56822.rs +++ /dev/null @@ -1,24 +0,0 @@ -struct Wrapper<T>(T); - -trait MyTrait { - type Output; -} - -impl<'a, I, T: 'a> MyTrait for Wrapper<I> - where I: MyTrait<Output=&'a T> -{ - type Output = T; -} - -struct Inner<'a, T>(&'a T); - -impl<'a, T> MyTrait for Inner<'a, T> { - type Output = &'a T; -} - -// @has issue_56822/struct.Parser.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'a> Send for \ -// Parser<'a>" -pub struct Parser<'a> { - field: <Wrapper<Inner<'a, u8>> as MyTrait>::Output -} diff --git a/src/test/rustdoc/keyword.rs b/src/test/rustdoc/keyword.rs deleted file mode 100644 index c721c024468dd..0000000000000 --- a/src/test/rustdoc/keyword.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_name = "foo"] - -#![feature(doc_keyword)] - -// @has foo/index.html '//h2[@id="keywords"]' 'Keywords' -// @has foo/index.html '//a[@href="keyword.match.html"]' 'match' -// @has foo/keyword.match.html '//a[@class="keyword"]' 'match' -// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match' -// @has foo/keyword.match.html '//section[@id="main"]//div[@class="docblock"]//p' 'this is a test!' -// @has foo/index.html '//a/@href' '../foo/index.html' -// @!has foo/foo/index.html -// @!has-dir foo/foo -#[doc(keyword = "match")] -/// this is a test! -mod foo{} diff --git a/src/test/rustdoc/line-breaks.rs b/src/test/rustdoc/line-breaks.rs deleted file mode 100644 index 29c16fcd4f8a3..0000000000000 --- a/src/test/rustdoc/line-breaks.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![crate_name = "foo"] - -use std::ops::Add; -use std::fmt::Display; - -//@count foo/fn.function_with_a_really_long_name.html //pre/br 2 -pub fn function_with_a_really_long_name(parameter_one: i32, - parameter_two: i32) - -> Option<i32> { - Some(parameter_one + parameter_two) -} - -//@count foo/fn.short_name.html //pre/br 0 -pub fn short_name(param: i32) -> i32 { param + 1 } - -//@count foo/fn.where_clause.html //pre/br 4 -pub fn where_clause<T, U>(param_one: T, - param_two: U) - where T: Add<U> + Display + Copy, - U: Add<T> + Display + Copy, - T::Output: Display + Add<U::Output> + Copy, - <T::Output as Add<U::Output>>::Output: Display, - U::Output: Display + Copy -{ - let x = param_one + param_two; - println!("{} + {} = {}", param_one, param_two, x); - let y = param_two + param_one; - println!("{} + {} = {}", param_two, param_one, y); - println!("{} + {} = {}", x, y, x + y); -} diff --git a/src/test/rustdoc/link-assoc-const.rs b/src/test/rustdoc/link-assoc-const.rs deleted file mode 100644 index f9eb2b722d6e6..0000000000000 --- a/src/test/rustdoc/link-assoc-const.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/index.html '//a[@href="../foo/foo/constant.FIRSTCONST.html"]' 'foo::FIRSTCONST' -// @has foo/index.html '//a[@href="../foo/struct.Bar.html#associatedconstant.CONST"]' 'Bar::CONST' - -//! We have here [`foo::FIRSTCONST`] and [`Bar::CONST`]. - -pub mod foo { - pub const FIRSTCONST: u32 = 42; -} - -pub struct Bar; - -impl Bar { - pub const CONST: u32 = 42; -} diff --git a/src/test/rustdoc/link-title-escape.rs b/src/test/rustdoc/link-title-escape.rs deleted file mode 100644 index 29e82cba98d35..0000000000000 --- a/src/test/rustdoc/link-title-escape.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_name = "foo"] - -//! hello [foo] -//! -//! [foo]: url 'title & <stuff> & "things"' - -// @has 'foo/index.html' 'title & <stuff> & "things"' diff --git a/src/test/rustdoc/macros.rs b/src/test/rustdoc/macros.rs deleted file mode 100644 index fb4f02ad16052..0000000000000 --- a/src/test/rustdoc/macros.rs +++ /dev/null @@ -1,10 +0,0 @@ -// @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {' -// @has - //pre '() => { ... };' -// @has - //pre '($a:tt) => { ... };' -// @has - //pre '($e:expr) => { ... };' -#[macro_export] -macro_rules! my_macro { - () => []; - ($a:tt) => (); - ($e:expr) => {}; -} diff --git a/src/test/rustdoc/manual_impl.rs b/src/test/rustdoc/manual_impl.rs deleted file mode 100644 index c9e4f4e0d3037..0000000000000 --- a/src/test/rustdoc/manual_impl.rs +++ /dev/null @@ -1,79 +0,0 @@ -// @has manual_impl/trait.T.html -// @has - '//*[@class="docblock"]' 'Docs associated with the trait definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' -/// Docs associated with the trait definition. -pub trait T { - /// Docs associated with the trait a_method definition. - fn a_method(&self) -> usize; - - /// Docs associated with the trait b_method definition. - fn b_method(&self) -> usize { - self.a_method() - } - - /// Docs associated with the trait c_method definition. - /// - /// There is another line - fn c_method(&self) -> usize { - self.a_method() - } -} - -// @has manual_impl/struct.S1.html '//*[@class="trait"]' 'T' -// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.' -// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.' -// @!has - '//*[@class="docblock"]' 'There is another line' -// @has - '//*[@class="docblock"]' 'Read more' -pub struct S1(usize); - -/// Docs associated with the S1 trait implementation. -impl T for S1 { - /// Docs associated with the S1 trait a_method implementation. - fn a_method(&self) -> usize { - self.0 - } -} - -// @has manual_impl/struct.S2.html '//*[@class="trait"]' 'T' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.' -// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' -// @!has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' -pub struct S2(usize); - -/// Docs associated with the S2 trait implementation. -impl T for S2 { - /// Docs associated with the S2 trait a_method implementation. - fn a_method(&self) -> usize { - self.0 - } - - /// Docs associated with the S2 trait c_method implementation. - fn c_method(&self) -> usize { - 5 - } -} - -// @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T' -// @has - '//*[@class="docblock"]' 'Docs associated with the S3 trait implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.' -// @has - '//*[@class="docblock hidden"]' 'Docs associated with the trait a_method definition.' -pub struct S3(usize); - -/// Docs associated with the S3 trait implementation. -impl T for S3 { - fn a_method(&self) -> usize { - self.0 - } - - /// Docs associated with the S3 trait b_method implementation. - fn b_method(&self) -> usize { - 5 - } -} diff --git a/src/test/rustdoc/masked.rs b/src/test/rustdoc/masked.rs deleted file mode 100644 index c7ad690d66e3e..0000000000000 --- a/src/test/rustdoc/masked.rs +++ /dev/null @@ -1,30 +0,0 @@ -// aux-build:masked.rs - -#![feature(doc_masked)] - -#![crate_name = "foo"] - -#[doc(masked)] -extern crate masked; - -// @!has 'search-index.js' 'masked_method' - -// @!has 'foo/struct.String.html' 'MaskedTrait' -// @!has 'foo/struct.String.html' 'masked_method' -pub use std::string::String; - -// @!has 'foo/trait.Clone.html' 'MaskedStruct' -pub use std::clone::Clone; - -// @!has 'foo/struct.MyStruct.html' 'MaskedTrait' -// @!has 'foo/struct.MyStruct.html' 'masked_method' -pub struct MyStruct; - -impl masked::MaskedTrait for MyStruct { - fn masked_method() {} -} - -// @!has 'foo/trait.MyTrait.html' 'MaskedStruct' -pub trait MyTrait {} - -impl MyTrait for masked::MaskedStruct {} diff --git a/src/test/rustdoc/method-list.rs b/src/test/rustdoc/method-list.rs deleted file mode 100644 index 9f24e817fd3eb..0000000000000 --- a/src/test/rustdoc/method-list.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/struct.Foo.html -// @has - '//*[@class="sidebar-links"]/a' 'super_long_name' -// @has - '//*[@class="sidebar-links"]/a' 'Disp' -pub struct Foo(usize); - -impl Foo { - pub fn super_long_name() {} -} - -pub trait Disp { - fn disp_trait_method(); -} - -impl Disp for Foo { - fn disp_trait_method() {} -} diff --git a/src/test/rustdoc/mod-stackoverflow.rs b/src/test/rustdoc/mod-stackoverflow.rs deleted file mode 100644 index 45b1de2162d97..0000000000000 --- a/src/test/rustdoc/mod-stackoverflow.rs +++ /dev/null @@ -1,6 +0,0 @@ -// aux-build:mod-stackoverflow.rs -// ignore-cross-compile - -extern crate mod_stackoverflow; -pub use mod_stackoverflow::tree; -pub use mod_stackoverflow::tree2; diff --git a/src/test/rustdoc/module-impls.rs b/src/test/rustdoc/module-impls.rs deleted file mode 100644 index 198b3446c61b7..0000000000000 --- a/src/test/rustdoc/module-impls.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -pub use std::marker::Send; - -// @!has foo/index.html 'Implementations' diff --git a/src/test/rustdoc/must-use.rs b/src/test/rustdoc/must-use.rs deleted file mode 100644 index b52557fe220ee..0000000000000 --- a/src/test/rustdoc/must-use.rs +++ /dev/null @@ -1,11 +0,0 @@ -// @has must_use/struct.Struct.html //pre '#[must_use]' -#[must_use] -pub struct Struct { - field: i32, -} - -// @has must_use/enum.Enum.html //pre '#[must_use = "message"]' -#[must_use = "message"] -pub enum Enum { - Variant(i32), -} diff --git a/src/test/rustdoc/namespaces.rs b/src/test/rustdoc/namespaces.rs deleted file mode 100644 index ad828e5ee3e25..0000000000000 --- a/src/test/rustdoc/namespaces.rs +++ /dev/null @@ -1,16 +0,0 @@ -// issue #34843: rustdoc prioritises documenting reexports from the type namespace - -mod inner { - pub mod sync { - pub struct SomeStruct; - } - - pub fn sync() {} -} - -// @has namespaces/sync/index.html -// @has namespaces/fn.sync.html -// @has namespaces/index.html '//a/@href' 'sync/index.html' -// @has - '//a/@href' 'fn.sync.html' -#[doc(inline)] -pub use inner::sync; diff --git a/src/test/rustdoc/negative-impl-sidebar.rs b/src/test/rustdoc/negative-impl-sidebar.rs deleted file mode 100644 index 838ca0402e48a..0000000000000 --- a/src/test/rustdoc/negative-impl-sidebar.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(optin_builtin_traits)] -#![crate_name = "foo"] - -pub struct Foo; - -// @has foo/struct.Foo.html -// @has - '//*[@class="sidebar-title"][@href="#implementations"]' 'Trait Implementations' -// @has - '//*[@class="sidebar-links"]/a' '!Sync' -impl !Sync for Foo {} diff --git a/src/test/rustdoc/negative-impl.rs b/src/test/rustdoc/negative-impl.rs deleted file mode 100644 index 8ac87f4f0cb97..0000000000000 --- a/src/test/rustdoc/negative-impl.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(optin_builtin_traits)] - -// @matches negative_impl/struct.Alpha.html '//pre' "pub struct Alpha" -pub struct Alpha; -// @matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo<B>" -pub struct Bravo<B>(B); - -// @matches negative_impl/struct.Alpha.html '//*[@class="impl"]//code' "impl !Send for Alpha" -impl !Send for Alpha {} - -// @matches negative_impl/struct.Bravo.html '//*[@class="impl"]//code' "impl<B> !Send for Bravo<B>" -impl<B> !Send for Bravo<B> {} diff --git a/src/test/rustdoc/no-crate-filter.rs b/src/test/rustdoc/no-crate-filter.rs deleted file mode 100644 index c694d1456ef34..0000000000000 --- a/src/test/rustdoc/no-crate-filter.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_name = "foo"] - -// compile-flags: -Z unstable-options --disable-per-crate-search - -// @!has 'foo/struct.Foo.html' '//*[id="crate-search"]' -pub struct Foo; diff --git a/src/test/rustdoc/no-run-still-checks-lints.rs b/src/test/rustdoc/no-run-still-checks-lints.rs deleted file mode 100644 index 9f7d1c8845dc7..0000000000000 --- a/src/test/rustdoc/no-run-still-checks-lints.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags:--test -// should-fail - -#![doc(test(attr(deny(warnings))))] - -/// ```no_run -/// let a = 3; -/// ``` -pub fn foo() {} diff --git a/src/test/rustdoc/no-stack-overflow-25295.rs b/src/test/rustdoc/no-stack-overflow-25295.rs deleted file mode 100644 index dd79f1e4baaa0..0000000000000 --- a/src/test/rustdoc/no-stack-overflow-25295.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Ensure this code doesn't stack overflow. -// aux-build:enum-primitive.rs - -#[macro_use] extern crate enum_primitive; - -enum_from_primitive! { - pub enum Test { - A1,A2,A3,A4,A5,A6, - B1,B2,B3,B4,B5,B6, - C1,C2,C3,C4,C5,C6, - D1,D2,D3,D4,D5,D6, - E1,E2,E3,E4,E5,E6, - F1,F2,F3,F4,F5,F6, - G1,G2,G3,G4,G5,G6, - H1,H2,H3,H4,H5,H6, - I1,I2,I3,I4,I5,I6, - J1,J2,J3,J4,J5,J6, - K1,K2,K3,K4,K5,K6, - L1,L2,L3,L4,L5,L6, - M1,M2,M3,M4,M5,M6, - N1,N2,N3,N4,N5,N6, - O1,O2,O3,O4,O5,O6, - P1,P2,P3,P4,P5,P6, - Q1,Q2,Q3,Q4,Q5,Q6, - R1,R2,R3,R4,R5,R6, - S1,S2,S3,S4,S5,S6, - T1,T2,T3,T4,T5,T6, - U1,U2,U3,U4,U5,U6, - V1,V2,V3,V4,V5,V6, - W1,W2,W3,W4,W5,W6, - X1,X2,X3,X4,X5,X6, - Y1,Y2,Y3,Y4,Y5,Y6, - Z1,Z2,Z3,Z4,Z5,Z6, - } -} diff --git a/src/test/rustdoc/nul-error.rs b/src/test/rustdoc/nul-error.rs deleted file mode 100644 index 3d30f5f6b77f8..0000000000000 --- a/src/test/rustdoc/nul-error.rs +++ /dev/null @@ -1,8 +0,0 @@ -// build-aux-docs -// ignore-cross-compile - -#![crate_name = "foo"] - -// @has foo/fn.foo.html '//code' '' -#[doc = "Attempted to pass a string containing `\0`"] -pub fn foo() {} diff --git a/src/test/rustdoc/playground-arg.rs b/src/test/rustdoc/playground-arg.rs deleted file mode 100644 index fb1be7397e65d..0000000000000 --- a/src/test/rustdoc/playground-arg.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags: --playground-url=https://example.com/ -Z unstable-options -// ignore-tidy-linelength - -#![crate_name = "foo"] - -//! ``` -//! use foo::dummy; -//! dummy(); -//! ``` - -pub fn dummy() {} - -// ensure that `extern crate foo;` was inserted into code snips automatically: -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://example.com/?code=%23!%5Ballow(unused)%5D%0Aextern%20crate%20foo%3B%0Afn%20main()%20%7B%0Ause%20foo%3A%3Adummy%3B%0Adummy()%3B%0A%7D"]' "Run" diff --git a/src/test/rustdoc/playground-empty.rs b/src/test/rustdoc/playground-empty.rs deleted file mode 100644 index 7d8bd3ffe0d66..0000000000000 --- a/src/test/rustdoc/playground-empty.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name = "foo"] - -#![doc(html_playground_url = "")] - -// compile-flags:-Z unstable-options --playground-url https://play.rust-lang.org/ - -//! module docs -//! -//! ``` -//! println!("Hello, world!"); -//! ``` - -// @!has foo/index.html '//a[@class="test-arrow"]' "Run" diff --git a/src/test/rustdoc/playground-none.rs b/src/test/rustdoc/playground-none.rs deleted file mode 100644 index ff51c68d8a22b..0000000000000 --- a/src/test/rustdoc/playground-none.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "foo"] - -//! module docs -//! -//! ``` -//! println!("Hello, world!"); -//! ``` - -// @!has foo/index.html '//a[@class="test-arrow"]' "Run" diff --git a/src/test/rustdoc/playground.rs b/src/test/rustdoc/playground.rs deleted file mode 100644 index 1b76e6c885349..0000000000000 --- a/src/test/rustdoc/playground.rs +++ /dev/null @@ -1,29 +0,0 @@ -// ignore-tidy-linelength - -#![crate_name = "foo"] - -#![doc(html_playground_url = "https://www.example.com/")] - -//! module docs -//! -//! ``` -//! println!("Hello, world!"); -//! ``` -//! -//! ``` -//! fn main() { -//! println!("Hello, world!"); -//! } -//! ``` -//! -//! ``` -//! #![feature(something)] -//! -//! fn main() { -//! println!("Hello, world!"); -//! } -//! ``` - -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22Hello%2C%20world!%22)%3B%0A%7D"]' "Run" -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22Hello%2C%20world!%22)%3B%0A%7D"]' "Run" -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22Hello%2C%20world!%22)%3B%0A%7D&version=nightly"]' "Run" diff --git a/src/test/rustdoc/prim-title.rs b/src/test/rustdoc/prim-title.rs deleted file mode 100644 index fa3fd512fada6..0000000000000 --- a/src/test/rustdoc/prim-title.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/primitive.u8.html '//head/title' 'u8 - Rust' -// @!has - '//head/title' 'foo' -#[doc(primitive = "u8")] -/// `u8` docs -mod u8 {} diff --git a/src/test/rustdoc/primitive-generic-impl.rs b/src/test/rustdoc/primitive-generic-impl.rs deleted file mode 100644 index 5794322ba1d31..0000000000000 --- a/src/test/rustdoc/primitive-generic-impl.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -include!("primitive/primitive-generic-impl.rs"); - -// @has foo/primitive.i32.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T' diff --git a/src/test/rustdoc/primitive-link.rs b/src/test/rustdoc/primitive-link.rs deleted file mode 100644 index 819ef05174a8a..0000000000000 --- a/src/test/rustdoc/primitive-link.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.u32.html"]' 'u32' -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="https://doc.rust-lang.org/nightly/std/primitive.i64.html"]' 'i64' - -/// It contains [`u32`] and [i64]. -pub struct Foo; diff --git a/src/test/rustdoc/primitive/primitive-generic-impl.rs b/src/test/rustdoc/primitive/primitive-generic-impl.rs deleted file mode 100644 index b9c56be0fcffc..0000000000000 --- a/src/test/rustdoc/primitive/primitive-generic-impl.rs +++ /dev/null @@ -1,3 +0,0 @@ -#[doc(primitive = "i32")] -/// Some useless docs, wouhou! -mod i32 {} diff --git a/src/test/rustdoc/private-type-alias.rs b/src/test/rustdoc/private-type-alias.rs deleted file mode 100644 index ec7385404f0b2..0000000000000 --- a/src/test/rustdoc/private-type-alias.rs +++ /dev/null @@ -1,31 +0,0 @@ -type MyResultPriv<T> = Result<T, u16>; -pub type MyResultPub<T> = Result<T, u64>; - -// @has private_type_alias/fn.get_result_priv.html '//pre' 'Result<u8, u16>' -pub fn get_result_priv() -> MyResultPriv<u8> { - panic!(); -} - -// @has private_type_alias/fn.get_result_pub.html '//pre' 'MyResultPub<u32>' -pub fn get_result_pub() -> MyResultPub<u32> { - panic!(); -} - -pub type PubRecursive = u16; -type PrivRecursive3 = u8; -type PrivRecursive2 = PubRecursive; -type PrivRecursive1 = PrivRecursive3; - -// PrivRecursive1 is expanded twice and stops at u8 -// PrivRecursive2 is expanded once and stops at public type alias PubRecursive -// @has private_type_alias/fn.get_result_recursive.html '//pre' '(u8, PubRecursive)' -pub fn get_result_recursive() -> (PrivRecursive1, PrivRecursive2) { - panic!(); -} - -type MyLifetimePriv<'a> = &'a isize; - -// @has private_type_alias/fn.get_lifetime_priv.html '//pre' "&'static isize" -pub fn get_lifetime_priv() -> MyLifetimePriv<'static> { - panic!(); -} diff --git a/src/test/rustdoc/proc-macro.rs b/src/test/rustdoc/proc-macro.rs deleted file mode 100644 index 1e396f1be0e04..0000000000000 --- a/src/test/rustdoc/proc-macro.rs +++ /dev/null @@ -1,71 +0,0 @@ -// force-host -// no-prefer-dynamic - -#![crate_type="proc-macro"] -#![crate_name="some_macros"] - -// @has some_macros/index.html -// @has - '//a/[@href="attr.some_proc_attr.html"]' 'some_proc_attr' - -//! include a link to [some_proc_attr] to make sure it works. - -extern crate proc_macro; - -use proc_macro::TokenStream; - -// @has some_macros/index.html -// @has - '//h2' 'Macros' -// @has - '//h2' 'Attribute Macros' -// @has - '//h2' 'Derive Macros' -// @!has - '//h2' 'Functions' - -// @has some_macros/all.html -// @has - '//a[@href="macro.some_proc_macro.html"]' 'some_proc_macro' -// @has - '//a[@href="attr.some_proc_attr.html"]' 'some_proc_attr' -// @has - '//a[@href="derive.SomeDerive.html"]' 'SomeDerive' -// @!has - '//a/@href' 'fn.some_proc_macro.html' -// @!has - '//a/@href' 'fn.some_proc_attr.html' -// @!has - '//a/@href' 'fn.some_derive.html' - -// @has some_macros/index.html '//a/@href' 'macro.some_proc_macro.html' -// @!has - '//a/@href' 'fn.some_proc_macro.html' -// @has some_macros/macro.some_proc_macro.html -// @!has some_macros/fn.some_proc_macro.html -/// a proc-macro that swallows its input and does nothing. -#[proc_macro] -pub fn some_proc_macro(_input: TokenStream) -> TokenStream { - TokenStream::new() -} - -// @has some_macros/index.html '//a/@href' 'attr.some_proc_attr.html' -// @!has - '//a/@href' 'fn.some_proc_attr.html' -// @has some_macros/attr.some_proc_attr.html -// @!has some_macros/fn.some_proc_attr.html -/// a proc-macro attribute that passes its item through verbatim. -#[proc_macro_attribute] -pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { - item -} - -// @has some_macros/index.html '//a/@href' 'derive.SomeDerive.html' -// @!has - '//a/@href' 'fn.some_derive.html' -// @has some_macros/derive.SomeDerive.html -// @!has some_macros/fn.some_derive.html -/// a derive attribute that adds nothing to its input. -#[proc_macro_derive(SomeDerive)] -pub fn some_derive(_item: TokenStream) -> TokenStream { - TokenStream::new() -} - -// @has some_macros/foo/index.html -pub mod foo { - // @has - '//code' 'pub use some_proc_macro;' - // @has - '//a/@href' '../../some_macros/macro.some_proc_macro.html' - pub use some_proc_macro; - // @has - '//code' 'pub use some_proc_attr;' - // @has - '//a/@href' '../../some_macros/attr.some_proc_attr.html' - pub use some_proc_attr; - // @has - '//code' 'pub use some_derive;' - // @has - '//a/@href' '../../some_macros/derive.SomeDerive.html' - pub use some_derive; -} diff --git a/src/test/rustdoc/process-termination.rs b/src/test/rustdoc/process-termination.rs deleted file mode 100644 index 32258792b6e8b..0000000000000 --- a/src/test/rustdoc/process-termination.rs +++ /dev/null @@ -1,24 +0,0 @@ -// compile-flags:--test - -/// A check of using various process termination strategies -/// -/// # Examples -/// -/// ```rust -/// assert!(true); // this returns `()`, all is well -/// ``` -/// -/// You can also simply return `Ok(())`, but you'll need to disambiguate the -/// type using turbofish, because we cannot infer the type: -/// -/// ```rust -/// Ok::<(), &'static str>(()) -/// ``` -/// -/// You can err with anything that implements `Debug`: -/// -/// ```rust,should_panic -/// Err("This is returned from `main`, leading to panic")?; -/// Ok::<(), &'static str>(()) -/// ``` -pub fn check_process_termination() {} diff --git a/src/test/rustdoc/pub-extern-crate.rs b/src/test/rustdoc/pub-extern-crate.rs deleted file mode 100644 index 26747a4d1aca5..0000000000000 --- a/src/test/rustdoc/pub-extern-crate.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:pub-extern-crate.rs - -// @has pub_extern_crate/index.html -// @!has - '//code' 'pub extern crate inner' -// @has - '//a/@href' 'inner/index.html' -// @has pub_extern_crate/inner/index.html -// @has pub_extern_crate/inner/struct.SomeStruct.html -#[doc(inline)] -pub extern crate inner; diff --git a/src/test/rustdoc/pub-method.rs b/src/test/rustdoc/pub-method.rs deleted file mode 100644 index 8e88b2b59015d..0000000000000 --- a/src/test/rustdoc/pub-method.rs +++ /dev/null @@ -1,20 +0,0 @@ -// compile-flags: --document-private-items - -#![crate_name = "foo"] - -// @has foo/fn.bar.html -// @has - '//*[@class="rust fn"]' 'pub fn bar() -> ' -/// foo -pub fn bar() -> usize { - 2 -} - -// @has foo/struct.Foo.html -// @has - '//*[@class="method"]' 'pub fn new()' -// @has - '//*[@class="method"]' 'fn not_pub()' -pub struct Foo(usize); - -impl Foo { - pub fn new() -> Foo { Foo(0) } - fn not_pub() {} -} diff --git a/src/test/rustdoc/pub-restricted.rs b/src/test/rustdoc/pub-restricted.rs deleted file mode 100644 index f75dcc200bdfc..0000000000000 --- a/src/test/rustdoc/pub-restricted.rs +++ /dev/null @@ -1,34 +0,0 @@ -// ignore-tidy-linelength - -// compile-flags: --document-private-items - -#![feature(crate_visibility_modifier)] - -#![crate_name = "foo"] - -// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic' -pub struct FooPublic; -// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate' -crate struct FooJustCrate; -// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate' -pub(crate) struct FooPubCrate; -// @has 'foo/struct.FooSelf.html' '//pre' 'pub(self) struct FooSelf' -pub(self) struct FooSelf; -// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(self) struct FooInSelf' -pub(in self) struct FooInSelf; -mod a { - // @has 'foo/a/struct.FooSuper.html' '//pre' 'pub(super) struct FooSuper' - pub(super) struct FooSuper; - // @has 'foo/a/struct.FooInSuper.html' '//pre' 'pub(super) struct FooInSuper' - pub(in super) struct FooInSuper; - // @has 'foo/a/struct.FooInA.html' '//pre' 'pub(in a) struct FooInA' - pub(in a) struct FooInA; - mod b { - // @has 'foo/a/b/struct.FooInSelfSuperB.html' '//pre' 'pub(in self::super::b) struct FooInSelfSuperB' - pub(in self::super::b) struct FooInSelfSuperB; - // @has 'foo/a/b/struct.FooInSuperSuper.html' '//pre' 'pub(in super::super) struct FooInSuperSuper' - pub(in super::super) struct FooInSuperSuper; - // @has 'foo/a/b/struct.FooInAB.html' '//pre' 'pub(in a::b) struct FooInAB' - pub(in a::b) struct FooInAB; - } -} diff --git a/src/test/rustdoc/pub-use-extern-macros.rs b/src/test/rustdoc/pub-use-extern-macros.rs deleted file mode 100644 index eefe6b4b07361..0000000000000 --- a/src/test/rustdoc/pub-use-extern-macros.rs +++ /dev/null @@ -1,17 +0,0 @@ -// aux-build:pub-use-extern-macros.rs - -extern crate macros; - -// @has pub_use_extern_macros/macro.bar.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::bar;' -pub use macros::bar; - -// @has pub_use_extern_macros/macro.baz.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::baz;' -#[doc(inline)] -pub use macros::baz; - -// @!has pub_use_extern_macros/macro.quux.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::quux;' -#[doc(hidden)] -pub use macros::quux; diff --git a/src/test/rustdoc/recursion1.rs b/src/test/rustdoc/recursion1.rs deleted file mode 100644 index edf7e440fe7c4..0000000000000 --- a/src/test/rustdoc/recursion1.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_type = "lib"] - -mod m { - pub use self::a::Foo; - - mod a { - pub struct Foo; - } - - mod b { - pub use super::*; - } -} diff --git a/src/test/rustdoc/recursion2.rs b/src/test/rustdoc/recursion2.rs deleted file mode 100644 index edf7e440fe7c4..0000000000000 --- a/src/test/rustdoc/recursion2.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_type = "lib"] - -mod m { - pub use self::a::Foo; - - mod a { - pub struct Foo; - } - - mod b { - pub use super::*; - } -} diff --git a/src/test/rustdoc/recursion3.rs b/src/test/rustdoc/recursion3.rs deleted file mode 100644 index e69b4301646b7..0000000000000 --- a/src/test/rustdoc/recursion3.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub mod longhands { - pub use super::*; - - pub use super::common_types::computed::compute_CSSColor as to_computed_value; - - pub fn computed_as_specified() {} -} - -pub mod common_types { - pub mod computed { - pub use super::super::longhands::computed_as_specified as compute_CSSColor; - } -} diff --git a/src/test/rustdoc/redirect-const.rs b/src/test/rustdoc/redirect-const.rs deleted file mode 100644 index 453da8387eadc..0000000000000 --- a/src/test/rustdoc/redirect-const.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name="foo"] - -pub use hidden::STATIC_FOO; -pub use hidden::CONST_FOO; - -mod hidden { - // @has foo/hidden/static.STATIC_FOO.html - // @has - '//p/a' '../../foo/static.STATIC_FOO.html' - pub static STATIC_FOO: u64 = 0; - // @has foo/hidden/constant.CONST_FOO.html - // @has - '//p/a' '../../foo/constant.CONST_FOO.html' - pub const CONST_FOO: u64 = 0; -} diff --git a/src/test/rustdoc/redirect-rename.rs b/src/test/rustdoc/redirect-rename.rs deleted file mode 100644 index 7de56080e52b9..0000000000000 --- a/src/test/rustdoc/redirect-rename.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![crate_name = "foo"] - -mod hidden { - // @has foo/hidden/struct.Foo.html - // @has - '//p/a' '../../foo/struct.FooBar.html' - pub struct Foo {} - - // @has foo/hidden/bar/index.html - // @has - '//p/a' '../../foo/baz/index.html' - pub mod bar { - // @has foo/hidden/bar/struct.Thing.html - // @has - '//p/a' '../../foo/baz/struct.Thing.html' - pub struct Thing {} - } -} - -// @has foo/struct.FooBar.html -pub use hidden::Foo as FooBar; - -// @has foo/baz/index.html -// @has foo/baz/struct.Thing.html -pub use hidden::bar as baz; diff --git a/src/test/rustdoc/redirect.rs b/src/test/rustdoc/redirect.rs deleted file mode 100644 index e3a14c7a74a00..0000000000000 --- a/src/test/rustdoc/redirect.rs +++ /dev/null @@ -1,39 +0,0 @@ -// aux-build:reexp-stripped.rs -// build-aux-docs -// ignore-cross-compile - -extern crate reexp_stripped; - -pub trait Foo {} - -// @has redirect/index.html -// @has - '//code' 'pub use reexp_stripped::Bar' -// @has - '//code/a' 'Bar' -// @has reexp_stripped/hidden/struct.Bar.html -// @has - '//p/a' '../../reexp_stripped/struct.Bar.html' -// @has 'reexp_stripped/struct.Bar.html' -#[doc(no_inline)] -pub use reexp_stripped::Bar; -impl Foo for Bar {} - -// @has redirect/index.html -// @has - '//code' 'pub use reexp_stripped::Quz' -// @has - '//code/a' 'Quz' -// @has reexp_stripped/private/struct.Quz.html -// @has - '//p/a' '../../reexp_stripped/struct.Quz.html' -// @has 'reexp_stripped/struct.Quz.html' -#[doc(no_inline)] -pub use reexp_stripped::Quz; -impl Foo for Quz {} - -mod private_no_inline { - pub struct Qux; - impl ::Foo for Qux {} -} - -// @has redirect/index.html -// @has - '//code' 'pub use private_no_inline::Qux' -// @!has - '//a' 'Qux' -// @!has redirect/struct.Qux.html -#[doc(no_inline)] -pub use private_no_inline::Qux; diff --git a/src/test/rustdoc/remove-duplicates.rs b/src/test/rustdoc/remove-duplicates.rs deleted file mode 100644 index 759bf84db6211..0000000000000 --- a/src/test/rustdoc/remove-duplicates.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![crate_name = "foo"] - -mod foo { - pub use bar::*; - pub mod bar { - pub trait Foo { - fn foo(); - } - } -} - -// @count foo/index.html '//*[@class="trait"]' 1 -pub use foo::bar::*; -pub use foo::*; diff --git a/src/test/rustdoc/rustc-macro-crate.rs b/src/test/rustdoc/rustc-macro-crate.rs deleted file mode 100644 index 2f6308b20c2ee..0000000000000 --- a/src/test/rustdoc/rustc-macro-crate.rs +++ /dev/null @@ -1,13 +0,0 @@ -// force-host -// no-prefer-dynamic - -#![crate_type = "proc-macro"] - -extern crate proc_macro; - -use proc_macro::TokenStream; - -#[proc_macro_derive(Foo)] -pub fn foo(input: TokenStream) -> TokenStream { - input -} diff --git a/src/test/rustdoc/rustc_deprecated-future.rs b/src/test/rustdoc/rustc_deprecated-future.rs deleted file mode 100644 index 3133775706b8d..0000000000000 --- a/src/test/rustdoc/rustc_deprecated-future.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(staged_api)] - -#![stable(feature = "rustc_deprecated-future-test", since = "1.0.0")] - -// @has rustc_deprecated_future/index.html '//*[@class="stab deprecated"]' \ -// 'Deprecation planned' -// @has rustc_deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ -// 'Deprecating in 99.99.99: effectively never' -#[rustc_deprecated(since = "99.99.99", reason = "effectively never")] -#[stable(feature = "rustc_deprecated-future-test", since = "1.0.0")] -pub struct S; diff --git a/src/test/rustdoc/search-index-summaries.rs b/src/test/rustdoc/search-index-summaries.rs deleted file mode 100644 index dd9c1a0b47dfc..0000000000000 --- a/src/test/rustdoc/search-index-summaries.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_name = "foo"] - -// @has 'search-index.js' 'Foo short link.' -// @!has - 'www.example.com' -// @!has - 'More Foo.' - -/// Foo short [link](https://www.example.com/). -/// -/// More Foo. -pub struct Foo; diff --git a/src/test/rustdoc/search-index.rs b/src/test/rustdoc/search-index.rs deleted file mode 100644 index f1b78f17277d1..0000000000000 --- a/src/test/rustdoc/search-index.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![crate_name = "rustdoc_test"] - -use std::ops::Deref; - -// @has search-index.js Foo -pub use private::Foo; - -mod private { - pub struct Foo; - impl Foo { - pub fn test_method() {} // @has - test_method - fn priv_method() {} // @!has - priv_method - } - - pub trait PrivateTrait { - fn trait_method(&self) {} // @!has - priv_method - } -} - -pub struct Bar; - -impl Deref for Bar { - // @!has search-index.js Target - type Target = Bar; - fn deref(&self) -> &Bar { self } -} diff --git a/src/test/rustdoc/short-docblock-codeblock.rs b/src/test/rustdoc/short-docblock-codeblock.rs deleted file mode 100644 index fc8d53ccf3501..0000000000000 --- a/src/test/rustdoc/short-docblock-codeblock.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/index.html '//*[@class="module-item"]//td[@class="docblock-short"]' "" -// @!has foo/index.html '//*[@id="module-item"]//td[@class="docblock-short"]' "Some text." -// @!has foo/index.html '//*[@id="module-item"]//td[@class="docblock-short"]' "let x = 12;" - -/// ``` -/// let x = 12; -/// ``` -/// -/// Some text. -pub fn foo() {} diff --git a/src/test/rustdoc/short-dockblock.rs b/src/test/rustdoc/short-dockblock.rs deleted file mode 100644 index 5493bca54c5dc..0000000000000 --- a/src/test/rustdoc/short-dockblock.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/index.html '//*[@class="docblock-short"]/p' 'fooo' -// @!has foo/index.html '//*[@class="docblock-short"]/p/h1' 'fooo' -// @has foo/fn.foo.html '//h1[@id="fooo"]/a[@href="#fooo"]' 'fooo' - -/// # fooo -/// -/// foo -pub fn foo() {} - -// @has foo/index.html '//*[@class="docblock-short"]/p' 'mooood' -// @!has foo/index.html '//*[@class="docblock-short"]/p/h2' 'mooood' -// @has foo/foo/index.html '//h2[@id="mooood"]/a[@href="#mooood"]' 'mooood' - -/// ## mooood -/// -/// foo mod -pub mod foo {} - -// @has foo/index.html '//*[@class="docblock-short"]/p/a[@href=\ -// "https://nougat.world"]/code' 'nougat' - -/// [`nougat`](https://nougat.world) -pub struct Bar; diff --git a/src/test/rustdoc/sidebar-items.rs b/src/test/rustdoc/sidebar-items.rs deleted file mode 100644 index 3ba6dbacc8d32..0000000000000 --- a/src/test/rustdoc/sidebar-items.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/trait.Foo.html -// @has - '//*[@class="sidebar-title"][@href="#required-methods"]' 'Required Methods' -// @has - '//*[@class="sidebar-links"]/a' 'bar' -// @has - '//*[@class="sidebar-title"][@href="#provided-methods"]' 'Provided Methods' -// @has - '//*[@class="sidebar-links"]/a' 'foo' -// @has - '//*[@class="sidebar-title"][@href="#associated-const"]' 'Associated Constants' -// @has - '//*[@class="sidebar-links"]/a' 'BAR' -// @has - '//*[@class="sidebar-title"][@href="#associated-types"]' 'Associated Types' -// @has - '//*[@class="sidebar-links"]/a' 'Output' -pub trait Foo { - const BAR: u32 = 0; - type Output: ?Sized; - - fn foo() {} - fn bar() -> Self::Output; -} - -// @has foo/struct.Bar.html -// @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields' -// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f"]' 'f' -// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.u"]' 'u' -// @!has - '//*[@class="sidebar-links"]/a' 'waza' -pub struct Bar { - pub f: u32, - pub u: u32, - waza: u32, -} - -// @has foo/enum.En.html -// @has - '//*[@class="sidebar-title"][@href="#variants"]' 'Variants' -// @has - '//*[@class="sidebar-links"]/a' 'foo' -// @has - '//*[@class="sidebar-links"]/a' 'bar' -pub enum En { - foo, - bar, -} - -// @has foo/union.MyUnion.html -// @has - '//*[@class="sidebar-title"][@href="#fields"]' 'Fields' -// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f1"]' 'f1' -// @has - '//*[@class="sidebar-links"]/a[@href="#structfield.f2"]' 'f2' -// @!has - '//*[@class="sidebar-links"]/a' 'waza' -pub union MyUnion { - pub f1: u32, - pub f2: f32, - waza: u32, -} diff --git a/src/test/rustdoc/sidebar-link-generation.rs b/src/test/rustdoc/sidebar-link-generation.rs deleted file mode 100644 index 76b77b9bcbb6b..0000000000000 --- a/src/test/rustdoc/sidebar-link-generation.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/struct.SomeStruct.html '//*[@class="sidebar-links"]/a[@href="#method.some_fn-1"]' \ -// "some_fn" -pub struct SomeStruct<T> { _inner: T } - -impl SomeStruct<()> { - pub fn some_fn(&self) {} -} - -impl SomeStruct<usize> { - pub fn some_fn(&self) {} -} diff --git a/src/test/rustdoc/sidebar-links-to-foreign-impl.rs b/src/test/rustdoc/sidebar-links-to-foreign-impl.rs deleted file mode 100644 index 6219a2c3b9073..0000000000000 --- a/src/test/rustdoc/sidebar-links-to-foreign-impl.rs +++ /dev/null @@ -1,16 +0,0 @@ -// issue #56018: "Implementations on Foreign Types" sidebar items should link to specific impls - -#![crate_name = "foo"] - -// @has foo/trait.Foo.html -// @has - '//*[@class="sidebar-title"][@href="#foreign-impls"]' 'Implementations on Foreign Types' -// @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types' -// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-u32"]' 'u32' -// @has - '//h3[@id="impl-Foo-for-u32"]//code' 'impl Foo for u32' -// @has - '//*[@class="sidebar-links"]/a[@href="#impl-Foo-for-%26%27a%20str"]' "&'a str" -// @has - '//h3[@id="impl-Foo-for-%26%27a%20str"]//code' "impl<'a> Foo for &'a str" -pub trait Foo {} - -impl Foo for u32 {} - -impl<'a> Foo for &'a str {} diff --git a/src/test/rustdoc/smoke.rs b/src/test/rustdoc/smoke.rs deleted file mode 100644 index c1ed3a0c95351..0000000000000 --- a/src/test/rustdoc/smoke.rs +++ /dev/null @@ -1,25 +0,0 @@ -// @has smoke/index.html - -//! Very docs - -// @has smoke/bar/index.html -pub mod bar { - - /// So correct - // @has smoke/bar/baz/index.html - pub mod baz { - /// Much detail - // @has smoke/bar/baz/fn.baz.html - pub fn baz() { } - } - - /// *wow* - // @has smoke/bar/trait.Doge.html - pub trait Doge { fn dummy(&self) { } } - - // @has smoke/bar/struct.Foo.html - pub struct Foo { x: isize, y: usize } - - // @has smoke/bar/fn.prawns.html - pub fn prawns((a, b): (isize, usize), Foo { x, y }: Foo) { } -} diff --git a/src/test/rustdoc/sort-modules-by-appearance.rs b/src/test/rustdoc/sort-modules-by-appearance.rs deleted file mode 100644 index 5be6b98264a10..0000000000000 --- a/src/test/rustdoc/sort-modules-by-appearance.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Tests the rustdoc --sort-modules-by-appearance option, that allows module declarations to appear -// in the order they are declared in the source code, rather than only alphabetically. - -// compile-flags: -Z unstable-options --sort-modules-by-appearance - -pub mod module_b {} - -pub mod module_c {} - -pub mod module_a {} - -// @matches 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a' -// @matches 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"' diff --git a/src/test/rustdoc/source-file.rs b/src/test/rustdoc/source-file.rs deleted file mode 100644 index 968899dab8852..0000000000000 --- a/src/test/rustdoc/source-file.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -// @has source-files.js source-file.rs - -pub struct Foo; diff --git a/src/test/rustdoc/src-links-external.rs b/src/test/rustdoc/src-links-external.rs deleted file mode 100644 index 0469e4ad62477..0000000000000 --- a/src/test/rustdoc/src-links-external.rs +++ /dev/null @@ -1,14 +0,0 @@ -// aux-build:src-links-external.rs -// build-aux-docs -// ignore-cross-compile -// ignore-tidy-linelength - -#![crate_name = "foo"] - -extern crate src_links_external; - -// @has foo/bar/index.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' -#[doc(inline)] -pub use src_links_external as bar; - -// @has foo/bar/struct.Foo.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' diff --git a/src/test/rustdoc/src-links.rs b/src/test/rustdoc/src-links.rs deleted file mode 100644 index 353ce10243e00..0000000000000 --- a/src/test/rustdoc/src-links.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![crate_name = "foo"] - -//! Dox -// @has src/foo/src-links.rs.html -// @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html' - -#[path = "src-links/mod.rs"] -pub mod qux; - -// @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html' -pub mod bar { - - /// Dox - // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html' - pub mod baz { - /// Dox - // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html' - pub fn baz() { } - } - - /// Dox - // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html' - pub trait Foobar { fn dummy(&self) { } } - - // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html' - pub struct Foo { x: i32, y: u32 } - - // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html' - pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { } -} - -/// Dox -// @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html' -pub fn modfn() { } - -// same hierarchy as above, but just for the submodule - -// @has src/foo/src-links/mod.rs.html -// @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html' diff --git a/src/test/rustdoc/src-links/compiletest-ignore-dir b/src/test/rustdoc/src-links/compiletest-ignore-dir deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/test/rustdoc/src-links/mod.rs b/src/test/rustdoc/src-links/mod.rs deleted file mode 100644 index 27b2396811a66..0000000000000 --- a/src/test/rustdoc/src-links/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! Dox -pub mod bar { - - /// Dox - pub mod baz { - /// Dox - pub fn baz() { } - } - - /// Dox - pub trait Foobar { fn dummy(&self) { } } - - pub struct Foo { x: i32, y: u32 } - - pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { } -} - -/// Dox -pub fn modfn() { } diff --git a/src/test/rustdoc/stability.rs b/src/test/rustdoc/stability.rs deleted file mode 100644 index 18a21603493c2..0000000000000 --- a/src/test/rustdoc/stability.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(staged_api)] - -#![unstable(feature = "test", issue = "0")] - -pub struct Unstable { - // @has stability/struct.Unstable.html \ - // '//div[@class="stability"]//div[@class="stab unstable"]' \ - // 'This is a nightly-only experimental API' - // @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0 - pub foo: u32, - pub bar: u32, -} diff --git a/src/test/rustdoc/static-root-path.rs b/src/test/rustdoc/static-root-path.rs deleted file mode 100644 index 2f7c89c5f1e6b..0000000000000 --- a/src/test/rustdoc/static-root-path.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:-Z unstable-options --static-root-path /cache/ - -// @has static_root_path/struct.SomeStruct.html -// @matches - '"/cache/main\.js"' -// @!matches - '"\.\./main\.js"' -// @matches - '"\.\./search-index\.js"' -// @!matches - '"/cache/search-index\.js"' -pub struct SomeStruct; - -// @has src/static_root_path/static-root-path.rs.html -// @matches - '"/cache/source-script\.js"' -// @!matches - '"\.\./\.\./source-script\.js"' -// @matches - '"\.\./\.\./source-files.js"' -// @!matches - '"/cache/source-files\.js"' - -// @has settings.html -// @matches - '/cache/settings\.js' -// @!matches - '\./settings\.js' diff --git a/src/test/rustdoc/struct-field.rs b/src/test/rustdoc/struct-field.rs deleted file mode 100644 index c99169fbca57f..0000000000000 --- a/src/test/rustdoc/struct-field.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/struct.Foo.html#structfield.bar"]' 'Foo::bar' -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/union.Bar.html#structfield.foo"]' 'Bar::foo' -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="../foo/enum.Uniooon.html#X.v"]' 'Uniooon::X' - -//! Test with [Foo::bar], [Bar::foo], [Uniooon::X] - -pub struct Foo { - pub bar: usize, -} - -pub union Bar { - pub foo: u32, -} - -pub enum Uniooon { - F, - X, - Y, -} diff --git a/src/test/rustdoc/structfields.rs b/src/test/rustdoc/structfields.rs deleted file mode 100644 index 235f0e852da2c..0000000000000 --- a/src/test/rustdoc/structfields.rs +++ /dev/null @@ -1,52 +0,0 @@ -// compile-flags:-Z unstable-options --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: (), - // @has - //pre "// some fields omitted" - // @!has - //pre "b: ()" - b: (), - // @!has - //pre "c: usize" - #[doc(hidden)] - c: usize, - // @has - //pre "pub d: usize" - pub d: usize, -} - -// @has structfields/Bar.t.html -// @has - struct.Bar.html -// @has structfields/struct.Bar.html -pub struct Bar { - // @has - //pre "pub a: ()" - pub a: (), - // @!has - //pre "// some fields omitted" -} - -// @has structfields/Qux.t.html -// @has - enum.Qux.html -// @has structfields/enum.Qux.html -pub enum Qux { - Quz { - // @has - //pre "a: ()" - a: (), - // @!has - //pre "b: ()" - #[doc(hidden)] - b: (), - // @has - //pre "c: usize" - c: usize, - // @has - //pre "// some fields omitted" - }, -} - -// @has structfields/struct.Baz.html //pre "pub struct Baz { /* fields omitted */ }" -pub struct Baz { - x: u8, - #[doc(hidden)] - pub y: u8, -} - -// @has structfields/struct.Quux.html //pre "pub struct Quux {}" -pub struct Quux {} diff --git a/src/test/rustdoc/synthetic_auto/basic.rs b/src/test/rustdoc/synthetic_auto/basic.rs deleted file mode 100644 index d5f1269d08a4c..0000000000000 --- a/src/test/rustdoc/synthetic_auto/basic.rs +++ /dev/null @@ -1,8 +0,0 @@ -// @has basic/struct.Foo.html -// @has - '//code' 'impl<T> Send for Foo<T> where T: Send' -// @has - '//code' 'impl<T> Sync for Foo<T> where T: Sync' -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 0 -// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 2 -pub struct Foo<T> { - field: T, -} diff --git a/src/test/rustdoc/synthetic_auto/complex.rs b/src/test/rustdoc/synthetic_auto/complex.rs deleted file mode 100644 index 80a717718c22b..0000000000000 --- a/src/test/rustdoc/synthetic_auto/complex.rs +++ /dev/null @@ -1,42 +0,0 @@ -mod foo { - pub trait MyTrait<'a> { - type MyItem: ?Sized; - } - - pub struct Inner<'a, Q, R: ?Sized> { - field: Q, - field3: &'a u8, - my_foo: Foo<Q>, - field2: R, - } - - pub struct Outer<'a, T, K: ?Sized> { - my_inner: Inner<'a, T, K>, - } - - pub struct Foo<T> { - myfield: T, - } -} - -// @has complex/struct.NotOuter.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'a, T, K: \ -// ?Sized> Send for Outer<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \ -// -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static" - -pub use foo::{Foo, Inner as NotInner, MyTrait as NotMyTrait, Outer as NotOuter}; - -unsafe impl<T> Send for Foo<T> -where - T: NotMyTrait<'static>, -{ -} - -unsafe impl<'a, Q, R: ?Sized> Send for NotInner<'a, Q, R> -where - Q: NotMyTrait<'a>, - <Q as NotMyTrait<'a>>::MyItem: Copy, - R: for<'b> Fn((&'b bool, &'a u8)) -> &'b i8, - Foo<Q>: Send, -{ -} diff --git a/src/test/rustdoc/synthetic_auto/lifetimes.rs b/src/test/rustdoc/synthetic_auto/lifetimes.rs deleted file mode 100644 index 6d0a68f9b0734..0000000000000 --- a/src/test/rustdoc/synthetic_auto/lifetimes.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub struct Inner<'a, T: 'a> { - field: &'a T, -} - -unsafe impl<'a, T> Send for Inner<'a, T> -where - 'a: 'static, - T: for<'b> Fn(&'b bool) -> &'a u8, -{} - -// @has lifetimes/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'c, K> Send \ -// for Foo<'c, K> where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static" -// -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'c, K> Sync \ -// for Foo<'c, K> where K: Sync" -pub struct Foo<'c, K: 'c> { - inner_field: Inner<'c, K>, -} diff --git a/src/test/rustdoc/synthetic_auto/manual.rs b/src/test/rustdoc/synthetic_auto/manual.rs deleted file mode 100644 index 413ba187f4556..0000000000000 --- a/src/test/rustdoc/synthetic_auto/manual.rs +++ /dev/null @@ -1,14 +0,0 @@ -// @has manual/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' 'impl<T> Sync for \ -// Foo<T> where T: Sync' -// -// @has - '//*[@id="implementations-list"]/*[@class="impl"]//code' \ -// 'impl<T> Send for Foo<T>' -// -// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 1 -// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 1 -pub struct Foo<T> { - field: T, -} - -unsafe impl<T> Send for Foo<T> {} diff --git a/src/test/rustdoc/synthetic_auto/negative.rs b/src/test/rustdoc/synthetic_auto/negative.rs deleted file mode 100644 index 30713849da221..0000000000000 --- a/src/test/rustdoc/synthetic_auto/negative.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub struct Inner<T: Copy> { - field: *mut T, -} - -// @has negative/struct.Outer.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> !Send for \ -// Outer<T>" -// -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> \ -// !Sync for Outer<T>" -pub struct Outer<T: Copy> { - inner_field: Inner<T>, -} diff --git a/src/test/rustdoc/synthetic_auto/nested.rs b/src/test/rustdoc/synthetic_auto/nested.rs deleted file mode 100644 index e710ce1c2ed95..0000000000000 --- a/src/test/rustdoc/synthetic_auto/nested.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub struct Inner<T> { - field: T, -} - -unsafe impl<T> Send for Inner<T> -where - T: Copy, -{ -} - -// @has nested/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' 'impl<T> Send for \ -// Foo<T> where T: Copy' -// -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' \ -// 'impl<T> Sync for Foo<T> where T: Sync' -pub struct Foo<T> { - inner_field: Inner<T>, -} diff --git a/src/test/rustdoc/synthetic_auto/no-redundancy.rs b/src/test/rustdoc/synthetic_auto/no-redundancy.rs deleted file mode 100644 index cf173111ec1e2..0000000000000 --- a/src/test/rustdoc/synthetic_auto/no-redundancy.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub struct Inner<T> { - field: T, -} - -unsafe impl<T> Send for Inner<T> -where - T: Copy + Send, -{ -} - -// @has no_redundancy/struct.Outer.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> Send for \ -// Outer<T> where T: Copy + Send" -pub struct Outer<T> { - inner_field: Inner<T>, -} diff --git a/src/test/rustdoc/synthetic_auto/project.rs b/src/test/rustdoc/synthetic_auto/project.rs deleted file mode 100644 index 5346521f8d2e3..0000000000000 --- a/src/test/rustdoc/synthetic_auto/project.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub struct Inner<'a, T: 'a> { - field: &'a T, -} - -trait MyTrait { - type MyItem; -} - -trait OtherTrait {} - -unsafe impl<'a, T> Send for Inner<'a, T> -where - 'a: 'static, - T: MyTrait<MyItem = bool>, -{ -} -unsafe impl<'a, T> Sync for Inner<'a, T> -where - 'a: 'static, - T: MyTrait, - <T as MyTrait>::MyItem: OtherTrait, -{ -} - -// @has project/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'c, K> Send \ -// for Foo<'c, K> where K: MyTrait<MyItem = bool>, 'c: 'static" -// -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<'c, K> Sync \ -// for Foo<'c, K> where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, 'c: 'static," -pub struct Foo<'c, K: 'c> { - inner_field: Inner<'c, K>, -} diff --git a/src/test/rustdoc/synthetic_auto/self-referential.rs b/src/test/rustdoc/synthetic_auto/self-referential.rs deleted file mode 100644 index 905aa20918bef..0000000000000 --- a/src/test/rustdoc/synthetic_auto/self-referential.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Some unusual code minimized from -// https://github.com/sile/handy_async/tree/7b619b762c06544fc67792c8ff8ebc24a88fdb98 - -pub trait Pattern { - type Value; -} - -pub struct Constrain<A, B = A, C = A>(A, B, C); - -impl<A, B, C> Pattern for Constrain<A, B, C> - where A: Pattern, - B: Pattern<Value = A::Value>, - C: Pattern<Value = A::Value>, -{ - type Value = A::Value; -} - -pub struct Wrapper<T>(T); - -impl<T> Pattern for Wrapper<T> { - type Value = T; -} - - -// @has self_referential/struct.WriteAndThen.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<P1> Send for \ -// WriteAndThen<P1> where <P1 as Pattern>::Value: Send" -pub struct WriteAndThen<P1>(pub P1::Value,pub <Constrain<P1, Wrapper<P1::Value>> as Pattern>::Value) - where P1: Pattern; diff --git a/src/test/rustdoc/synthetic_auto/static-region.rs b/src/test/rustdoc/synthetic_auto/static-region.rs deleted file mode 100644 index 59493744b623d..0000000000000 --- a/src/test/rustdoc/synthetic_auto/static-region.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub trait OwnedTrait<'a> { - type Reader; -} - -// @has static_region/struct.Owned.html -// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//code' "impl<T> Send for \ -// Owned<T> where <T as OwnedTrait<'static>>::Reader: Send" -pub struct Owned<T> where T: OwnedTrait<'static> { - marker: <T as OwnedTrait<'static>>::Reader, -} diff --git a/src/test/rustdoc/test-lists.rs b/src/test/rustdoc/test-lists.rs deleted file mode 100644 index 6a510b9ac5d1c..0000000000000 --- a/src/test/rustdoc/test-lists.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.f.html -// @has - //ol/li "list" -// @has - //ol/li/ol/li "fooooo" -// @has - //ol/li/ol/li "x" -// @has - //ol/li "foo" -/// 1. list -/// 1. fooooo -/// 2. x -/// 2. foo -pub fn f() {} - -// @has foo/fn.foo2.html -// @has - //ul/li "normal list" -// @has - //ul/li/ul/li "sub list" -// @has - //ul/li/ul/li "new elem still same elem and again same elem!" -// @has - //ul/li "new big elem" -/// * normal list -/// * sub list -/// * new elem -/// still same elem -/// -/// and again same elem! -/// * new big elem -pub fn foo2() {} diff --git a/src/test/rustdoc/test-parens.rs b/src/test/rustdoc/test-parens.rs deleted file mode 100644 index d9b9c7957d9a1..0000000000000 --- a/src/test/rustdoc/test-parens.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.foo.html -// @has - '//*[@class="rust fn"]' "_: &(dyn ToString + 'static)" -pub fn foo(_: &(ToString + 'static)) {} diff --git a/src/test/rustdoc/test_option_check/bar.rs b/src/test/rustdoc/test_option_check/bar.rs deleted file mode 100644 index 50a182cf7e049..0000000000000 --- a/src/test/rustdoc/test_option_check/bar.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags: --test -// check-test-line-numbers-match - -/// This looks like another awesome test! -/// -/// ``` -/// println!("foo?"); -/// ``` -pub fn foooo() {} diff --git a/src/test/rustdoc/test_option_check/test.rs b/src/test/rustdoc/test_option_check/test.rs deleted file mode 100644 index 964e8e37ed581..0000000000000 --- a/src/test/rustdoc/test_option_check/test.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags: --test -// check-test-line-numbers-match - -pub mod bar; - -/// This is a Foo; -/// -/// ``` -/// println!("baaaaaar"); -/// ``` -pub struct Foo; - -/// This is a Bar; -/// -/// ``` -/// println!("fooooo"); -/// ``` -pub struct Bar; diff --git a/src/test/rustdoc/titles.rs b/src/test/rustdoc/titles.rs deleted file mode 100644 index 3b4c42d865d06..0000000000000 --- a/src/test/rustdoc/titles.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![crate_name = "foo"] - -// @matches 'foo/index.html' '//h1' 'Crate foo' - -// @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod' -pub mod foo_mod { - pub struct __Thing {} -} - -extern { - // @matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn' - pub fn foo_ffn(); -} - -// @matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn' -pub fn foo_fn() {} - -// @matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait' -pub trait FooTrait {} - -// @matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct' -pub struct FooStruct; - -// @matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum' -pub enum FooEnum {} - -// @matches 'foo/type.FooType.html' '//h1' 'Type Definition foo::FooType' -pub type FooType = FooStruct; - -// @matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro' -#[macro_export] -macro_rules! foo_macro { - () => (); -} - -// @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool' -#[doc(primitive = "bool")] -mod bool {} - -// @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC' -pub static FOO_STATIC: FooStruct = FooStruct; - -extern { - // @matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC' - pub static FOO_FSTATIC: FooStruct; -} - -// @matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT' -pub const FOO_CONSTANT: FooStruct = FooStruct; diff --git a/src/test/rustdoc/trait-attributes.rs b/src/test/rustdoc/trait-attributes.rs deleted file mode 100644 index 971e6b554cca7..0000000000000 --- a/src/test/rustdoc/trait-attributes.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![crate_name = "foo"] - -// ignore-tidy-linelength - -pub trait Foo { - // @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//div[@class="docblock attributes"]' '#[must_use]' - #[must_use] - fn foo(); -} - -#[must_use] -pub struct Bar; - -impl Bar { - // @has foo/struct.Bar.html '//h4[@id="method.bar"]//div[@class="docblock attributes"]' '#[must_use]' - #[must_use] - pub fn bar() {} - - // @has foo/struct.Bar.html '//h4[@id="method.bar2"]//div[@class="docblock attributes"]' '#[must_use]' - #[must_use] - pub fn bar2() {} -} diff --git a/src/test/rustdoc/trait-self-link.rs b/src/test/rustdoc/trait-self-link.rs deleted file mode 100644 index 51e1fe91f9672..0000000000000 --- a/src/test/rustdoc/trait-self-link.rs +++ /dev/null @@ -1,6 +0,0 @@ -// @!has trait_self_link/trait.Foo.html //a/@href ../trait_self_link/trait.Foo.html -pub trait Foo {} - -pub struct Bar; - -impl Foo for Bar {} diff --git a/src/test/rustdoc/trait_alias.rs b/src/test/rustdoc/trait_alias.rs deleted file mode 100644 index 98b8d879ac078..0000000000000 --- a/src/test/rustdoc/trait_alias.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(trait_alias)] - -#![crate_name = "foo"] - -use std::fmt::Debug; - -// @has foo/all.html '//a[@href="traitalias.CopyAlias.html"]' 'CopyAlias' -// @has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2' -// @has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo' - -// @has foo/index.html '//h2[@id="trait-aliases"]' 'Trait aliases' -// @has foo/index.html '//a[@class="traitalias"]' 'CopyAlias' -// @has foo/index.html '//a[@class="traitalias"]' 'Alias2' -// @has foo/index.html '//a[@class="traitalias"]' 'Foo' - -// @has foo/traitalias.CopyAlias.html '//section[@id="main"]/pre' 'trait CopyAlias = Copy;' -pub trait CopyAlias = Copy; -// @has foo/traitalias.Alias2.html '//section[@id="main"]/pre' 'trait Alias2 = Copy + Debug;' -pub trait Alias2 = Copy + Debug; -// @has foo/traitalias.Foo.html '//section[@id="main"]/pre' 'trait Foo<T> = Into<T> + Debug;' -pub trait Foo<T> = Into<T> + Debug; diff --git a/src/test/rustdoc/traits-in-bodies-private.rs b/src/test/rustdoc/traits-in-bodies-private.rs deleted file mode 100644 index 96b7c4f9dc07a..0000000000000 --- a/src/test/rustdoc/traits-in-bodies-private.rs +++ /dev/null @@ -1,13 +0,0 @@ -// when implementing the fix for traits-in-bodies, there was an ICE when documenting private items -// and a trait was defined in non-module scope - -// compile-flags:--document-private-items - -// @has traits_in_bodies_private/struct.SomeStruct.html -// @!has - '//code' 'impl HiddenTrait for SomeStruct' -pub struct SomeStruct; - -fn __implementation_details() { - trait HiddenTrait {} - impl HiddenTrait for SomeStruct {} -} diff --git a/src/test/rustdoc/traits-in-bodies.rs b/src/test/rustdoc/traits-in-bodies.rs deleted file mode 100644 index 1c3727a5748e6..0000000000000 --- a/src/test/rustdoc/traits-in-bodies.rs +++ /dev/null @@ -1,52 +0,0 @@ -//prior to fixing `everybody_loops` to preserve items, rustdoc would crash on this file, as it -//didn't see that `SomeStruct` implemented `Clone` - -pub struct Bounded<T: Clone>(T); - -// @has traits_in_bodies/struct.SomeStruct.html -// @has - '//code' 'impl Clone for SomeStruct' -pub struct SomeStruct; - -fn asdf() -> Bounded<SomeStruct> { - impl Clone for SomeStruct { - fn clone(&self) -> SomeStruct { - SomeStruct - } - } - - Bounded(SomeStruct) -} - -// @has traits_in_bodies/struct.Point.html -// @has - '//code' 'impl Copy for Point' -#[derive(Clone)] -pub struct Point { - x: i32, - y: i32, -} - -const _FOO: () = { - impl Copy for Point {} - () -}; - -// @has traits_in_bodies/struct.Inception.html -// @has - '//code' 'impl Clone for Inception' -pub struct Inception; - -static _BAR: usize = { - trait HiddenTrait { - fn hidden_fn(&self) { - for _ in 0..5 { - impl Clone for Inception { - fn clone(&self) -> Self { - // we need to go deeper - Inception - } - } - } - } - } - - 5 -}; diff --git a/src/test/rustdoc/tuples.rs b/src/test/rustdoc/tuples.rs deleted file mode 100644 index 53654abff2a8e..0000000000000 --- a/src/test/rustdoc/tuples.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.tuple0.html //pre 'pub fn tuple0(x: ())' -pub fn tuple0(x: ()) -> () { x } -// @has foo/fn.tuple1.html //pre 'pub fn tuple1(x: (i32,)) -> (i32,)' -pub fn tuple1(x: (i32,)) -> (i32,) { x } -// @has foo/fn.tuple2.html //pre 'pub fn tuple2(x: (i32, i32)) -> (i32, i32)' -pub fn tuple2(x: (i32, i32)) -> (i32, i32) { x } diff --git a/src/test/rustdoc/typedef.rs b/src/test/rustdoc/typedef.rs deleted file mode 100644 index 80351ff52f5cc..0000000000000 --- a/src/test/rustdoc/typedef.rs +++ /dev/null @@ -1,25 +0,0 @@ -pub trait MyTrait { - fn method_on_mytrait() {} -} - -pub struct MyStruct; - -impl MyStruct { - pub fn method_on_mystruct() {} -} - -// @has typedef/type.MyAlias.html -// @has - '//*[@class="impl"]//code' 'impl MyAlias' -// @has - '//*[@class="impl"]//code' 'impl MyTrait for MyAlias' -// @has - 'Alias docstring' -// @has - '//*[@class="sidebar"]//p[@class="location"]' 'Type Definition MyAlias' -// @has - '//*[@class="sidebar"]//a[@href="#methods"]' 'Methods' -// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Trait Implementations' -/// Alias docstring -pub type MyAlias = MyStruct; - -impl MyAlias { - pub fn method_on_myalias() {} -} - -impl MyTrait for MyAlias {} diff --git a/src/test/rustdoc/union.rs b/src/test/rustdoc/union.rs deleted file mode 100644 index 8918622773205..0000000000000 --- a/src/test/rustdoc/union.rs +++ /dev/null @@ -1,8 +0,0 @@ -// @has union/union.U.html -pub union U { - // @has - //pre "pub a: u8" - pub a: u8, - // @has - //pre "// some fields omitted" - // @!has - //pre "b: u16" - b: u16, -} diff --git a/src/test/rustdoc/unit-return.rs b/src/test/rustdoc/unit-return.rs deleted file mode 100644 index ae3a6031519fb..0000000000000 --- a/src/test/rustdoc/unit-return.rs +++ /dev/null @@ -1,17 +0,0 @@ -// aux-build:unit-return.rs - -#![crate_name = "foo"] - -extern crate unit_return; - -// @has 'foo/fn.f0.html' '//*[@class="rust fn"]' 'F: FnMut(u8) + Clone' -pub fn f0<F: FnMut(u8) + Clone>(f: F) {} - -// @has 'foo/fn.f1.html' '//*[@class="rust fn"]' 'F: FnMut(u16) + Clone' -pub fn f1<F: FnMut(u16) -> () + Clone>(f: F) {} - -// @has 'foo/fn.f2.html' '//*[@class="rust fn"]' 'F: FnMut(u32) + Clone' -pub use unit_return::f2; - -// @has 'foo/fn.f3.html' '//*[@class="rust fn"]' 'F: FnMut(u64) + Clone' -pub use unit_return::f3; diff --git a/src/test/rustdoc/universal-impl-trait.rs b/src/test/rustdoc/universal-impl-trait.rs deleted file mode 100644 index b10b1b8658db9..0000000000000 --- a/src/test/rustdoc/universal-impl-trait.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![crate_name = "foo"] - -use std::io::Read; -use std::borrow::Borrow; - -// @has foo/fn.foo.html -// @has - //pre 'foo(' -// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"' -// @matches - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html' -pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) { -} - -pub trait Trait { - // @has foo/trait.Trait.html - // @has - 'method</a>(' - // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' - fn method(&self, _x: impl std::fmt::Debug) { - } -} - -pub struct S<T>(T); - -impl<T> S<T> { - // @has foo/struct.S.html - // @has - 'bar</a>(' - // @matches - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"' - pub fn bar(_bar: impl Copy) { - } - - // @has - 'baz</a>(' - // @matches - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html' - pub fn baz(_baz: S<impl Clone>) { - } - - // @has - 'qux</a>(' - // @matches - 'trait\.Read\.html' - pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) { - } -} - -// @has - 'method</a>(' -// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' -impl<T> Trait for S<T> {} - -// @has foo/fn.much_universe.html -// @matches - 'T:.+Borrow.+impl .+trait\.Trait\.html' -// @matches - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html' -// @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html' -pub fn much_universe< - T: Borrow<impl Trait>, - U: IntoIterator<Item = impl Iterator<Item = impl Clone>>, ->( - _: impl Read + Clone, -) { -} diff --git a/src/test/rustdoc/unneeded-trait-implementations-title.rs b/src/test/rustdoc/unneeded-trait-implementations-title.rs deleted file mode 100644 index e1bcfd3b97ecd..0000000000000 --- a/src/test/rustdoc/unneeded-trait-implementations-title.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_name = "foo"] - -pub struct Bar; - -// @count foo/struct.Bar.html '//*[@id="implementations"]' 0 diff --git a/src/test/rustdoc/use-attr.rs b/src/test/rustdoc/use-attr.rs deleted file mode 100644 index 996b7bba62181..0000000000000 --- a/src/test/rustdoc/use-attr.rs +++ /dev/null @@ -1,8 +0,0 @@ -// edition:2018 - -// ICE when rustdoc encountered a use statement of a non-macro attribute (see #58054) - -// @has use_attr/index.html -// @has - '//code' 'pub use proc_macro_attribute' -pub use proc_macro_attribute; -use proc_macro_derive; diff --git a/src/test/rustdoc/useless_lifetime_bound.rs b/src/test/rustdoc/useless_lifetime_bound.rs deleted file mode 100644 index f530d8a654f01..0000000000000 --- a/src/test/rustdoc/useless_lifetime_bound.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::marker::PhantomData; - -// @has useless_lifetime_bound/struct.Scope.html -// @!has - '//*[@class="rust struct"]' "'env: 'env" -pub struct Scope<'env> { - _marker: PhantomData<&'env mut &'env ()>, -} - -// @has useless_lifetime_bound/struct.Scope.html -// @!has - '//*[@class="rust struct"]' "T: 'a + 'a" -pub struct SomeStruct<'a, T: 'a> { - _marker: PhantomData<&'a T>, -} diff --git a/src/test/rustdoc/variadic.rs b/src/test/rustdoc/variadic.rs deleted file mode 100644 index 5af2aea21fcac..0000000000000 --- a/src/test/rustdoc/variadic.rs +++ /dev/null @@ -1,4 +0,0 @@ -extern "C" { - // @has variadic/fn.foo.html //pre 'pub unsafe extern "C" fn foo(x: i32, _: ...)' - pub fn foo(x: i32, ...); -} diff --git a/src/test/rustdoc/viewpath-rename.rs b/src/test/rustdoc/viewpath-rename.rs deleted file mode 100644 index 546127637928b..0000000000000 --- a/src/test/rustdoc/viewpath-rename.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_name = "foo"] - -pub mod io { - pub trait Reader { fn dummy(&self) { } } -} - -pub enum Maybe<A> { - Just(A), - Nothing -} - -// @has foo/prelude/index.html -pub mod prelude { - // @has foo/prelude/index.html '//code' 'pub use io as FooIo;' - // @has foo/prelude/index.html '//code' 'pub use io::Reader as FooReader;' - #[doc(no_inline)] pub use io::{self as FooIo, Reader as FooReader}; - // @has foo/prelude/index.html '//code' 'pub use Maybe;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Just as MaybeJust;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' - #[doc(no_inline)] pub use Maybe::{self, Just as MaybeJust, Nothing}; -} diff --git a/src/test/rustdoc/viewpath-self.rs b/src/test/rustdoc/viewpath-self.rs deleted file mode 100644 index a6b6592955fef..0000000000000 --- a/src/test/rustdoc/viewpath-self.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_name = "foo"] - -pub mod io { - pub trait Reader { fn dummy(&self) { } } -} - -pub enum Maybe<A> { - Just(A), - Nothing -} - -// @has foo/prelude/index.html -pub mod prelude { - // @has foo/prelude/index.html '//code' 'pub use io;' - // @has foo/prelude/index.html '//code' 'pub use io::Reader;' - #[doc(no_inline)] pub use io::{self, Reader}; - // @has foo/prelude/index.html '//code' 'pub use Maybe;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Just;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' - #[doc(no_inline)] pub use Maybe::{self, Just, Nothing}; -} diff --git a/src/test/rustdoc/where-sized.rs b/src/test/rustdoc/where-sized.rs deleted file mode 100644 index fe7cad8c3ef84..0000000000000 --- a/src/test/rustdoc/where-sized.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_name = "foo"] - -// @has foo/fn.foo.html -// @has - '//*[@class="rust fn"]' 'pub fn foo<X, Y: ?Sized>(_: &X)' -// @has - '//*[@class="rust fn"]' 'where X: ?Sized,' -pub fn foo<X, Y: ?Sized>(_: &X) where X: ?Sized {} diff --git a/src/test/rustdoc/where.rs b/src/test/rustdoc/where.rs deleted file mode 100644 index 992cddfe72aaf..0000000000000 --- a/src/test/rustdoc/where.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![crate_name = "foo"] - -pub trait MyTrait { fn dummy(&self) { } } - -// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait" -pub struct Alpha<A>(A) where A: MyTrait; -// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait" -pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); } -// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait" -pub fn charlie<C>() where C: MyTrait {} - -pub struct Delta<D>(D); - -// @has foo/struct.Delta.html '//*[@class="impl"]//code' \ -// "impl<D> Delta<D> where D: MyTrait" -impl<D> Delta<D> where D: MyTrait { - pub fn delta() {} -} - -pub struct Echo<E>(E); - -// @has foo/struct.Echo.html '//*[@class="impl"]//code' \ -// "impl<E> MyTrait for Echo<E> where E: MyTrait" -// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ -// "impl<E> MyTrait for Echo<E> where E: MyTrait" -impl<E> MyTrait for Echo<E> where E: MyTrait {} - -pub enum Foxtrot<F> { Foxtrot1(F) } - -// @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \ -// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait" -// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ -// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait" -impl<F> MyTrait for Foxtrot<F> where F: MyTrait {} - -// @has foo/type.Golf.html '//pre[@class="rust typedef"]' \ -// "type Golf<T> where T: Clone, = (T, T)" -pub type Golf<T> where T: Clone = (T, T); diff --git a/src/test/rustdoc/without-redirect.rs b/src/test/rustdoc/without-redirect.rs deleted file mode 100644 index a076f8a3c5ec7..0000000000000 --- a/src/test/rustdoc/without-redirect.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![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/wrapping.rs b/src/test/rustdoc/wrapping.rs deleted file mode 100644 index 8d8221bcdf293..0000000000000 --- a/src/test/rustdoc/wrapping.rs +++ /dev/null @@ -1,5 +0,0 @@ -use std::fmt::Debug; - -// @has 'wrapping/fn.foo.html' '//pre[@class="rust fn"]' 'pub fn foo() -> impl Debug' -// @count - '//pre[@class="rust fn"]/br' 0 -pub fn foo() -> impl Debug {} diff --git a/src/test/ui/error-codes/E0585.rs b/src/test/ui/error-codes/E0585.rs deleted file mode 100644 index 890b77b533afb..0000000000000 --- a/src/test/ui/error-codes/E0585.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - /// Hello! I'm useless... - //~^ ERROR E0585 -} diff --git a/src/test/ui/error-codes/E0585.stderr b/src/test/ui/error-codes/E0585.stderr deleted file mode 100644 index 7a31c4896ee8e..0000000000000 --- a/src/test/ui/error-codes/E0585.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/E0585.rs:2:5 - | -LL | /// Hello! I'm useless... - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/issues/issue-10656.rs b/src/test/ui/issues/issue-10656.rs deleted file mode 100644 index 8918dadb47a35..0000000000000 --- a/src/test/ui/issues/issue-10656.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![deny(missing_docs)] -#![crate_type="lib"] -//~^^ ERROR missing documentation for crate diff --git a/src/test/ui/issues/issue-10656.stderr b/src/test/ui/issues/issue-10656.stderr deleted file mode 100644 index 818457f50794e..0000000000000 --- a/src/test/ui/issues/issue-10656.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: missing documentation for crate - --> $DIR/issue-10656.rs:1:1 - | -LL | / #![deny(missing_docs)] -LL | | #![crate_type="lib"] - | |____________________^ - | -note: lint level defined here - --> $DIR/issue-10656.rs:1:9 - | -LL | #![deny(missing_docs)] - | ^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/issues/issue-34222-1.rs b/src/test/ui/issues/issue-34222-1.rs deleted file mode 100644 index d36dddc97bb7e..0000000000000 --- a/src/test/ui/issues/issue-34222-1.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - /// comment //~ ERROR found a documentation comment that doesn't document anything -} diff --git a/src/test/ui/issues/issue-34222-1.stderr b/src/test/ui/issues/issue-34222-1.stderr deleted file mode 100644 index 0799656b06bd2..0000000000000 --- a/src/test/ui/issues/issue-34222-1.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/issue-34222-1.rs:2:5 - | -LL | /// comment - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/lint/lint-missing-doc.rs b/src/test/ui/lint/lint-missing-doc.rs deleted file mode 100644 index a2466d28fb028..0000000000000 --- a/src/test/ui/lint/lint-missing-doc.rs +++ /dev/null @@ -1,186 +0,0 @@ -// When denying at the crate level, be sure to not get random warnings from the -// injected intrinsics by the compiler. -#![deny(missing_docs)] -#![allow(dead_code)] -#![feature(associated_type_defaults)] - -//! Some garbage docs for the crate here -#![doc="More garbage"] - -type Typedef = String; -pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias - -struct Foo { - a: isize, - b: isize, -} - -pub struct PubFoo { //~ ERROR: missing documentation for a struct - pub a: isize, //~ ERROR: missing documentation for a struct field - b: isize, -} - -#[allow(missing_docs)] -pub struct PubFoo2 { - pub a: isize, - pub c: isize, -} - -mod module_no_dox {} -pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module - -/// dox -pub fn foo() {} -pub fn foo2() {} //~ ERROR: missing documentation for a function -fn foo3() {} -#[allow(missing_docs)] pub fn foo4() {} - -/// dox -pub trait A { - /// dox - fn foo(&self); - /// dox - fn foo_with_impl(&self) {} -} - -#[allow(missing_docs)] -trait B { - fn foo(&self); - fn foo_with_impl(&self) {} -} - -pub trait C { //~ ERROR: missing documentation for a trait - fn foo(&self); //~ ERROR: missing documentation for a trait method - fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a trait method -} - -#[allow(missing_docs)] -pub trait D { - fn dummy(&self) { } -} - -/// dox -pub trait E { - type AssociatedType; //~ ERROR: missing documentation for an associated type - type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type - - /// dox - type DocumentedType; - /// dox - type DocumentedTypeDef = Self; - /// dox - fn dummy(&self) {} -} - -impl Foo { - pub fn foo() {} - fn bar() {} -} - -impl PubFoo { - pub fn foo() {} //~ ERROR: missing documentation for a method - /// dox - pub fn foo1() {} - fn foo2() {} - #[allow(missing_docs)] pub fn foo3() {} -} - -#[allow(missing_docs)] -trait F { - fn a(); - fn b(&self); -} - -// should need to redefine documentation for implementations of traits -impl F for Foo { - fn a() {} - fn b(&self) {} -} - -// It sure is nice if doc(hidden) implies allow(missing_docs), and that it -// applies recursively -#[doc(hidden)] -mod a { - pub fn baz() {} - pub mod b { - pub fn baz() {} - } -} - -enum Baz { - BazA { - a: isize, - b: isize - }, - BarB -} - -pub enum PubBaz { //~ ERROR: missing documentation for an enum - PubBazA { //~ ERROR: missing documentation for a variant - a: isize, //~ ERROR: missing documentation for a struct field - }, -} - -/// dox -pub enum PubBaz2 { - /// dox - PubBaz2A { - /// dox - a: isize, - }, -} - -#[allow(missing_docs)] -pub enum PubBaz3 { - PubBaz3A { - b: isize - }, -} - -#[doc(hidden)] -pub fn baz() {} - - -const FOO: u32 = 0; -/// dox -pub const FOO1: u32 = 0; -#[allow(missing_docs)] -pub const FOO2: u32 = 0; -#[doc(hidden)] -pub const FOO3: u32 = 0; -pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const - - -static BAR: u32 = 0; -/// dox -pub static BAR1: u32 = 0; -#[allow(missing_docs)] -pub static BAR2: u32 = 0; -#[doc(hidden)] -pub static BAR3: u32 = 0; -pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static - - -mod internal_impl { - /// dox - pub fn documented() {} - pub fn undocumented1() {} //~ ERROR: missing documentation for a function - pub fn undocumented2() {} //~ ERROR: missing documentation for a function - fn undocumented3() {} - /// dox - pub mod globbed { - /// dox - pub fn also_documented() {} - pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function - fn also_undocumented2() {} - } -} -/// dox -pub mod public_interface { - pub use internal_impl::documented as foo; - pub use internal_impl::undocumented1 as bar; - pub use internal_impl::{documented, undocumented2}; - pub use internal_impl::globbed::*; -} - -fn main() {} diff --git a/src/test/ui/lint/lint-missing-doc.stderr b/src/test/ui/lint/lint-missing-doc.stderr deleted file mode 100644 index 3532c9315d8dc..0000000000000 --- a/src/test/ui/lint/lint-missing-doc.stderr +++ /dev/null @@ -1,122 +0,0 @@ -error: missing documentation for a type alias - --> $DIR/lint-missing-doc.rs:11:1 - | -LL | pub type PubTypedef = String; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: lint level defined here - --> $DIR/lint-missing-doc.rs:3:9 - | -LL | #![deny(missing_docs)] - | ^^^^^^^^^^^^ - -error: missing documentation for a struct - --> $DIR/lint-missing-doc.rs:18:1 - | -LL | pub struct PubFoo { - | ^^^^^^^^^^^^^^^^^ - -error: missing documentation for a struct field - --> $DIR/lint-missing-doc.rs:19:5 - | -LL | pub a: isize, - | ^^^^^^^^^^^^ - -error: missing documentation for a module - --> $DIR/lint-missing-doc.rs:30:1 - | -LL | pub mod pub_module_no_dox {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:34:1 - | -LL | pub fn foo2() {} - | ^^^^^^^^^^^^^ - -error: missing documentation for a trait - --> $DIR/lint-missing-doc.rs:52:1 - | -LL | pub trait C { - | ^^^^^^^^^^^ - -error: missing documentation for a trait method - --> $DIR/lint-missing-doc.rs:53:5 - | -LL | fn foo(&self); - | ^^^^^^^^^^^^^^ - -error: missing documentation for a trait method - --> $DIR/lint-missing-doc.rs:54:5 - | -LL | fn foo_with_impl(&self) {} - | ^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for an associated type - --> $DIR/lint-missing-doc.rs:64:5 - | -LL | type AssociatedType; - | ^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for an associated type - --> $DIR/lint-missing-doc.rs:65:5 - | -LL | type AssociatedTypeDef = Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a method - --> $DIR/lint-missing-doc.rs:81:5 - | -LL | pub fn foo() {} - | ^^^^^^^^^^^^ - -error: missing documentation for an enum - --> $DIR/lint-missing-doc.rs:118:1 - | -LL | pub enum PubBaz { - | ^^^^^^^^^^^^^^^ - -error: missing documentation for a variant - --> $DIR/lint-missing-doc.rs:119:5 - | -LL | PubBazA { - | ^^^^^^^ - -error: missing documentation for a struct field - --> $DIR/lint-missing-doc.rs:120:9 - | -LL | a: isize, - | ^^^^^^^^ - -error: missing documentation for a constant - --> $DIR/lint-missing-doc.rs:151:1 - | -LL | pub const FOO4: u32 = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a static - --> $DIR/lint-missing-doc.rs:161:1 - | -LL | pub static BAR4: u32 = 0; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:167:5 - | -LL | pub fn undocumented1() {} - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:168:5 - | -LL | pub fn undocumented2() {} - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:174:9 - | -LL | pub fn also_undocumented1() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 19 previous errors - diff --git a/src/test/ui/lint/lints-in-foreign-macros.stderr b/src/test/ui/lint/lints-in-foreign-macros.stderr index 3fc3c2281f2e3..0feb1f47ae3ee 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.stderr +++ b/src/test/ui/lint/lints-in-foreign-macros.stderr @@ -25,33 +25,3 @@ warning: unused import: `std::string::ToString` LL | mod d { baz2!(use std::string::ToString;); } | ^^^^^^^^^^^^^^^^^^^^^ -warning: missing documentation for crate - --> $DIR/lints-in-foreign-macros.rs:4:1 - | -LL | / #![warn(unused_imports)] -LL | | #![warn(missing_docs)] -LL | | -LL | | #[macro_use] -... | -LL | | -LL | | fn main() {} - | |____________^ - | -note: lint level defined here - --> $DIR/lints-in-foreign-macros.rs:5:9 - | -LL | #![warn(missing_docs)] - | ^^^^^^^^^^^^ - -warning: missing documentation for a function - --> $DIR/lints-in-foreign-macros.rs:18:6 - | -LL | baz!(pub fn undocumented() {}); - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: missing documentation for a function - --> $DIR/lints-in-foreign-macros.rs:19:7 - | -LL | baz2!(pub fn undocumented2() {}); - | ^^^^^^^^^^^^^^^^^^^^^^ - diff --git a/src/test/ui/parser/doc-before-attr.rs b/src/test/ui/parser/doc-before-attr.rs deleted file mode 100644 index c4125a09fd2fd..0000000000000 --- a/src/test/ui/parser/doc-before-attr.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() {} - -/// hi -#[derive(Debug)] //~ERROR expected item after attributes diff --git a/src/test/ui/parser/doc-before-attr.stderr b/src/test/ui/parser/doc-before-attr.stderr deleted file mode 100644 index 0fae44ce5c806..0000000000000 --- a/src/test/ui/parser/doc-before-attr.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected item after attributes - --> $DIR/doc-before-attr.rs:4:16 - | -LL | #[derive(Debug)] - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/parser/doc-before-eof.rs b/src/test/ui/parser/doc-before-eof.rs deleted file mode 100644 index b31836e95e880..0000000000000 --- a/src/test/ui/parser/doc-before-eof.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() {} - -/// hi //~ERROR expected item after doc comment diff --git a/src/test/ui/parser/doc-before-eof.stderr b/src/test/ui/parser/doc-before-eof.stderr deleted file mode 100644 index 82756626765b0..0000000000000 --- a/src/test/ui/parser/doc-before-eof.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected item after doc comment - --> $DIR/doc-before-eof.rs:3:1 - | -LL | /// hi - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this doc comment doesn't document anything - -error: aborting due to previous error - diff --git a/src/test/ui/parser/doc-before-extern-rbrace.rs b/src/test/ui/parser/doc-before-extern-rbrace.rs deleted file mode 100644 index 695d4da1dca60..0000000000000 --- a/src/test/ui/parser/doc-before-extern-rbrace.rs +++ /dev/null @@ -1,4 +0,0 @@ -extern { - /// hi - //~^ ERROR expected item after doc comment -} diff --git a/src/test/ui/parser/doc-before-extern-rbrace.stderr b/src/test/ui/parser/doc-before-extern-rbrace.stderr deleted file mode 100644 index 8cc9c916a7afd..0000000000000 --- a/src/test/ui/parser/doc-before-extern-rbrace.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected item after doc comment - --> $DIR/doc-before-extern-rbrace.rs:2:5 - | -LL | /// hi - | ^^^^^^ this doc comment doesn't document anything - -error: aborting due to previous error - diff --git a/src/test/ui/parser/doc-before-fn-rbrace.rs b/src/test/ui/parser/doc-before-fn-rbrace.rs deleted file mode 100644 index d33520baebe07..0000000000000 --- a/src/test/ui/parser/doc-before-fn-rbrace.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: -Z continue-parse-after-error - -fn main() { - /// document - //~^ ERROR found a documentation comment that doesn't document anything - //~| HELP maybe a comment was intended -} diff --git a/src/test/ui/parser/doc-before-fn-rbrace.stderr b/src/test/ui/parser/doc-before-fn-rbrace.stderr deleted file mode 100644 index a1ca88cf31487..0000000000000 --- a/src/test/ui/parser/doc-before-fn-rbrace.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/doc-before-fn-rbrace.rs:4:5 - | -LL | /// document - | ^^^^^^^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/parser/doc-before-identifier.rs b/src/test/ui/parser/doc-before-identifier.rs deleted file mode 100644 index d9777be63d280..0000000000000 --- a/src/test/ui/parser/doc-before-identifier.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags: -Z continue-parse-after-error - -fn /// document -foo() {} -//~^^ ERROR expected identifier, found doc comment `/// document` - -fn main() { - foo(); -} diff --git a/src/test/ui/parser/doc-before-identifier.stderr b/src/test/ui/parser/doc-before-identifier.stderr deleted file mode 100644 index 4bc5e6f65d804..0000000000000 --- a/src/test/ui/parser/doc-before-identifier.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected identifier, found doc comment `/// document` - --> $DIR/doc-before-identifier.rs:3:4 - | -LL | fn /// document - | ^^^^^^^^^^^^ expected identifier, found doc comment - -error: aborting due to previous error - diff --git a/src/test/ui/parser/doc-before-mod-rbrace.rs b/src/test/ui/parser/doc-before-mod-rbrace.rs deleted file mode 100644 index 4e0b65ef496db..0000000000000 --- a/src/test/ui/parser/doc-before-mod-rbrace.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags: -Z continue-parse-after-error - -mod Foo { - /// document - //~^ ERROR expected item after doc comment -} - -fn main() {} diff --git a/src/test/ui/parser/doc-before-mod-rbrace.stderr b/src/test/ui/parser/doc-before-mod-rbrace.stderr deleted file mode 100644 index 4eaf351f676c8..0000000000000 --- a/src/test/ui/parser/doc-before-mod-rbrace.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected item after doc comment - --> $DIR/doc-before-mod-rbrace.rs:4:5 - | -LL | /// document - | ^^^^^^^^^^^^ this doc comment doesn't document anything - -error: aborting due to previous error - diff --git a/src/test/ui/parser/doc-before-rbrace.rs b/src/test/ui/parser/doc-before-rbrace.rs deleted file mode 100644 index 8ff946344aee8..0000000000000 --- a/src/test/ui/parser/doc-before-rbrace.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - println!("Hi"); /// hi - //~^ ERROR found a documentation comment that doesn't document anything - //~| HELP maybe a comment was intended -} diff --git a/src/test/ui/parser/doc-before-rbrace.stderr b/src/test/ui/parser/doc-before-rbrace.stderr deleted file mode 100644 index 55719cf641195..0000000000000 --- a/src/test/ui/parser/doc-before-rbrace.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/doc-before-rbrace.rs:2:21 - | -LL | println!("Hi"); /// hi - | ^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/parser/doc-before-semi.rs b/src/test/ui/parser/doc-before-semi.rs deleted file mode 100644 index 405a7e1e2a33b..0000000000000 --- a/src/test/ui/parser/doc-before-semi.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - /// hi - //~^ ERROR found a documentation comment that doesn't document anything - //~| HELP maybe a comment was intended - ; -} diff --git a/src/test/ui/parser/doc-before-semi.stderr b/src/test/ui/parser/doc-before-semi.stderr deleted file mode 100644 index e6bade18d0a2d..0000000000000 --- a/src/test/ui/parser/doc-before-semi.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/doc-before-semi.rs:2:5 - | -LL | /// hi - | ^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.rs b/src/test/ui/parser/doc-before-struct-rbrace-1.rs deleted file mode 100644 index e7055f6a5fcb4..0000000000000 --- a/src/test/ui/parser/doc-before-struct-rbrace-1.rs +++ /dev/null @@ -1,12 +0,0 @@ -// compile-flags: -Z continue-parse-after-error - -struct X { - a: u8, - /// document - //~^ ERROR found a documentation comment that doesn't document anything - //~| HELP maybe a comment was intended -} - -fn main() { - let y = X {a: 1}; -} diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr deleted file mode 100644 index f2824f85ca98a..0000000000000 --- a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/doc-before-struct-rbrace-1.rs:5:5 - | -LL | /// document - | ^^^^^^^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.rs b/src/test/ui/parser/doc-before-struct-rbrace-2.rs deleted file mode 100644 index d5c2a314cbbf8..0000000000000 --- a/src/test/ui/parser/doc-before-struct-rbrace-2.rs +++ /dev/null @@ -1,11 +0,0 @@ -// compile-flags: -Z continue-parse-after-error - -struct X { - a: u8 /// document - //~^ ERROR found a documentation comment that doesn't document anything - //~| HELP maybe a comment was intended -} - -fn main() { - let y = X {a: 1}; -} diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr deleted file mode 100644 index ba3e884263ca3..0000000000000 --- a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0585]: found a documentation comment that doesn't document anything - --> $DIR/doc-before-struct-rbrace-2.rs:4:11 - | -LL | a: u8 /// document - | ^^^^^^^^^^^^ - | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0585`. diff --git a/src/test/ui/parser/doc-comment-in-if-statement.stderr b/src/test/ui/parser/doc-comment-in-if-statement.stderr index 6bcb77385d7d5..ca3ff89e3bc5c 100644 --- a/src/test/ui/parser/doc-comment-in-if-statement.stderr +++ b/src/test/ui/parser/doc-comment-in-if-statement.stderr @@ -2,8 +2,9 @@ error: expected `{`, found doc comment `/*!*/` --> $DIR/doc-comment-in-if-statement.rs:2:13 | LL | if true /*!*/ {} - | -- ^^^^^ expected `{` - | | + | -- ^^^^^ -- help: try placing this code inside a block: `{ { } }` + | | | + | | expected `{` | this `if` statement has a condition, but no block error: aborting due to previous error diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.rs b/src/test/ui/parser/inner-attr-after-doc-comment.rs deleted file mode 100644 index 36f4191f06bc3..0000000000000 --- a/src/test/ui/parser/inner-attr-after-doc-comment.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(lang_items)] -/** - * My module - */ - -#![recursion_limit="100"] -//~^ ERROR an inner attribute is not permitted following an outer doc comment -fn main() {} diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.stderr b/src/test/ui/parser/inner-attr-after-doc-comment.stderr deleted file mode 100644 index 0dde49a2913f1..0000000000000 --- a/src/test/ui/parser/inner-attr-after-doc-comment.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: an inner attribute is not permitted following an outer doc comment - --> $DIR/inner-attr-after-doc-comment.rs:6:3 - | -LL | #![recursion_limit="100"] - | ^ - | - = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. - -error: aborting due to previous error - diff --git a/src/test/ui/parser/issue-30318.rs b/src/test/ui/parser/issue-30318.rs deleted file mode 100644 index 38e30de716d0a..0000000000000 --- a/src/test/ui/parser/issue-30318.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn foo() { } - -//! Misplaced comment... -//~^ ERROR expected outer doc comment -//~| NOTE inner doc comments like this (starting with `//!` or `/*!`) can only appear before items - -fn main() { } diff --git a/src/test/ui/parser/issue-30318.stderr b/src/test/ui/parser/issue-30318.stderr deleted file mode 100644 index 489451bb5dc8d..0000000000000 --- a/src/test/ui/parser/issue-30318.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: expected outer doc comment - --> $DIR/issue-30318.rs:3:1 - | -LL | //! Misplaced comment... - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items - -error: aborting due to previous error - diff --git a/src/test/ui/privacy/private-in-public-non-principal.rs b/src/test/ui/privacy/private-in-public-non-principal.rs deleted file mode 100644 index 5de5a685208cd..0000000000000 --- a/src/test/ui/privacy/private-in-public-non-principal.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![feature(optin_builtin_traits)] - -pub trait PubPrincipal {} -auto trait PrivNonPrincipal {} - -pub fn leak_dyn_nonprincipal() -> Box<PubPrincipal + PrivNonPrincipal> { loop {} } -//~^ WARN private trait `PrivNonPrincipal` in public interface -//~| WARN this was previously accepted - -#[deny(missing_docs)] -fn container() { - impl dyn PubPrincipal { - pub fn check_doc_lint() {} //~ ERROR missing documentation for a method - } - impl dyn PubPrincipal + PrivNonPrincipal { - pub fn check_doc_lint() {} // OK, no missing doc lint - } -} - -fn main() {} diff --git a/src/test/ui/privacy/private-in-public-non-principal.stderr b/src/test/ui/privacy/private-in-public-non-principal.stderr deleted file mode 100644 index 729b94ed8926a..0000000000000 --- a/src/test/ui/privacy/private-in-public-non-principal.stderr +++ /dev/null @@ -1,24 +0,0 @@ -warning: private trait `PrivNonPrincipal` in public interface (error E0445) - --> $DIR/private-in-public-non-principal.rs:6:1 - | -LL | pub fn leak_dyn_nonprincipal() -> Box<PubPrincipal + PrivNonPrincipal> { loop {} } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: #[warn(private_in_public)] on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> - -error: missing documentation for a method - --> $DIR/private-in-public-non-principal.rs:13:9 - | -LL | pub fn check_doc_lint() {} - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -note: lint level defined here - --> $DIR/private-in-public-non-principal.rs:10:8 - | -LL | #[deny(missing_docs)] - | ^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/proc-macro/attributes-included.rs b/src/test/ui/proc-macro/attributes-included.rs deleted file mode 100644 index 0ab17a1f3b312..0000000000000 --- a/src/test/ui/proc-macro/attributes-included.rs +++ /dev/null @@ -1,22 +0,0 @@ -// aux-build:attributes-included.rs -// compile-pass - -#![warn(unused)] - -extern crate attributes_included; - -use attributes_included::*; - -#[bar] -#[inline] -/// doc -#[foo] -#[inline] -/// doc -fn foo() { - let a: i32 = "foo"; //~ WARN: unused variable -} - -fn main() { - foo() -} diff --git a/src/test/ui/proc-macro/attributes-included.stderr b/src/test/ui/proc-macro/attributes-included.stderr deleted file mode 100644 index fcd77b2d383da..0000000000000 --- a/src/test/ui/proc-macro/attributes-included.stderr +++ /dev/null @@ -1,13 +0,0 @@ -warning: unused variable: `a` - --> $DIR/attributes-included.rs:17:9 - | -LL | let a: i32 = "foo"; - | ^ help: consider prefixing with an underscore: `_a` - | -note: lint level defined here - --> $DIR/attributes-included.rs:4:9 - | -LL | #![warn(unused)] - | ^^^^^^ - = note: #[warn(unused_variables)] implied by #[warn(unused)] - diff --git a/src/test/ui/useless-comment.rs b/src/test/ui/useless-comment.rs deleted file mode 100644 index 7d2e5ab6f2b7f..0000000000000 --- a/src/test/ui/useless-comment.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![feature(stmt_expr_attributes)] - -#![deny(unused_doc_comments)] - -macro_rules! mac { - () => {} -} - -/// foo //~ ERROR unused doc comment -mac!(); - -fn foo() { - /// a //~ ERROR unused doc comment - let x = 12; - - /// multi-line //~ unused doc comment - /// doc comment - /// that is unused - match x { - /// c //~ ERROR unused doc comment - 1 => {}, - _ => {} - } - - /// foo //~ ERROR unused doc comment - unsafe {} - - #[doc = "foo"] //~ ERROR unused doc comment - #[doc = "bar"] //~ ERROR unused doc comment - 3; - - /// bar //~ ERROR unused doc comment - mac!(); - - let x = /** comment */ 47; //~ ERROR unused doc comment - - /// dox //~ ERROR unused doc comment - { - - } -} - -fn main() { - foo(); -} diff --git a/src/test/ui/useless-comment.stderr b/src/test/ui/useless-comment.stderr deleted file mode 100644 index 925e307963692..0000000000000 --- a/src/test/ui/useless-comment.stderr +++ /dev/null @@ -1,98 +0,0 @@ -error: unused doc comment - --> $DIR/useless-comment.rs:9:1 - | -LL | /// foo - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | mac!(); - | ------- rustdoc does not generate documentation for macro expansions - | -note: lint level defined here - --> $DIR/useless-comment.rs:3:9 - | -LL | #![deny(unused_doc_comments)] - | ^^^^^^^^^^^^^^^^^^^ - = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion - -error: unused doc comment - --> $DIR/useless-comment.rs:13:5 - | -LL | /// a - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | let x = 12; - | ----------- rustdoc does not generate documentation for statements - -error: unused doc comment - --> $DIR/useless-comment.rs:16:5 - | -LL | / /// multi-line -LL | | /// doc comment -LL | | /// that is unused - | |______________________^ -LL | / match x { -LL | | /// c -LL | | 1 => {}, -LL | | _ => {} -LL | | } - | |_____- rustdoc does not generate documentation for expressions - -error: unused doc comment - --> $DIR/useless-comment.rs:20:9 - | -LL | /// c - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | 1 => {}, - | ------- rustdoc does not generate documentation for match arms - -error: unused doc comment - --> $DIR/useless-comment.rs:25:5 - | -LL | /// foo - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | unsafe {} - | --------- rustdoc does not generate documentation for expressions - -error: unused doc comment - --> $DIR/useless-comment.rs:28:5 - | -LL | #[doc = "foo"] - | ^^^^^^^^^^^^^^ -LL | #[doc = "bar"] -LL | 3; - | - rustdoc does not generate documentation for expressions - -error: unused doc comment - --> $DIR/useless-comment.rs:29:5 - | -LL | #[doc = "bar"] - | ^^^^^^^^^^^^^^ -LL | 3; - | - rustdoc does not generate documentation for expressions - -error: unused doc comment - --> $DIR/useless-comment.rs:32:5 - | -LL | /// bar - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | mac!(); - | ------- rustdoc does not generate documentation for macro expansions - | - = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion - -error: unused doc comment - --> $DIR/useless-comment.rs:35:13 - | -LL | let x = /** comment */ 47; - | ^^^^^^^^^^^^^^ -- rustdoc does not generate documentation for expressions - -error: unused doc comment - --> $DIR/useless-comment.rs:37:5 - | -LL | /// dox - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -LL | / { -LL | | -LL | | } - | |_____- rustdoc does not generate documentation for expressions - -error: aborting due to 10 previous errors -