diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-04-26 10:51:14 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-05-06 16:24:48 -0400 |
| commit | fbc082dcc65d5bb37a4af09b731b01e860b8c5bf (patch) | |
| tree | 0ba4a400b7d8863f55a892ee6deeaa7733d7ac18 /src/test/rustdoc | |
| parent | 77ae7591a88a87f901cfd1e6a8a9e77a944a49b4 (diff) | |
| download | rust-fbc082dcc65d5bb37a4af09b731b01e860b8c5bf.tar.gz rust-fbc082dcc65d5bb37a4af09b731b01e860b8c5bf.zip | |
move auxiliary builds to a test-relative `aux`
Instead of finding aux-build files in `auxiliary`, we now search for an `aux` directory relative to the test. So if your test is `compile-fail/foo.rs`, we would look in `compile-fail/aux`. Similarly, we ignore the `aux` directory when searching for tets.
Diffstat (limited to 'src/test/rustdoc')
28 files changed, 554 insertions, 0 deletions
diff --git a/src/test/rustdoc/aux/empty.rs b/src/test/rustdoc/aux/empty.rs new file mode 100644 index 00000000000..30669470522 --- /dev/null +++ b/src/test/rustdoc/aux/empty.rs @@ -0,0 +1,9 @@ +// Copyright 2016 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. diff --git a/src/test/rustdoc/aux/inline-default-methods.rs b/src/test/rustdoc/aux/inline-default-methods.rs new file mode 100644 index 00000000000..e21e6ad2043 --- /dev/null +++ b/src/test/rustdoc/aux/inline-default-methods.rs @@ -0,0 +1,16 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub trait Foo { + fn bar(&self); + fn foo(&mut self) {} +} diff --git a/src/test/rustdoc/aux/issue-13698.rs b/src/test/rustdoc/aux/issue-13698.rs new file mode 100644 index 00000000000..ecddfe99b3b --- /dev/null +++ b/src/test/rustdoc/aux/issue-13698.rs @@ -0,0 +1,18 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub trait Foo { + #[doc(hidden)] + fn foo(&self) {} +} + +impl Foo for i32 {} diff --git a/src/test/rustdoc/aux/issue-15318.rs b/src/test/rustdoc/aux/issue-15318.rs new file mode 100644 index 00000000000..145b4df6299 --- /dev/null +++ b/src/test/rustdoc/aux/issue-15318.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +#![doc(html_root_url = "http://example.com/")] + +/// dox +#[doc(primitive = "pointer")] +pub mod ptr {} diff --git a/src/test/rustdoc/aux/issue-17476.rs b/src/test/rustdoc/aux/issue-17476.rs new file mode 100644 index 00000000000..644d1634e9d --- /dev/null +++ b/src/test/rustdoc/aux/issue-17476.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +#![doc(html_root_url = "http://example.com")] + +pub trait Foo { + fn foo(&self) {} +} diff --git a/src/test/rustdoc/aux/issue-19190-3.rs b/src/test/rustdoc/aux/issue-19190-3.rs new file mode 100644 index 00000000000..2c9271202a6 --- /dev/null +++ b/src/test/rustdoc/aux/issue-19190-3.rs @@ -0,0 +1,33 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +use std::ops::Deref; + +pub struct Foo; + +impl Deref for Foo { + type Target = i32; + fn deref(&self) -> &i32 { 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/aux/issue-20646.rs b/src/test/rustdoc/aux/issue-20646.rs new file mode 100644 index 00000000000..815b78a91d9 --- /dev/null +++ b/src/test/rustdoc/aux/issue-20646.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub trait Trait { + type Output; +} + +pub fn fun<T>(_: T) where T: Trait<Output=i32> {} diff --git a/src/test/rustdoc/aux/issue-20727.rs b/src/test/rustdoc/aux/issue-20727.rs new file mode 100644 index 00000000000..2ec761fad96 --- /dev/null +++ b/src/test/rustdoc/aux/issue-20727.rs @@ -0,0 +1,40 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub trait Deref { + type Target: ?Sized; + + fn deref<'a>(&'a self) -> &'a Self::Target; +} + +pub trait Add<RHS = Self> { + 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<Idx: ?Sized> { + type Output: ?Sized; + fn index(&self, index: Idx) -> &Self::Output; +} + +pub trait IndexMut<Idx: ?Sized>: Index<Idx> { + fn index_mut(&mut self, index: Idx) -> &mut Self::Output; +} diff --git a/src/test/rustdoc/aux/issue-21092.rs b/src/test/rustdoc/aux/issue-21092.rs new file mode 100644 index 00000000000..e906311e3ae --- /dev/null +++ b/src/test/rustdoc/aux/issue-21092.rs @@ -0,0 +1,22 @@ +// Copyright 2015 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. + +// 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/aux/issue-21801.rs b/src/test/rustdoc/aux/issue-21801.rs new file mode 100644 index 00000000000..f618edec598 --- /dev/null +++ b/src/test/rustdoc/aux/issue-21801.rs @@ -0,0 +1,19 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub struct Foo; + +impl Foo { + pub fn new<F>(f: F) -> Foo where F: FnMut() -> i32 { + loop {} + } +} diff --git a/src/test/rustdoc/aux/issue-22025.rs b/src/test/rustdoc/aux/issue-22025.rs new file mode 100644 index 00000000000..35a37e27d91 --- /dev/null +++ b/src/test/rustdoc/aux/issue-22025.rs @@ -0,0 +1,20 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +pub mod foo { + + pub trait Foo {} + pub struct Bar; + + impl Foo for Bar {} + +} diff --git a/src/test/rustdoc/aux/issue-23207-1.rs b/src/test/rustdoc/aux/issue-23207-1.rs new file mode 100644 index 00000000000..ec9f2004ebf --- /dev/null +++ b/src/test/rustdoc/aux/issue-23207-1.rs @@ -0,0 +1,13 @@ +// Copyright 2015 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. + +pub mod fmt { + pub struct Error; +} diff --git a/src/test/rustdoc/aux/issue-23207-2.rs b/src/test/rustdoc/aux/issue-23207-2.rs new file mode 100644 index 00000000000..5e9c540ab69 --- /dev/null +++ b/src/test/rustdoc/aux/issue-23207-2.rs @@ -0,0 +1,16 @@ +// Copyright 2015 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. + +extern crate issue_23207_1; + +pub mod fmt { + pub use issue_23207_1::fmt::Error; +} + diff --git a/src/test/rustdoc/aux/issue-26606-macro.rs b/src/test/rustdoc/aux/issue-26606-macro.rs new file mode 100644 index 00000000000..6059a252bce --- /dev/null +++ b/src/test/rustdoc/aux/issue-26606-macro.rs @@ -0,0 +1,14 @@ +// Copyright 2016 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. + +#[macro_export] +macro_rules! make_item ( + ($name: ident) => (pub const $name: usize = 42;) +); diff --git a/src/test/rustdoc/aux/issue-27362.rs b/src/test/rustdoc/aux/issue-27362.rs new file mode 100644 index 00000000000..25de698cad1 --- /dev/null +++ b/src/test/rustdoc/aux/issue-27362.rs @@ -0,0 +1,22 @@ +// Copyright 2015 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. + +// compile-flags: -Cmetadata=aux + +#![feature(const_fn)] + +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/aux/issue-28927-1.rs b/src/test/rustdoc/aux/issue-28927-1.rs new file mode 100644 index 00000000000..7d6b448df43 --- /dev/null +++ b/src/test/rustdoc/aux/issue-28927-1.rs @@ -0,0 +1,12 @@ +// Copyright 2015 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. + +extern crate issue_28927_2 as inner2; +pub use inner2 as bar; diff --git a/src/test/rustdoc/aux/issue-28927-2.rs b/src/test/rustdoc/aux/issue-28927-2.rs new file mode 100644 index 00000000000..c5117005049 --- /dev/null +++ b/src/test/rustdoc/aux/issue-28927-2.rs @@ -0,0 +1,11 @@ +// Copyright 2015 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. + +pub struct Baz; diff --git a/src/test/rustdoc/aux/issue-29584.rs b/src/test/rustdoc/aux/issue-29584.rs new file mode 100644 index 00000000000..63c79f875ef --- /dev/null +++ b/src/test/rustdoc/aux/issue-29584.rs @@ -0,0 +1,20 @@ +// Copyright 2016 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. + +// compile-flags: -Cmetadata=aux + +pub struct Foo; + +#[doc(hidden)] +mod bar { + trait Bar {} + + impl Bar for ::Foo {} +} diff --git a/src/test/rustdoc/aux/issue-30109-1.rs b/src/test/rustdoc/aux/issue-30109-1.rs new file mode 100644 index 00000000000..59f952a0b29 --- /dev/null +++ b/src/test/rustdoc/aux/issue-30109-1.rs @@ -0,0 +1,11 @@ +// Copyright 2015 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. + +pub struct Bar; diff --git a/src/test/rustdoc/aux/reexp_stripped.rs b/src/test/rustdoc/aux/reexp_stripped.rs new file mode 100644 index 00000000000..2b061e3997d --- /dev/null +++ b/src/test/rustdoc/aux/reexp_stripped.rs @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +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/aux/rustdoc-default-impl.rs b/src/test/rustdoc/aux/rustdoc-default-impl.rs new file mode 100644 index 00000000000..c2ff7a0054f --- /dev/null +++ b/src/test/rustdoc/aux/rustdoc-default-impl.rs @@ -0,0 +1,36 @@ +// Copyright 2015 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. + +#![feature(optin_builtin_traits)] +#![feature(core)] + +pub mod bar { + use std::marker; + + pub trait Bar: 'static {} + + impl Bar for .. {} + + pub trait Foo { + fn foo(&self) {} + } + + impl Foo { + pub fn test<T: Bar>(&self) {} + } + + pub struct TypeId; + + impl TypeId { + pub fn of<T: Bar + ?Sized>() -> TypeId { + panic!() + } + } +} diff --git a/src/test/rustdoc/aux/rustdoc-extern-default-method.rs b/src/test/rustdoc/aux/rustdoc-extern-default-method.rs new file mode 100644 index 00000000000..861562753f9 --- /dev/null +++ b/src/test/rustdoc/aux/rustdoc-extern-default-method.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type="lib"] + +pub trait Trait { + fn provided(&self) {} +} + +pub struct Struct; + +impl Trait for Struct { + fn provided(&self) {} +} diff --git a/src/test/rustdoc/aux/rustdoc-extern-method.rs b/src/test/rustdoc/aux/rustdoc-extern-method.rs new file mode 100644 index 00000000000..96a7a8378b7 --- /dev/null +++ b/src/test/rustdoc/aux/rustdoc-extern-method.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_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/aux/rustdoc-ffi.rs b/src/test/rustdoc/aux/rustdoc-ffi.rs new file mode 100644 index 00000000000..e06dbe76dbb --- /dev/null +++ b/src/test/rustdoc/aux/rustdoc-ffi.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_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/aux/rustdoc-impl-parts-crosscrate.rs b/src/test/rustdoc/aux/rustdoc-impl-parts-crosscrate.rs new file mode 100644 index 00000000000..6e8f80c8f5f --- /dev/null +++ b/src/test/rustdoc/aux/rustdoc-impl-parts-crosscrate.rs @@ -0,0 +1,15 @@ +// Copyright 2015 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. + +#![feature(optin_builtin_traits)] + +pub trait AnOibit {} + +impl AnOibit for .. {} diff --git a/src/test/rustdoc/aux/variant-struct.rs b/src/test/rustdoc/aux/variant-struct.rs new file mode 100644 index 00000000000..d846c0adf61 --- /dev/null +++ b/src/test/rustdoc/aux/variant-struct.rs @@ -0,0 +1,15 @@ +// Copyright 2016 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. + +pub enum Foo { + Bar { + qux: (), + } +} diff --git a/src/test/rustdoc/inline_cross/aux/rustdoc-hidden-sig.rs b/src/test/rustdoc/inline_cross/aux/rustdoc-hidden-sig.rs new file mode 100644 index 00000000000..e2bc153ce0d --- /dev/null +++ b/src/test/rustdoc/inline_cross/aux/rustdoc-hidden-sig.rs @@ -0,0 +1,22 @@ +// Copyright 2016 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. + +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/aux/rustdoc-nonreachable-impls.rs b/src/test/rustdoc/inline_cross/aux/rustdoc-nonreachable-impls.rs new file mode 100644 index 00000000000..22a311d5797 --- /dev/null +++ b/src/test/rustdoc/inline_cross/aux/rustdoc-nonreachable-impls.rs @@ -0,0 +1,44 @@ +// Copyright 2016 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. + +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 reexported correctly + impl Qux for ::Foo {} + impl Qux for Wobble {} + impl ::Bark for Wobble {} + impl ::Woof for Wobble {} +} |
