We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ed19532 + 69e5d7d commit 27a1c56Copy full SHA for 27a1c56
src/doc/unstable-book/src/language-features/adt-const-params.md
@@ -0,0 +1,32 @@
1
+# `adt_const_params`
2
+
3
+The tracking issue for this feature is: [#95174]
4
5
+[#95174]: https://github.com/rust-lang/rust/issues/95174
6
7
+------------------------
8
9
+Allows for using more complex types for const parameters, such as structs or enums.
10
11
+```rust
12
+#![feature(adt_const_params)]
13
14
+#[derive(PartialEq, Eq)]
15
+enum Foo {
16
+ A,
17
+ B,
18
+ C,
19
+}
20
21
22
+struct Bar {
23
+ flag: bool,
24
25
26
+fn is_foo_a_and_bar_true<const F: Foo, const B: Bar>() -> bool {
27
+ match (F, B.flag) {
28
+ (Foo::A, true) => true,
29
+ _ => false,
30
+ }
31
32
+```
0 commit comments