fn break_after_whole() {
    let log = &RefCell::new(Vec::new());

    // CASE 1: Fixed-size array itself is stored in _r slot.
    loop {
        let _r = [D(log, 10),
                  D(log, 11),
                  D(log, 12)];
        break;
    }
    assert_eq!(&log.borrow()[..], &[10, 11, 12]);
    log.borrow_mut().clear();

    // CASE 2: Slice (borrow of array) is stored in _r slot.
    loop {
        let _r = &[D(log, 20),
                   D(log, 21),
                   D(log, 22)];
        break;
    }
    assert_eq!(&log.borrow()[..], &[20, 21, 22]);
    log.borrow_mut().clear();

    // CASE 3: (Borrow of) slice-index of array is stored in _r slot.
    loop {
        let _r = &[D(log, 30),
                   D(log, 31),
                   D(log, 32)][..];
        break;
    }
    assert_eq!(&log.borrow()[..], &[30, 31, 32]);
    log.borrow_mut().clear();
}
// The purpose of these functions is to test what happens when we
// panic after an array has been constructed in its entirety.
//
// It is meant to act as proof that we still need to continue
// scheduling the destruction of an array even after we've scheduling
// drop for its elements during construction; the latter is tested by
// `fn break_during_elem()`.
The purpose of these functions is to test what happens when we
panic after an array has been constructed in its entirety.

It is meant to act as proof that we still need to continue
scheduling the destruction of an array even after we've scheduling
drop for its elements during construction; the latter is tested by
`fn break_during_elem()`.
The purpose of these functions is to test what happens when we panic after an array has been constructed in its entirety . It is meant to act as proof that we still need to continue scheduling the destruction of an array even after we ' ve scheduling drop for its elements during construction ; the latter is tested by ` fn break_during_elem () ` .
fn break_after_whole() {
    let log = &RefCell::new(Vec::new());
    // CASE 1: Fixed-size array itself is stored in _r slot.
    loop {
        let _r = [D(log, 10),
                  D(log, 11),
                  D(log, 12)];
        break;
    }
    assert_eq!(&log.borrow()[..], &[10, 11, 12]);
    log.borrow_mut().clear();
    // CASE 2: Slice (borrow of array) is stored in _r slot.
    loop {
        let _r = &[D(log, 20),
                   D(log, 21),
                   D(log, 22)];
        break;
    }
    assert_eq!(&log.borrow()[..], &[20, 21, 22]);
    log.borrow_mut().clear();
    // CASE 3: (Borrow of) slice-index of array is stored in _r slot.
    loop {
        let _r = &[D(log, 30),
                   D(log, 31),
                   D(log, 32)][..];
        break;
    }
    assert_eq!(&log.borrow()[..], &[30, 31, 32]);
    log.borrow_mut().clear();
}
fn break_after_whole ( ) { let log = & RefCell :: new ( Vec :: new ( ) ) ; // CASE 1: Fixed-size array itself is stored in _r slot. loop { let _r = [ D ( log , 10 ) , D ( log , 11 ) , D ( log , 12 ) ] ; break ; } assert_eq ! ( log borrow ( ) [ ] [ 10 11 12 ] ) ; log . borrow_mut ( ) . clear ( ) ; // CASE 2: Slice (borrow of array) is stored in _r slot. loop { let _r = & [ D ( log , 20 ) , D ( log , 21 ) , D ( log , 22 ) ] ; break ; } assert_eq ! ( log borrow ( ) [ ] [ 20 21 22 ] ) ; log . borrow_mut ( ) . clear ( ) ; // CASE 3: (Borrow of) slice-index of array is stored in _r slot. loop { let _r = & [ D ( log , 30 ) , D ( log , 31 ) , D ( log , 32 ) ] [ .. ] ; break ; } assert_eq ! ( log borrow ( ) [ ] [ 30 31 32 ] ) ; log . borrow_mut ( ) . clear ( ) ; }
The purpose of these functions is to test what happens when we
panic after an array has been constructed in its entirety.
The purpose of these functions is to test what happens when we panic after an array has been constructed in its entirety .