File tree Expand file tree Collapse file tree 4 files changed +49
-12
lines changed Expand file tree Collapse file tree 4 files changed +49
-12
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,3 @@ fn unconstrained_type() {
1717 [ ] ;
1818 //~^ ERROR cannot determine a type for this expression: unconstrained type
1919}
20-
21- fn invalid_impl_within_scope ( ) {
22- {
23- use std:: ops:: Deref ;
24- struct Something ;
25-
26- impl Deref for Something { }
27- //~^ ERROR not all trait items implemented, missing: `Target`, `deref`
28-
29- * Something
30- } ;
31- }
Original file line number Diff line number Diff line change 1+ // Copyright 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.
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:: any:: Any ;
12+ fn main ( )
13+ {
14+ fn bar ( x : i32 ) ->i32 { 3 * x } ;
15+ let b: Box < Any > = Box :: new ( bar as fn ( _) ->_ ) ;
16+ b. downcast_ref :: < fn ( _) ->_ > ( ) ;
17+ //~^ ERROR cannot determine a type for this expression: unconstrained type
18+ }
Original file line number Diff line number Diff line change 1+ // Copyright 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.
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+ fn main ( ) {
12+ "" . chars ( ) . fold ( |_, _| ( ) , ( ) ) ;
13+ //~^ ERROR cannot determine a type for this expression: unconstrained type
14+ }
Original file line number Diff line number Diff line change 1+ // Copyright 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.
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+ fn main ( ) {
12+ use std:: mem:: { transmute, swap} ;
13+ let a = 1 ;
14+ let b = 2 ;
15+ unsafe { swap :: < & mut _ > ( transmute ( & a) , transmute ( & b) ) } ;
16+ //~^ ERROR cannot determine a type for this expression: unconstrained type
17+ }
You can’t perform that action at this time.
0 commit comments