Skip to content

Commit

Permalink
Add regression test for #92859
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 26, 2022
1 parent 7036449 commit 0398aa8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/rustdoc/generic_const_exprs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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]
}
}

0 comments on commit 0398aa8

Please sign in to comment.