]> git.proxmox.com Git - rustc.git/blob - tests/rustdoc-ui/coverage/statics-consts.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / rustdoc-ui / coverage / statics-consts.rs
1 // compile-flags:-Z unstable-options --show-coverage
2 // check-pass
3
4 //! gotta make sure we can count statics and consts correctly, too
5
6 /// static like electricity, right?
7 pub static THIS_STATIC: usize = 0;
8
9 /// (it's not electricity, is it)
10 pub const THIS_CONST: usize = 1;
11
12 /// associated consts show up separately, but let's throw them in as well
13 pub trait SomeTrait {
14 /// just like that, yeah
15 const ASSOC_CONST: usize;
16 }
17
18 pub struct SomeStruct;
19
20 impl SomeStruct {
21 /// wait, structs can have them too, can't forget those
22 pub const ASSOC_CONST: usize = 100;
23 }