]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc/const-generics/const-impl.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / src / test / rustdoc / const-generics / const-impl.rs
CommitLineData
a2a8927a
XL
1#![allow(incomplete_features)]
2
94222f64 3#![feature(adt_const_params)]
48663c56 4
dc9dc135 5#![crate_name = "foo"]
48663c56 6
e74abb32 7#[derive(PartialEq, Eq)]
48663c56
XL
8pub enum Order {
9 Sorted,
10 Unsorted,
11}
12
13// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
17df50a5
XL
14// @has foo/struct.VSet.html '//div[@id="impl-Send"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
15// @has foo/struct.VSet.html '//div[@id="impl-Sync"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
48663c56
XL
16pub struct VSet<T, const ORDER: Order> {
17 inner: Vec<T>,
18}
19
a2a8927a
XL
20// @has foo/struct.VSet.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Sorted }>'
21impl<T> VSet<T, { Order::Sorted }> {
48663c56
XL
22 pub fn new() -> Self {
23 Self { inner: Vec::new() }
24 }
25}
26
a2a8927a
XL
27// @has foo/struct.VSet.html '//div[@id="impl-1"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Unsorted }>'
28impl<T> VSet<T, { Order::Unsorted }> {
48663c56
XL
29 pub fn new() -> Self {
30 Self { inner: Vec::new() }
31 }
32}
dfeec247
XL
33
34pub struct Escape<const S: &'static str>;
35
a2a8927a
XL
36// @has foo/struct.Escape.html '//div[@id="impl"]/h3[@class="code-header in-band"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
37impl Escape<r#"<script>alert("Escape");</script>"#> {
dfeec247
XL
38 pub fn f() {}
39}