]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/type-dependent/non-local.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / type-dependent / non-local.rs
1 // aux-build:type_dependent_lib.rs
2 // run-pass
3 extern crate type_dependent_lib;
4
5 use type_dependent_lib::*;
6
7 fn main() {
8     let s = Struct::<42>::new();
9     assert_eq!(s.same_ty::<7>(), (42, 7));
10     assert_eq!(s.different_ty::<19>(), (42, 19));
11     assert_eq!(Struct::<1337>::new().different_ty::<96>(), (1337, 96));
12     assert_eq!(
13         Struct::<18>::new()
14             .we_have_to_go_deeper::<19>()
15             .containing_ty::<Option<u32>, 3>(),
16         (27, 3),
17     );
18
19     let s = Struct::<7>::new();
20     assert_eq!(s.foo::<18>(), 18);
21 }