diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-08-01 00:38:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-01 00:38:19 -0400 |
| commit | e6b80f34070f67f204d9b247c49e26da9328de35 (patch) | |
| tree | 5b62a5797309866e139fff7bd4e48ec71dcdc552 /tests | |
| parent | adcb3d3b4cd3b7c4cde642f3ed537037f293738e (diff) | |
| parent | 05a62c8a1172795709219aa5afc833eb1ab57c25 (diff) | |
| download | rust-e6b80f34070f67f204d9b247c49e26da9328de35.tar.gz rust-e6b80f34070f67f204d9b247c49e26da9328de35.zip | |
Rollup merge of #143849 - lolbinarycat:rustdoc-priv-normalize-143222, r=GuillaumeGomez
rustdoc: never link to unnamable items fixes rust-lang/rust#143222
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs | 12 | ||||
| -rw-r--r-- | tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs | 16 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs b/tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs new file mode 100644 index 00000000000..7f8e346c8be --- /dev/null +++ b/tests/rustdoc/reexport/auxiliary/wrap-unnamable-type.rs @@ -0,0 +1,12 @@ +pub trait Assoc { + type Ty; +} + +pub struct Foo(<Foo as crate::Assoc>::Ty); + +const _X: () = { + impl crate::Assoc for Foo { + type Ty = Bar; + } + pub struct Bar; +}; diff --git a/tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs b/tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs new file mode 100644 index 00000000000..9a8893786f5 --- /dev/null +++ b/tests/rustdoc/reexport/wrapped-unnamble-type-143222.rs @@ -0,0 +1,16 @@ +//@ compile-flags: -Z normalize-docs --document-private-items -Zunstable-options --show-type-layout +//@ aux-build:wrap-unnamable-type.rs +//@ build-aux-docs + +// regression test for https://github.com/rust-lang/rust/issues/143222 +// makes sure normalizing docs does not cause us to link to unnamable types +// in cross-crate reexports. + +#![crate_name = "foo"] + +extern crate wrap_unnamable_type as helper; + +//@ has 'foo/struct.Foo.html' +//@ !hasraw - 'struct.Bar.html' +#[doc(inline)] +pub use helper::Foo; |
