]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / const-generics / uninferred-consts-during-codegen-1.rs
CommitLineData
dc9dc135
XL
1// run-pass
2
3#![feature(const_generics)]
4//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
5
6use std::fmt;
7
8struct Array<T, const N: usize>([T; N]);
9
60c5eb7d 10impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<T, N> {
dc9dc135
XL
11 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
12 f.debug_list().entries(self.0.iter()).finish()
13 }
14}
15
16fn main() {
17 assert_eq!(format!("{:?}", Array([1, 2, 3])), "[1, 2, 3]");
18}