Lines Matching defs:overflow
4115 mod overflow {
6303 // * overflow may trigger when adding `len` to `cap` (in number of elements)
6304 // * overflow may trigger when multiplying `new_cap` by size_of::<T> (to get bytes)
6319 // Check isize::MAX doesn't count as an overflow
6321 panic!("isize::MAX shouldn't trigger an overflow!");
6325 panic!("isize::MAX shouldn't trigger an overflow!");
6329 // Check isize::MAX + 1 does count as overflow
6332 panic!("isize::MAX + 1 should trigger an overflow!")
6335 // Check usize::MAX does count as overflow
6338 panic!("usize::MAX should trigger an overflow!")
6360 panic!("isize::MAX shouldn't trigger an overflow!");
6363 panic!("isize::MAX shouldn't trigger an overflow!");
6368 panic!("isize::MAX + 1 should trigger an overflow!");
6376 // Should always overflow in the add-to-len
6379 panic!("usize::MAX should trigger an overflow!")
6400 panic!("isize::MAX shouldn't trigger an overflow!");
6403 panic!("isize::MAX shouldn't trigger an overflow!");
6409 panic!("isize::MAX + 1 should trigger an overflow!")
6414 panic!("usize::MAX should trigger an overflow!")
6433 panic!("isize::MAX shouldn't trigger an overflow!");
6436 panic!("isize::MAX shouldn't trigger an overflow!");
6441 panic!("isize::MAX + 1 should trigger an overflow!");
6451 panic!("usize::MAX should trigger an overflow!")
7982 // * overflow may trigger when adding `len` to `cap` (in number of elements)
7983 // * overflow may trigger when multiplying `new_cap` by size_of::<T> (to get bytes)
7998 // Check isize::MAX doesn't count as an overflow
8000 panic!("isize::MAX shouldn't trigger an overflow!");
8004 panic!("isize::MAX shouldn't trigger an overflow!");
8008 // Check isize::MAX + 1 does count as overflow
8011 panic!("isize::MAX + 1 should trigger an overflow!")
8014 // Check usize::MAX does count as overflow
8017 panic!("usize::MAX should trigger an overflow!")
8039 panic!("isize::MAX shouldn't trigger an overflow!");
8042 panic!("isize::MAX shouldn't trigger an overflow!");
8047 panic!("isize::MAX + 1 should trigger an overflow!");
8055 // Should always overflow in the add-to-len
8058 panic!("usize::MAX should trigger an overflow!")
8067 panic!("isize::MAX shouldn't trigger an overflow!");
8070 panic!("isize::MAX shouldn't trigger an overflow!");
8075 panic!("isize::MAX + 1 should trigger an overflow!");
8086 panic!("usize::MAX should trigger an overflow!");
8107 panic!("isize::MAX shouldn't trigger an overflow!");
8110 panic!("isize::MAX shouldn't trigger an overflow!");
8116 panic!("isize::MAX + 1 should trigger an overflow!")
8121 panic!("usize::MAX should trigger an overflow!")
8140 panic!("isize::MAX shouldn't trigger an overflow!");
8143 panic!("isize::MAX shouldn't trigger an overflow!");
8148 panic!("isize::MAX + 1 should trigger an overflow!");
8158 panic!("usize::MAX should trigger an overflow!")
8166 panic!("isize::MAX shouldn't trigger an overflow!");
8169 panic!("isize::MAX shouldn't trigger an overflow!");
8174 panic!("isize::MAX + 1 should trigger an overflow!");
8184 panic!("usize::MAX should trigger an overflow!")
12361 // * overflow may trigger when adding `len` to `cap` (in number of elements)
12362 // * overflow may trigger when multiplying `new_cap` by size_of::<T> (to get bytes)
12377 // Check isize::MAX doesn't count as an overflow
12379 panic!("isize::MAX shouldn't trigger an overflow!");
12383 panic!("isize::MAX shouldn't trigger an overflow!");
12387 // Check isize::MAX + 1 does count as overflow
12390 panic!("isize::MAX + 1 should trigger an overflow!")
12393 // Check usize::MAX does count as overflow
12396 panic!("usize::MAX should trigger an overflow!")
12415 panic!("isize::MAX shouldn't trigger an overflow!");
12418 panic!("isize::MAX shouldn't trigger an overflow!");
12423 panic!("isize::MAX + 1 should trigger an overflow!");
12431 // Should always overflow in the add-to-len
12434 panic!("usize::MAX should trigger an overflow!")
12443 panic!("isize::MAX shouldn't trigger an overflow!");
12446 panic!("isize::MAX shouldn't trigger an overflow!");
12451 panic!("isize::MAX + 1 should trigger an overflow!");
12462 panic!("usize::MAX should trigger an overflow!");
12483 panic!("isize::MAX shouldn't trigger an overflow!");
12486 panic!("isize::MAX shouldn't trigger an overflow!");
12492 panic!("isize::MAX + 1 should trigger an overflow!")
12497 panic!("usize::MAX should trigger an overflow!")
12515 panic!("isize::MAX shouldn't trigger an overflow!");
12518 panic!("isize::MAX shouldn't trigger an overflow!");
12523 panic!("isize::MAX + 1 should trigger an overflow!");
12533 panic!("usize::MAX should trigger an overflow!")
12541 panic!("isize::MAX shouldn't trigger an overflow!");
12544 panic!("isize::MAX shouldn't trigger an overflow!");
12549 panic!("isize::MAX + 1 should trigger an overflow!");
12559 panic!("usize::MAX should trigger an overflow!")
14456 /// * Catches all overflows in capacity computations (promotes them to "capacity overflow" panics).
14845 // This guarantees exponential growth. The doubling cannot overflow
14948 // * We don't overflow `usize::MAX` and actually allocate too little.
14950 // On 64-bit we just need to check for overflow since trying to allocate
14968 panic!("capacity overflow");
15452 /// This function will panic if the capacity would overflow.
15462 /// A panic upon overflow:
21417 panic!("capacity overflow");
21848 // if you mem::forget Rcs (or Weaks), the ref-count can overflow, and then
21870 // We want to abort on overflow instead of dropping the value.
21894 // We want to abort on overflow instead of dropping the value.
22475 /// This function will panic if the capacity would overflow.
22485 /// A panic upon overflow:
22506 let capacity = self.len().checked_mul(n).expect("capacity overflow");
24150 // NOTE: this code currently ignores the possibility of overflow
24152 // to deal with overflow.
24552 // is `mem::forget`ing Arcs. If we don't do this the count can overflow
25758 panic!("capacity overflow");
32388 // It's used to divide rather than multiply sizes, to rule out overflow,
40835 assert!(cap > capacity, "capacity overflow");
40993 .expect("capacity overflow");
41140 // We don't have to worry about an overflow as neither `self.len()` nor `self.capacity()`
43214 assert!(len < MAXIMUM_ZST_CAPACITY, "capacity overflow");
43929 #[should_panic = "capacity overflow"]
44842 // FIXME: 2 * hole.pos() + 1 or 2 * hole.pos() + 2 could overflow
44900 // FIXME: 2 * hole.pos() + 1 or 2 * hole.pos() + 2 could overflow
46016 // `Vec<T>`, so `i` cannot overflow an `isize`, and the `self.ptr.add(i)`
46179 // NB can't overflow since we would have had to alloc the address space
46185 // truly exceeds usize::MAX, which would eventually lead to a capacity overflow anyway.
46189 panic!("capacity overflow");
46489 _ => panic!("capacity overflow"),
48358 * and `len - read` never overflow and that the copy is always
48442 // or if the length increment would overflow for zero-sized types.
49315 // NB can't overflow since we would have had to alloc the address space