Skip to content

Commit 50b6e7d

Browse files
authored
Rollup merge of #98535 - GuillaumeGomez:regression-test-92859, r=lcnr
Add regression test for generic const in rustdoc Fixes #92859. r? ```@lcnr```
2 parents 0c09846 + 0398aa8 commit 50b6e7d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/92859>.
2+
3+
#![allow(incomplete_features)]
4+
#![feature(generic_const_exprs)]
5+
6+
#![crate_name = "foo"]
7+
8+
// @has 'foo/trait.Foo.html'
9+
10+
pub trait Foo: Sized {
11+
const WIDTH: usize;
12+
13+
fn arrayify(self) -> [Self; Self::WIDTH];
14+
}
15+
16+
impl<T: Sized> Foo for T {
17+
const WIDTH: usize = 1;
18+
19+
// @has - '//*[@id="tymethod.arrayify"]/*[@class="code-header"]' \
20+
// 'fn arrayify(self) -> [Self; Self::WIDTH]'
21+
fn arrayify(self) -> [Self; Self::WIDTH] {
22+
[self]
23+
}
24+
}

0 commit comments

Comments
 (0)