+#[test]
+#[should_panic]
+fn test_replace_range_start_overflow() {
+ let mut s = String::from("123");
+ s.replace_range((Excluded(usize::MAX), Included(0)), "");
+}
+
+#[test]
+#[should_panic]
+fn test_replace_range_end_overflow() {
+ let mut s = String::from("456");
+ s.replace_range((Included(0), Included(usize::MAX)), "");
+}
+