]> git.proxmox.com Git - rustc.git/blob - src/test/ui/builtin-superkinds/builtin-superkinds-capabilities-transitive.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / builtin-superkinds / builtin-superkinds-capabilities-transitive.rs
1 // run-pass
2 // Tests "transitivity" of super-builtin-kinds on traits. Here, if
3 // we have a Foo, we know we have a Bar, and if we have a Bar, we
4 // know we have a Send. So if we have a Foo we should know we have
5 // a Send. Basically this just makes sure rustc is using
6 // each_bound_trait_and_supertraits in type_contents correctly.
7
8
9 use std::sync::mpsc::{channel, Sender};
10
11 trait Bar : Send { }
12 trait Foo : Bar { }
13
14 impl <T: Send> Foo for T { }
15 impl <T: Send> Bar for T { }
16
17 fn foo<T: Foo + 'static>(val: T, chan: Sender<T>) {
18 chan.send(val).unwrap();
19 }
20
21 pub fn main() {
22 let (tx, rx) = channel();
23 foo(31337, tx);
24 assert_eq!(rx.recv().unwrap(), 31337);
25 }