about summary refs log tree commit diff
path: root/tests/ui/generics/generic-extern-mangle.rs
blob: 80bb3217b5bbd86edfca3c1a535c82c40c2a36ba (plain)
1
2
3
4
5
6
7
8
9
//@ run-pass
use std::ops::Add;

extern "C" fn foo<T: Add>(a: T, b: T) -> T::Output { a + b }

fn main() {
    assert_eq!(100u8, foo(0u8, 100u8));
    assert_eq!(100u16, foo(0u16, 100u16));
}