make check-docs complained “error: use of unstable library feature XYZ.” to the doctests which I tried to add to an unstable core API.
In fact there doesn’t seem to be any doctests around unstable items in the stdlib. Am I not supposed to write any doctests? That is odd. Who can verify unstable APIs without some minimal documentation of which doctest is an important part?
Do I perhaps have to write something like this?
```
#![feature(xyz)]
fn main() {
let x = Foo;
assert!(x.f())
}
```
#[unstable(feature="xyz", since="1.9.0")]
impl Foo {
fn f() -> bool { true }
}
If so, the feature attribute in the doctest is not only ugly but also confusing for git log because removing it after stabilization will clutter the history.
Doctests should be treated as something internal to the unstable API itself and automatically be exempted from feature thing.