Skip to content

Commit 171c77e

Browse files
add test
1 parent c58e52e commit 171c77e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! rustdoc regression test for #149288: const generic parameter types may depend on
2+
//! other generics when `generic_const_parameter_types` is enabled.
3+
#![allow(incomplete_features)]
4+
#![feature(adt_const_params, generic_const_parameter_types)]
5+
#![crate_name = "foo"]
6+
7+
pub struct Bar<const N: usize, const M: [u8; N]>;
8+
9+
pub fn takes<const N: usize, const M: [u8; N]>(_: Bar<N, M>) {}
10+
11+
pub fn instantiate() {
12+
takes(Bar::<2, { [1; 2] }>);
13+
}
14+
15+
//@ has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar<const N: usize, const M: [u8; N]>'
16+
//@ has foo/fn.takes.html '//pre[@class="rust item-decl"]' 'pub fn takes<const N: usize, const M: [u8; N]>(_: Bar<N, M>)'

0 commit comments

Comments
 (0)