2021-10-16 10:52:24 -05:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
// @has 'foo/fn.foo.html'
|
2023-01-14 11:58:55 -06:00
|
|
|
// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]'
|
2021-10-16 10:52:24 -05:00
|
|
|
#[rustc_legacy_const_generics(1)]
|
|
|
|
pub fn foo<const Y: usize>(x: usize, z: usize) -> [usize; 3] {
|
|
|
|
[x, Y, z]
|
|
|
|
}
|
|
|
|
|
|
|
|
// @has 'foo/fn.bar.html'
|
2023-01-14 11:58:55 -06:00
|
|
|
// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]'
|
2021-10-16 10:52:24 -05:00
|
|
|
#[rustc_legacy_const_generics(1, 2)]
|
|
|
|
pub fn bar<const Y: usize, const Z: usize>(x: usize) -> [usize; 3] {
|
|
|
|
[x, Y, z]
|
|
|
|
}
|