File tree 5 files changed +105
-0
lines changed
5 files changed +105
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ // for this issue, this code must be built in a library
12
+
13
+ use std:: cast;
14
+
15
+ trait A { }
16
+ struct B ;
17
+ impl A for B { }
18
+
19
+ fn bar < T > ( _: & mut A , _: & T ) { }
20
+
21
+ fn foo < T > ( t : & T ) {
22
+ let b = B ;
23
+ bar ( unsafe { cast:: transmute ( & b as & A ) } , t)
24
+ }
25
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ trait A { }
12
+ struct B ;
13
+ impl A for B { }
14
+
15
+ fn foo ( _: & mut A ) { }
16
+
17
+ fn main ( ) {
18
+ let mut b = B ;
19
+ foo ( & mut b as & mut A ) ;
20
+ }
21
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ trait A { }
12
+ struct B ;
13
+ impl A for B { }
14
+
15
+ struct C < ' self > {
16
+ foo : & ' self mut A ,
17
+ }
18
+
19
+ fn foo ( a : & mut A ) {
20
+ C { foo : a } ;
21
+ }
22
+
23
+ fn main ( ) {
24
+ }
25
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ use std:: rt:: io;
12
+
13
+ fn foo ( a : & mut io:: Writer ) {
14
+ a. write ( [ ] )
15
+ }
16
+
17
+ fn main ( ) { }
18
+
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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.
4
+ //
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.
10
+
11
+ // aux-build:issue_8401.rs
12
+ // xfail-fast
13
+
14
+ extern mod issue_8401;
15
+
16
+ pub fn main ( ) { }
You can’t perform that action at this time.
0 commit comments