diff options
| author | bors <bors@rust-lang.org> | 2018-01-26 17:41:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-01-26 17:41:36 +0000 |
| commit | bacb5c58dfdde7c35e99b2b0d8171238cc33cf6c (patch) | |
| tree | a4a44364f143350bb7262ca8e63612e2ee71f6ed /src/test/rustdoc | |
| parent | a97cd17f5d71fb4ec362f4fbd79373a6e7ed7b82 (diff) | |
| parent | a06d333a148f6c620044a765f47497f1ed1e4dde (diff) | |
Auto merge of #47748 - alexcrichton:rollup, r=alexcrichton
Rollup of 19 pull requests - Successful merges: #47415, #47437, #47439, #47453, #47460, #47502, #47529, #47600, #47607, #47618, #47626, #47656, #47668, #47696, #47701, #47705, #47710, #47711, #47719 - Failed merges: #47455, #47521
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/auxiliary/masked.rs | 20 | ||||
| -rw-r--r-- | src/test/rustdoc/intra-links.rs | 21 | ||||
| -rw-r--r-- | src/test/rustdoc/masked.rs | 40 |
3 files changed, 80 insertions, 1 deletions
diff --git a/src/test/rustdoc/auxiliary/masked.rs b/src/test/rustdoc/auxiliary/masked.rs new file mode 100644 index 00000000000..e0d53a72220 --- /dev/null +++ b/src/test/rustdoc/auxiliary/masked.rs @@ -0,0 +1,20 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[derive(Clone)] +pub struct MaskedStruct; + +pub trait MaskedTrait { + fn masked_method(); +} + +impl MaskedTrait for String { + fn masked_method() {} +} diff --git a/src/test/rustdoc/intra-links.rs b/src/test/rustdoc/intra-links.rs index aa6f5538754..4726323e11c 100644 --- a/src/test/rustdoc/intra-links.rs +++ b/src/test/rustdoc/intra-links.rs @@ -10,7 +10,13 @@ // @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' @@ -23,8 +29,13 @@ //! In this crate we would like to link to: //! //! * [`ThisType`](ThisType) +//! * [`ThisType::this_method`](ThisType::this_method) //! * [`ThisEnum`](ThisEnum) +//! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant) //! * [`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()) @@ -45,8 +56,16 @@ macro_rules! this_macro { } pub struct ThisType; + +impl ThisType { + pub fn this_method() {} +} pub enum ThisEnum { ThisVariant, } -pub trait ThisTrait {} +pub trait ThisTrait { + type ThisAssociatedType; + const THIS_ASSOCIATED_CONST: u8; + fn this_associated_method(); +} pub type ThisAlias = Result<(), ()>; pub union ThisUnion { this_field: usize, } diff --git a/src/test/rustdoc/masked.rs b/src/test/rustdoc/masked.rs new file mode 100644 index 00000000000..1f398da84e5 --- /dev/null +++ b/src/test/rustdoc/masked.rs @@ -0,0 +1,40 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// 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 {} |
