add feature gate doc_masked and tests
This commit is contained in:
parent
c491e195c4
commit
bb6de3c9ce
5 changed files with 87 additions and 0 deletions
14
src/test/compile-fail/feature-gate-doc_masked.rs
Normal file
14
src/test/compile-fail/feature-gate-doc_masked.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[doc(masked)] //~ ERROR: #[doc(masked)] is experimental
|
||||
extern crate std as realstd;
|
||||
|
||||
fn main() {}
|
||||
29
src/test/rustdoc/doc-masked.rs
Normal file
29
src/test/rustdoc/doc-masked.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(doc_masked)]
|
||||
|
||||
#![doc(masked)]
|
||||
extern crate std as realstd;
|
||||
|
||||
// @has doc_masked/struct.LocalStruct.html
|
||||
// @has - '//*[@class="impl"]//code' 'impl LocalTrait for LocalStruct'
|
||||
// @!has - '//*[@class="impl"]//code' 'impl Copy for LocalStruct'
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct LocalStruct;
|
||||
|
||||
// @has doc_masked/trait.LocalTrait.html
|
||||
// @has - '//*[@id="implementors-list"]//code' 'impl LocalTrait for LocalStruct'
|
||||
// @!has - '//*[@id="implementors-list"]//code' 'impl LocalTrait for usize'
|
||||
pub trait LocalTrait { }
|
||||
|
||||
impl LocalTrait for LocalStruct { }
|
||||
|
||||
impl LocalTrait for usize { }
|
||||
Loading…
Add table
Add a link
Reference in a new issue