]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type-dependent/non-local.rs
Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyup
[rust.git] / src / test / ui / const-generics / type-dependent / non-local.rs
1 // aux-build:type_dependent_lib.rs
2 // run-pass
3 // revisions: full min
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6 #![cfg_attr(min, feature(min_const_generics))]
7
8 extern crate type_dependent_lib;
9
10 use type_dependent_lib::*;
11
12 fn main() {
13     let s = Struct::<42>::new();
14     assert_eq!(s.same_ty::<7>(), (42, 7));
15     assert_eq!(s.different_ty::<19>(), (42, 19));
16     assert_eq!(Struct::<1337>::new().different_ty::<96>(), (1337, 96));
17     assert_eq!(
18         Struct::<18>::new()
19             .we_have_to_go_deeper::<19>()
20             .containing_ty::<Option<u32>, 3>(),
21         (27, 3),
22     );
23
24     let s = Struct::<7>::new();
25     assert_eq!(s.foo::<18>(), 18);
26 }