diff --git a/tests/rustdoc-html/inline_cross/assoc-const-private-fields-99630.rs b/tests/rustdoc-html/inline_cross/assoc-const-private-fields-99630.rs new file mode 100644 index 0000000000000..b37c11d607d21 --- /dev/null +++ b/tests/rustdoc-html/inline_cross/assoc-const-private-fields-99630.rs @@ -0,0 +1,14 @@ +//! Regression test for . +//! +//! Re-exporting a type from another crate must not leak the private fields used +//! in the initializer of one of its associated constants. + +//@ aux-build:assoc-const-private-fields.rs + +#![crate_name = "foo"] + +extern crate assoc_const_private_fields; + +//@ has foo/struct.HasPrivateFields.html +//@ matches - '//*[@id="associatedconstant.ASSOC"]' '^pub const ASSOC: HasPrivateFields$' +pub use assoc_const_private_fields::HasPrivateFields; diff --git a/tests/rustdoc-html/inline_cross/auxiliary/assoc-const-private-fields.rs b/tests/rustdoc-html/inline_cross/auxiliary/assoc-const-private-fields.rs new file mode 100644 index 0000000000000..42f838cf4fc6d --- /dev/null +++ b/tests/rustdoc-html/inline_cross/auxiliary/assoc-const-private-fields.rs @@ -0,0 +1,7 @@ +pub struct HasPrivateFields { + _private: (), +} + +impl HasPrivateFields { + pub const ASSOC: Self = Self { _private: () }; +}