|
| 1 | +#![feature(extern_types, rustc_attrs, rustdoc_internals, trait_alias)] |
| 2 | +#![allow(internal_features)] |
| 3 | +#![no_std] |
| 4 | + |
| 5 | +//@ has foo/keyword.while.html |
| 6 | +//@ hasraw search.index/name/*.js while |
| 7 | +//@ !hasraw search.index/name/*.js w_keyword |
| 8 | +#[doc(keyword = "while")] |
| 9 | +mod w_keyword {} |
| 10 | + |
| 11 | +//@ has foo/primitive.u32.html |
| 12 | +//@ hasraw search.index/name/*.js u32 |
| 13 | +//@ !hasraw search.index/name/*.js u_primitive |
| 14 | +#[rustc_doc_primitive = "u32"] |
| 15 | +mod u_primitive {} |
| 16 | + |
| 17 | +//@ has foo/x_mod/index.html |
| 18 | +//@ hasraw search.index/name/*.js x_mod |
| 19 | +pub mod x_mod {} |
| 20 | + |
| 21 | +//@ hasraw foo/index.html y_crate |
| 22 | +//@ hasraw search.index/name/*.js y_crate |
| 23 | +#[doc(no_inline)] |
| 24 | +pub extern crate core as y_crate; |
| 25 | + |
| 26 | +//@ hasraw foo/index.html z_import |
| 27 | +//@ hasraw search.index/name/*.js z_import |
| 28 | +#[doc(no_inline)] |
| 29 | +pub use core::option as z_import; |
| 30 | + |
| 31 | +//@ has foo/struct.AStruct.html |
| 32 | +//@ hasraw search.index/name/*.js AStruct |
| 33 | +pub struct AStruct { |
| 34 | + //@ hasraw foo/struct.AStruct.html a_structfield |
| 35 | + //@ hasraw search.index/name/*.js a_structfield |
| 36 | + pub a_structfield: i32, |
| 37 | +} |
| 38 | + |
| 39 | +//@ has foo/enum.AEnum.html |
| 40 | +//@ hasraw search.index/name/*.js AEnum |
| 41 | +pub enum AEnum { |
| 42 | + //@ hasraw foo/enum.AEnum.html AVariant |
| 43 | + //@ hasraw search.index/name/*.js AVariant |
| 44 | + AVariant, |
| 45 | +} |
| 46 | + |
| 47 | +//@ has foo/fn.a_fn.html |
| 48 | +//@ hasraw search.index/name/*.js a_fn |
| 49 | +pub fn a_fn() {} |
| 50 | + |
| 51 | +//@ has foo/type.AType.html |
| 52 | +//@ hasraw search.index/name/*.js AType |
| 53 | +pub type AType = AStruct; |
| 54 | + |
| 55 | +//@ has foo/static.a_static.html |
| 56 | +//@ hasraw search.index/name/*.js a_static |
| 57 | +pub static a_static: i32 = 1; |
| 58 | + |
| 59 | +//@ has foo/trait.ATrait.html |
| 60 | +//@ hasraw search.index/name/*.js ATrait |
| 61 | +pub trait ATrait { |
| 62 | + //@ hasraw foo/trait.ATrait.html a_tymethod |
| 63 | + //@ hasraw search.index/name/*.js a_tymethod |
| 64 | + fn a_tymethod(); |
| 65 | + //@ hasraw foo/trait.ATrait.html AAssocType |
| 66 | + //@ hasraw search.index/name/*.js AAssocType |
| 67 | + type AAssocType; |
| 68 | + //@ hasraw foo/trait.ATrait.html AAssocConst |
| 69 | + //@ hasraw search.index/name/*.js AAssocConst |
| 70 | + const AAssocConst: bool; |
| 71 | +} |
| 72 | + |
| 73 | +// skip ItemType::Impl, since impls are anonymous |
| 74 | +// and have no search entry |
| 75 | + |
| 76 | +impl AStruct { |
| 77 | + //@ hasraw foo/struct.AStruct.html a_method |
| 78 | + //@ hasraw search.index/name/*.js a_method |
| 79 | + pub fn a_method() {} |
| 80 | +} |
| 81 | + |
| 82 | +//@ has foo/macro.a_macro.html |
| 83 | +//@ hasraw search.index/name/*.js a_macro |
| 84 | +#[macro_export] |
| 85 | +macro_rules! a_macro { |
| 86 | + () => {}; |
| 87 | +} |
| 88 | + |
| 89 | +//@ has foo/constant.A_CONSTANT.html |
| 90 | +//@ hasraw search.index/name/*.js A_CONSTANT |
| 91 | +pub const A_CONSTANT: i32 = 1; |
| 92 | + |
| 93 | +//@ has foo/union.AUnion.html |
| 94 | +//@ hasraw search.index/name/*.js AUnion |
| 95 | +pub union AUnion { |
| 96 | + //@ hasraw foo/union.AUnion.html a_unionfield |
| 97 | + //@ hasraw search.index/name/*.js a_unionfield |
| 98 | + pub a_unionfield: i32, |
| 99 | +} |
| 100 | + |
| 101 | +extern "C" { |
| 102 | + //@ has foo/foreigntype.AForeignType.html |
| 103 | + //@ hasraw search.index/name/*.js AForeignType |
| 104 | + pub type AForeignType; |
| 105 | +} |
| 106 | + |
| 107 | +// procattribute and procderive are defined in |
| 108 | +// bar.rs, because they only work with proc_macro |
| 109 | +// crate type. |
| 110 | + |
| 111 | +//@ has foo/traitalias.ATraitAlias.html |
| 112 | +//@ hasraw search.index/name/*.js ATraitAlias |
| 113 | +pub trait ATraitAlias = ATrait; |
| 114 | + |
| 115 | +//@ has foo/attribute.doc.html |
| 116 | +//@ hasraw search.index/name/*.js doc |
| 117 | +//@ !hasraw search.index/name/*.js aa_mod |
| 118 | +#[doc(attribute = "doc")] |
| 119 | +mod aa_mod {} |
0 commit comments