We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 97fae38 + f0c9c1e commit 5a4c04cCopy full SHA for 5a4c04c
library/alloc/src/string.rs
@@ -1851,7 +1851,7 @@ impl String {
1851
}
1852
1853
/// Consumes and leaks the `String`, returning a mutable reference to the contents,
1854
- /// `&'static mut str`.
+ /// `&'a mut str`.
1855
///
1856
/// This is mainly useful for data that lives for the remainder of
1857
/// the program's life. Dropping the returned reference will cause a memory
@@ -1874,7 +1874,7 @@ impl String {
1874
/// ```
1875
#[unstable(feature = "string_leak", issue = "102929")]
1876
#[inline]
1877
- pub fn leak(self) -> &'static mut str {
+ pub fn leak<'a>(self) -> &'a mut str {
1878
let slice = self.vec.leak();
1879
unsafe { from_utf8_unchecked_mut(slice) }
1880
0 commit comments