File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
branches/try/src/test/compile-fail Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 336c8d2e9c6b276b162bdb3edd43706372e6eddd
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 474b324eda10440d6568ef872a7307d38e7de95b
5
- refs/heads/try: 9fe8d8602d9400131ebcd258014c8d9b8ddfcf05
5
+ refs/heads/try: 70192ab7796b5c25b0f6ef015f6e3ceacf73a9b8
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ extern crate collections;
16
16
use std:: collections:: HashMap ;
17
17
18
18
fn main ( ) {
19
+ let tmp;
19
20
let mut buggy_map: HashMap < usize , & usize > = HashMap :: new ( ) ;
20
21
buggy_map. insert ( 42 , & * box 1 ) ; //~ ERROR borrowed value does not live long enough
21
22
22
23
// but it is ok if we use a temporary
23
- let tmp = box 2 ;
24
+ tmp = box 2 ;
24
25
buggy_map. insert ( 43 , & * tmp) ;
25
26
}
Original file line number Diff line number Diff line change 13
13
use std:: cell:: RefCell ;
14
14
15
15
fn main ( ) {
16
- let c = RefCell :: new ( vec ! [ ] ) ;
17
16
let mut y = 1 us;
17
+ let c = RefCell :: new ( vec ! [ ] ) ;
18
18
c. push ( box || y = 0 ) ;
19
19
c. push ( box || y = 0 ) ;
20
20
//~^ ERROR cannot borrow `y` as mutable more than once at a time
21
21
}
22
22
23
23
fn ufcs ( ) {
24
- let c = RefCell :: new ( vec ! [ ] ) ;
25
24
let mut y = 1 us;
25
+ let c = RefCell :: new ( vec ! [ ] ) ;
26
26
27
27
Push :: push ( & c, box || y = 0 ) ;
28
28
Push :: push ( & c, box || y = 0 ) ;
You can’t perform that action at this time.
0 commit comments