mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-06 08:36:52 -04:00
Rollup merge of #156122 - GuillaumeGomez:doc-cfg-test, r=Urgau
Add a `doc_cfg` regression test to ensure foreign types impls are working as expected Fixes https://github.com/rust-lang/rust/issues/150268. This is the last case mentioned in the issue that wasn't tested. With this, the issue can be closed. r? @Urgau
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// This test ensures that the `doc_cfg` feature works on foreign types impl.
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/150268>.
|
||||
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![feature(doc_cfg)]
|
||||
#![crate_name = "foo"]
|
||||
|
||||
//@has 'foo/trait.Blob.html'
|
||||
//@has - '//*[@id="impl-Blob-for-Box%3CR%3E"]//*[@class="stab portability"]' 'Available on non-crate feature alloc only.'
|
||||
|
||||
pub trait Blob {}
|
||||
|
||||
#[cfg(not(feature = "alloc"))]
|
||||
impl<R: ?Sized> Blob for std::boxed::Box<R> {}
|
||||
Reference in New Issue
Block a user