File: non-local.rs

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ aux-build:type_dependent_lib.rs
//@ run-pass
extern crate type_dependent_lib;

use type_dependent_lib::*;

fn main() {
    let s = Struct::<42>::new();
    assert_eq!(s.same_ty::<7>(), (42, 7));
    assert_eq!(s.different_ty::<19>(), (42, 19));
    assert_eq!(Struct::<1337>::new().different_ty::<96>(), (1337, 96));
    assert_eq!(
        Struct::<18>::new()
            .we_have_to_go_deeper::<19>()
            .containing_ty::<Option<u32>, 3>(),
        (27, 3),
    );

    let s = Struct::<7>::new();
    assert_eq!(s.foo::<18>(), 18);
}