1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-tidy-linelength
12 // compile-flags:-Zprint-trans-items=eager
18 fn bar<T>(&self, x: T);
21 impl SomeTrait for i64 {
23 //~ TRANS_ITEM fn trait_implementations::i64.SomeTrait[0]::foo[0]
26 fn bar<T>(&self, _: T) {}
29 impl SomeTrait for i32 {
31 //~ TRANS_ITEM fn trait_implementations::i32.SomeTrait[0]::foo[0]
34 fn bar<T>(&self, _: T) {}
37 pub trait SomeGenericTrait<T> {
39 fn bar<T2>(&self, x: T, y: T2);
42 // Concrete impl of generic trait
43 impl SomeGenericTrait<u32> for f64 {
45 //~ TRANS_ITEM fn trait_implementations::f64.SomeGenericTrait<u32>[0]::foo[0]
46 fn foo(&self, _: u32) {}
48 fn bar<T2>(&self, _: u32, _: T2) {}
51 // Generic impl of generic trait
52 impl<T> SomeGenericTrait<T> for f32 {
54 fn foo(&self, _: T) {}
55 fn bar<T2>(&self, _: T, _: T2) {}
58 //~ TRANS_ITEM fn trait_implementations::main[0]
60 //~ TRANS_ITEM fn trait_implementations::i32.SomeTrait[0]::bar[0]<char>
63 //~ TRANS_ITEM fn trait_implementations::f64.SomeGenericTrait<u32>[0]::bar[0]<&str>
64 0f64.bar(0u32, "&str");
66 //~ TRANS_ITEM fn trait_implementations::f64.SomeGenericTrait<u32>[0]::bar[0]<()>
69 //~ TRANS_ITEM fn trait_implementations::f32.SomeGenericTrait<T>[0]::foo[0]<char>
72 //~ TRANS_ITEM fn trait_implementations::f32.SomeGenericTrait<T>[0]::foo[0]<i64>
75 //~ TRANS_ITEM fn trait_implementations::f32.SomeGenericTrait<T>[0]::bar[0]<u32, ()>
78 //~ TRANS_ITEM fn trait_implementations::f32.SomeGenericTrait<T>[0]::bar[0]<&str, &str>
79 0f32.bar("&str", "&str");
82 //~ TRANS_ITEM drop-glue i8