2022-06-26 07:01:00 -05:00
|
|
|
// Regression test for <https://github.com/rust-lang/rust/issues/92859>.
|
|
|
|
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
#![feature(generic_const_exprs)]
|
|
|
|
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has 'foo/trait.Foo.html'
|
2022-06-26 07:01:00 -05:00
|
|
|
|
|
|
|
pub trait Foo: Sized {
|
|
|
|
const WIDTH: usize;
|
|
|
|
|
|
|
|
fn arrayify(self) -> [Self; Self::WIDTH];
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: Sized> Foo for T {
|
|
|
|
const WIDTH: usize = 1;
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has - '//*[@id="tymethod.arrayify"]/*[@class="code-header"]' \
|
2022-06-26 07:01:00 -05:00
|
|
|
// 'fn arrayify(self) -> [Self; Self::WIDTH]'
|
|
|
|
fn arrayify(self) -> [Self; Self::WIDTH] {
|
|
|
|
[self]
|
|
|
|
}
|
|
|
|
}
|