File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ // run-pass
2+
3+ pub trait Foo < T > {
4+ fn foo ( self ) -> T ;
5+ }
6+
7+ impl < ' a , T > Foo < T > for & ' a str where & ' a str : Into < T > {
8+ fn foo ( self ) -> T {
9+ panic ! ( ) ;
10+ }
11+ }
12+
13+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ // run-pass
2+
3+ pub struct Bar < T > {
4+ items : Vec < & ' static str > ,
5+ inner : T ,
6+ }
7+
8+ pub trait IntoBar < T > {
9+ fn into_bar ( self ) -> Bar < T > ;
10+ }
11+
12+ impl < ' a , T > IntoBar < T > for & ' a str where & ' a str : Into < T > {
13+ fn into_bar ( self ) -> Bar < T > {
14+ Bar {
15+ items : Vec :: new ( ) ,
16+ inner : self . into ( ) ,
17+ }
18+ }
19+ }
20+
21+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ // run-pass
2+
3+ pub struct Item {
4+ _inner : & ' static str ,
5+ }
6+
7+ pub struct Bar < T > {
8+ items : Vec < Item > ,
9+ inner : T ,
10+ }
11+
12+ pub trait IntoBar < T > {
13+ fn into_bar ( self ) -> Bar < T > ;
14+ }
15+
16+ impl < ' a , T > IntoBar < T > for & ' a str where & ' a str : Into < T > {
17+ fn into_bar ( self ) -> Bar < T > {
18+ Bar {
19+ items : Vec :: new ( ) ,
20+ inner : self . into ( ) ,
21+ }
22+ }
23+ }
24+
25+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments