use core::hash;
use core::iter::FromIterator;
use core::mem;
- use core::ops::{self, Add, Index, IndexMut};
+ use core::ops::{self, Add, AddAssign, Index, IndexMut};
use core::ptr;
use core::str::pattern::Pattern;
use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
/// Violating these may cause problems like corrupting the allocator's
/// internal datastructures.
///
+ /// The ownership of `ptr` is effectively transferred to the
+ /// `String` which may then deallocate, reallocate or change the
+ /// contents of memory pointed to by the pointer at will. Ensure
+ /// that nothing else uses the pointer after calling this
+ /// function.
+ ///
/// # Examples
///
/// Basic usage:
}
}
+ #[stable(feature = "stringaddassign", since = "1.12.0")]
+ impl<'a> AddAssign<&'a str> for String {
+ #[inline]
+ fn add_assign(&mut self, other: &str) {
+ self.push_str(other);
+ }
+ }
+
#[stable(feature = "rust1", since = "1.0.0")]
impl ops::Index<ops::Range<usize>> for String {
type Output = str;