MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / main

Function main

tests/binary/generics/src/main.rs:45–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45trait StaticConvert<T> {
46 fn convert(value: T) -> Self;
47}
48
49impl StaticConvert<i32> for i64 {
50 fn convert(value: i32) -> Self {
51 value as i64 + 1
52 }
53}
54
55impl StaticConvert<i32> for bool {
56 fn convert(value: i32) -> Self {
57 value != 0
58 }
59}
60
61fn add_const<const N: i32>(value: i32) -> i32 {
62 value + N
63}
64
65fn main() {
66 let a = identity(42);
67 let b = identity("hello");
68
69 assert!(a == 42);
70 assert!(b.len() == 5);
71
72 let swapped = swap(1, "two");
73 assert!(swapped.0 == "two");

Callers

nothing calls this directly

Calls 3

swapFunction · 0.85
flipMethod · 0.80
identityFunction · 0.70

Tested by

no test coverage detected