]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/uninferred-consts-during-codegen-2.rs
Rollup merge of #107525 - RalfJung:pointee-info, r=eddyb
[rust.git] / tests / ui / const-generics / uninferred-consts-during-codegen-2.rs
1 // run-pass
2
3 use std::fmt;
4
5 struct Array<T>(T);
6
7 impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<[T; N]> {
8     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
9         f.debug_list().entries((&self.0 as &[T]).iter()).finish()
10     }
11 }
12
13 fn main() {
14     assert_eq!(format!("{:?}", Array([1, 2, 3])), "[1, 2, 3]");
15 }