]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/obtain-borrowck/test.rs
Rollup merge of #106407 - mejrs:attr_check, r=compiler-errors
[rust.git] / tests / run-make-fulldeps / obtain-borrowck / test.rs
1 trait X {
2     fn provided(&self) -> usize {
3         5
4     }
5     fn required(&self) -> u32;
6 }
7
8 struct Bar;
9
10 impl Bar {
11     fn new() -> Self {
12         Self
13     }
14 }
15
16 impl X for Bar {
17     fn provided(&self) -> usize {
18         1
19     }
20     fn required(&self) -> u32 {
21         7
22     }
23 }
24
25 const fn foo() -> usize {
26     1
27 }
28
29 fn main() {
30     let bar: [Bar; foo()] = [Bar::new()];
31     assert_eq!(bar[0].provided(), foo());
32 }