]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/str/mod.rs
Auto merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
[rust.git] / library / core / src / str / mod.rs
index 2120bf61d759d739fb6b2ac7696bc7c6d29b4ee1..fbc0fc397a5dfd0b1c41a546ba05af96bef6f970 100644 (file)
@@ -91,10 +91,12 @@ const fn slice_error_fail(s: &str, begin: usize, end: usize) -> ! {
     }
 }
 
+#[track_caller]
 const fn slice_error_fail_ct(_: &str, _: usize, _: usize) -> ! {
     panic!("failed to slice string");
 }
 
+#[track_caller]
 fn slice_error_fail_rt(s: &str, begin: usize, end: usize) -> ! {
     const MAX_DISPLAY_LENGTH: usize = 256;
     let trunc_len = s.floor_char_boundary(MAX_DISPLAY_LENGTH);
@@ -2640,5 +2642,4 @@ struct UnsafeBytesToStr impl<'a> Fn = |bytes: &'a [u8]| -> &'a str {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg(not(bootstrap))]
 impl !crate::error::Error for &str {}