about summary refs log tree commit diff
path: root/tests/rustdoc/enum/enum-variant-non_exhaustive.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-28 22:13:42 +0000
committerbors <bors@rust-lang.org>2025-06-28 22:13:42 +0000
commitcf38b8e663f15db10ce49d7bbce02c99fc3dbc0c (patch)
tree188e9299c1c3de8ac30fedbe365acb8fe49da568 /tests/rustdoc/enum/enum-variant-non_exhaustive.rs
parent11ad40bb839ca16f74784b4ab72596ad85587298 (diff)
parenta62de822fa254bb062a9f927c00d7cc82580d8e4 (diff)
downloadrust-cf38b8e663f15db10ce49d7bbce02c99fc3dbc0c.tar.gz
rust-cf38b8e663f15db10ce49d7bbce02c99fc3dbc0c.zip
Auto merge of #143157 - matthiaskrgr:rollup-90rtm3a, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - rust-lang/rust#142708 (Do not include NUL-terminator in computed length)
 - rust-lang/rust#142963 (Skip unnecessary components in x64 try builds)
 - rust-lang/rust#142987 (rustdoc: show attributes on enum variants)
 - rust-lang/rust#143031 (Add windows-gnullvm hosts to the manifest)
 - rust-lang/rust#143082 (update internal `send_signal` comment)
 - rust-lang/rust#143110 (Use tidy to sort `sym::*` items)
 - rust-lang/rust#143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - rust-lang/rust#143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-i586-gnu-i586-i686-musl
Diffstat (limited to 'tests/rustdoc/enum/enum-variant-non_exhaustive.rs')
-rw-r--r--tests/rustdoc/enum/enum-variant-non_exhaustive.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc/enum/enum-variant-non_exhaustive.rs b/tests/rustdoc/enum/enum-variant-non_exhaustive.rs
new file mode 100644
index 00000000000..ea0234a49f6
--- /dev/null
+++ b/tests/rustdoc/enum/enum-variant-non_exhaustive.rs
@@ -0,0 +1,17 @@
+// regression test for https://github.com/rust-lang/rust/issues/142599
+
+#![crate_name = "foo"]
+
+//@ snapshot type-code 'foo/enum.Type.html' '//pre[@class="rust item-decl"]/code'
+pub enum Type {
+    #[non_exhaustive]
+    // attribute that should not be shown
+    #[warn(unsafe_code)]
+    Variant,
+}
+
+// we would love to use the `following-sibling::` axis
+// (along with an `h2[@id="aliased-type"]` query),
+// but unfortunately python doesn't implement that.
+//@ snapshot type-alias-code 'foo/type.TypeAlias.html' '//pre[@class="rust item-decl"][2]/code'
+pub type TypeAlias = Type;