Skip to content

Commit 5c75a48

Browse files
Add test for legacy-const-generic arguments
1 parent bd8d7e4 commit 5c75a48

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![crate_name = "foo"]
2+
#![feature(rustc_attrs)]
3+
4+
// @has 'foo/fn.foo.html'
5+
// @has - '//*[@class="rust fn"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]'
6+
#[rustc_legacy_const_generics(1)]
7+
pub fn foo<const Y: usize>(x: usize, z: usize) -> [usize; 3] {
8+
[x, Y, z]
9+
}
10+
11+
// @has 'foo/fn.bar.html'
12+
// @has - '//*[@class="rust fn"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]'
13+
#[rustc_legacy_const_generics(1, 2)]
14+
pub fn bar<const Y: usize, const Z: usize>(x: usize) -> [usize; 3] {
15+
[x, Y, z]
16+
}

0 commit comments

Comments
 (0)