mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
25 lines
537 B
Rust
25 lines
537 B
Rust
// Regression test for <https://github.com/rust-lang/rust/issues/92859>.
|
|
|
|
#![allow(incomplete_features)]
|
|
#![feature(generic_const_exprs)]
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
// @has 'foo/trait.Foo.html'
|
|
|
|
pub trait Foo: Sized {
|
|
const WIDTH: usize;
|
|
|
|
fn arrayify(self) -> [Self; Self::WIDTH];
|
|
}
|
|
|
|
impl<T: Sized> Foo for T {
|
|
const WIDTH: usize = 1;
|
|
|
|
// @has - '//*[@id="tymethod.arrayify"]/*[@class="code-header"]' \
|
|
// 'fn arrayify(self) -> [Self; Self::WIDTH]'
|
|
fn arrayify(self) -> [Self; Self::WIDTH] {
|
|
[self]
|
|
}
|
|
}
|