diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/rustdoc/intra-doc/auxiliary | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc/intra-doc/auxiliary')
13 files changed, 124 insertions, 0 deletions
diff --git a/tests/rustdoc/intra-doc/auxiliary/empty.rs b/tests/rustdoc/intra-doc/auxiliary/empty.rs new file mode 100644 index 000000000..d11c69f81 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/empty.rs @@ -0,0 +1 @@ +// intentionally empty diff --git a/tests/rustdoc/intra-doc/auxiliary/empty2.rs b/tests/rustdoc/intra-doc/auxiliary/empty2.rs new file mode 100644 index 000000000..d11c69f81 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/empty2.rs @@ -0,0 +1 @@ +// intentionally empty diff --git a/tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs b/tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs new file mode 100644 index 000000000..d9a08cb41 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs @@ -0,0 +1,28 @@ +// no-prefer-dynamic + +#![feature(lang_items, rustc_attrs)] +#![crate_type = "rlib"] +#![no_std] + +pub struct DerefsToF64(f64); + +impl core::ops::Deref for DerefsToF64 { + type Target = f64; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +mod inner { + impl f64 { + /// [f64::clone] + #[rustc_allow_incoherent_impl] + pub fn method() {} + } +} + +#[lang = "eh_personality"] +fn foo() {} + +#[panic_handler] +fn bar(_: &core::panic::PanicInfo) -> ! { loop {} } diff --git a/tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs b/tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs new file mode 100644 index 000000000..ee4138b68 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs @@ -0,0 +1,11 @@ +#[derive(Clone)] +pub struct PublicStruct; + +mod inner { + use super::PublicStruct; + + impl PublicStruct { + /// [PublicStruct::clone] + pub fn method() {} + } +} diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs b/tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs new file mode 100644 index 000000000..db3bb38ad --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs @@ -0,0 +1,3 @@ +#![crate_name="inner"] + +//! ooh, i'm a rebel just for [kicks] diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs b/tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs new file mode 100644 index 000000000..a4db2ffc4 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs @@ -0,0 +1,4 @@ +#![crate_name = "inner"] + +/// Documentation, including a link to [std::ptr] +pub fn f() {} diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs b/tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs new file mode 100644 index 000000000..fc51995a9 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs @@ -0,0 +1,6 @@ +#![crate_name = "inner"] + +/// Links to [f()] +pub struct Inner; + +pub fn f() {} diff --git a/tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs b/tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs new file mode 100644 index 000000000..6142dcda9 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs @@ -0,0 +1,6 @@ +pub trait ThisTrait { + fn asdf(&self); + + /// let's link to [`asdf`](ThisTrait::asdf) + fn qwop(&self); +} diff --git a/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs b/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs new file mode 100644 index 000000000..2b8fdec1f --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs @@ -0,0 +1,4 @@ +pub trait Trait { + /// [`u8::clone`] + fn method(); +} diff --git a/tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs b/tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs new file mode 100644 index 000000000..2f3d069bd --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs @@ -0,0 +1,2 @@ +/// This will be referred to by the test docstring +pub struct Something; diff --git a/tests/rustdoc/intra-doc/auxiliary/my-core.rs b/tests/rustdoc/intra-doc/auxiliary/my-core.rs new file mode 100644 index 000000000..e22feb03a --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/my-core.rs @@ -0,0 +1,23 @@ +#![feature(no_core, lang_items, rustdoc_internals, rustc_attrs)] +#![no_core] +#![rustc_coherence_is_core] +#![crate_type="rlib"] + +#[doc(primitive = "char")] +/// Some char docs +mod char {} + +impl char { + pub fn len_utf8(self) -> usize { + 42 + } +} + +#[lang = "sized"] +pub trait Sized {} + +#[lang = "clone"] +pub trait Clone: Sized {} + +#[lang = "copy"] +pub trait Copy: Clone {} diff --git a/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs b/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs new file mode 100644 index 000000000..5ba132f25 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs @@ -0,0 +1,34 @@ +// force-host +// no-prefer-dynamic +// compile-flags: --crate-type proc-macro + +#![crate_type="proc-macro"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro_derive(DeriveA)] +pub fn a_derive(input: TokenStream) -> TokenStream { + input +} + +#[proc_macro_derive(DeriveB)] +pub fn b_derive(input: TokenStream) -> TokenStream { + input +} + +#[proc_macro_derive(DeriveTrait)] +pub fn trait_derive(input: TokenStream) -> TokenStream { + input +} + +#[proc_macro_attribute] +pub fn attr_a(input: TokenStream, _args: TokenStream) -> TokenStream { + input +} + +#[proc_macro_attribute] +pub fn attr_b(input: TokenStream, _args: TokenStream) -> TokenStream { + input +} diff --git a/tests/rustdoc/intra-doc/auxiliary/pub-struct.rs b/tests/rustdoc/intra-doc/auxiliary/pub-struct.rs new file mode 100644 index 000000000..75d428932 --- /dev/null +++ b/tests/rustdoc/intra-doc/auxiliary/pub-struct.rs @@ -0,0 +1 @@ +pub struct SomeStruct; |