]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/generic-const.rs
Use proper const printing in rustdoc
[rust.git] / src / test / rustdoc / generic-const.rs
1 #![feature(const_generics)]
2 #![crate_name = "foo"]
3
4 // ignore-tidy-linelength
5
6 pub enum Order {
7     Sorted,
8     Unsorted,
9 }
10
11 // @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
12 // @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
13 // @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
14 pub struct VSet<T, const ORDER: Order> {
15     inner: Vec<T>,
16 }
17
18 // @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
19 impl <T> VSet<T, {Order::Sorted}> {
20     pub fn new() -> Self {
21         Self { inner: Vec::new() }
22     }
23 }
24
25 // @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
26 impl <T> VSet<T, {Order::Unsorted}> {
27     pub fn new() -> Self {
28         Self { inner: Vec::new() }
29     }
30 }