1 // Copyright 2014 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.
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.
12 use core::ops::{Range, RangeFull, RangeFrom, RangeTo};
20 impl Drop for HasDtor {
26 fn alloc_obj_with_dtor(b: &mut Bencher) {
32 // Test the Range structs without the syntactic sugar.
36 let r = Range { start: 2, end: 10 };
38 for (i, ri) in r.enumerate() {
40 assert!(ri >= 2 && ri < 10);
47 fn test_range_from() {
48 let r = RangeFrom { start: 2 };
50 for (i, ri) in r.take(10).enumerate() {
52 assert!(ri >= 2 && ri < 12);
61 let _ = RangeTo { end: 42 };
65 fn test_full_range() {