blob: 279a78422541b50af5e35613b3e381fb41b4906d [file] [log] [blame]
Noah Levee58c062021-11-26 15:03:16 -08001#![allow(incomplete_features)]
Boxyd0c11bf2024-07-14 13:38:51 +01002#![feature(adt_const_params, unsized_const_params)]
varkor7f9dc732019-05-28 22:53:36 +01003#![crate_name = "foo"]
4
Oli Scherer4512f212023-10-31 13:58:03 +00005use std::marker::ConstParamTy;
6
7#[derive(PartialEq, Eq, ConstParamTy)]
Guillaume Gomez2caeaf52019-05-12 16:53:39 +02008pub enum Order {
9 Sorted,
10 Unsorted,
11}
12
Guillaume Gomez1b670352024-06-21 14:03:08 +020013//@ has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet<T, const ORDER: Order>'
14//@ has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
15//@ has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
Guillaume Gomez2caeaf52019-05-12 16:53:39 +020016pub struct VSet<T, const ORDER: Order> {
17 inner: Vec<T>,
18}
19
Guillaume Gomez1b670352024-06-21 14:03:08 +020020//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>'
Noah Levee58c062021-11-26 15:03:16 -080021impl<T> VSet<T, { Order::Sorted }> {
Guillaume Gomez2caeaf52019-05-12 16:53:39 +020022 pub fn new() -> Self {
23 Self { inner: Vec::new() }
24 }
25}
26
Guillaume Gomez1b670352024-06-21 14:03:08 +020027//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>'
Noah Levee58c062021-11-26 15:03:16 -080028impl<T> VSet<T, { Order::Unsorted }> {
Guillaume Gomez2caeaf52019-05-12 16:53:39 +020029 pub fn new() -> Self {
30 Self { inner: Vec::new() }
31 }
32}
Oliver Middletone2305d02020-01-05 23:19:42 +000033
34pub struct Escape<const S: &'static str>;
35
Guillaume Gomez1b670352024-06-21 14:03:08 +020036//@ has foo/struct.Escape.html '//*[@id="impl-Escape%3C%22%3Cscript%3Ealert(%5C%22Escape%5C%22);%3C/script%3E%22%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
Noah Levee58c062021-11-26 15:03:16 -080037impl Escape<r#"<script>alert("Escape");</script>"#> {
Oliver Middletone2305d02020-01-05 23:19:42 +000038 pub fn f() {}
39}