]> git.lizzy.rs Git - rust.git/blob - src/test/ui/statics/static-methods-in-traits.rs
Rollup merge of #100861 - RalfJung:const-ice, r=oli-obk
[rust.git] / src / test / ui / statics / static-methods-in-traits.rs
1 // run-pass
2
3 mod a {
4     pub trait Foo {
5         fn foo() -> Self;
6     }
7
8     impl Foo for isize {
9         fn foo() -> isize {
10             3
11         }
12     }
13
14     impl Foo for usize {
15         fn foo() -> usize {
16             5
17         }
18     }
19 }
20
21 pub fn main() {
22     let x: isize = a::Foo::foo();
23     let y: usize = a::Foo::foo();
24     assert_eq!(x, 3);
25     assert_eq!(y, 5);
26 }