about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-02-08 17:42:22 +0800
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-02-18 16:11:23 +0800
commit0da7adc8283211ffc649d169a94deed20f331c81 (patch)
tree5bb0320bf50bcde430936a8ef8e062fb3bf03da6 /src/test/rustdoc
parentf838a425e3134d036a7d9632935111a569ac7446 (diff)
downloadrust-0da7adc8283211ffc649d169a94deed20f331c81.tar.gz
rust-0da7adc8283211ffc649d169a94deed20f331c81.zip
rustdoc: Collect traits in scope for lang items
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/intra-doc/auxiliary/extern-lang-item-impl-dep.rs29
-rw-r--r--src/test/rustdoc/intra-doc/extern-lang-item-impl.rs11
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/rustdoc/intra-doc/auxiliary/extern-lang-item-impl-dep.rs b/src/test/rustdoc/intra-doc/auxiliary/extern-lang-item-impl-dep.rs
new file mode 100644
index 00000000000..87ae2f096bb
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/auxiliary/extern-lang-item-impl-dep.rs
@@ -0,0 +1,29 @@
+// no-prefer-dynamic
+
+#![feature(lang_items)]
+
+#![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 {
+    #[lang = "f64_runtime"]
+    impl f64 {
+        /// [f64::clone]
+        pub fn method() {}
+    }
+}
+
+#[lang = "eh_personality"]
+fn foo() {}
+
+#[panic_handler]
+fn bar(_: &core::panic::PanicInfo) -> ! { loop {} }
diff --git a/src/test/rustdoc/intra-doc/extern-lang-item-impl.rs b/src/test/rustdoc/intra-doc/extern-lang-item-impl.rs
new file mode 100644
index 00000000000..f64f886f076
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/extern-lang-item-impl.rs
@@ -0,0 +1,11 @@
+// Reexport of a structure that derefs to a type with lang item impls having doc links in their
+// comments. The doc link points to an associated item, so we check that traits in scope for that
+// link are populated.
+
+// aux-build:extern-lang-item-impl-dep.rs
+
+#![no_std]
+
+extern crate extern_lang_item_impl_dep;
+
+pub use extern_lang_item_impl_dep::DerefsToF64;