Skip to content

Commit 5dd3e5e

Browse files
Add a doc_cfg regression test to ensure foreign types impls are working as expected
1 parent ba27564 commit 5dd3e5e

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This test ensures that the `doc_cfg` feature works on foreign types impl.
2+
// Regression test for <https://github.com/rust-lang/rust/issues/150268>.
3+
4+
// ignore-tidy-linelength
5+
6+
#![feature(doc_cfg)]
7+
#![crate_name = "foo"]
8+
9+
//@has 'foo/trait.Blob.html'
10+
//@has - '//*[@id="impl-Blob-for-Box%3CR%3E"]//*[@class="stab portability"]' 'Available on non-crate feature alloc only.'
11+
12+
pub trait Blob {}
13+
14+
#[cfg(not(feature = "alloc"))]
15+
impl<R: ?Sized> Blob for std::boxed::Box<R> {}

0 commit comments

Comments
 (0)