diff options
| author | bors <bors@rust-lang.org> | 2018-04-26 11:07:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-26 11:07:14 +0000 |
| commit | 88cd36714c6d62393f18d8efa2ea2724e1ec4a9d (patch) | |
| tree | 5586d3e94e8d9f5d7c8ceee076b7d2bad179503a /src/liballoc | |
| parent | 3eca70a0c55e9f081ebff9a7af6fa25390d99b4c (diff) | |
| parent | 438f3ca01c325fcf5e2f0080c8a78b6b4a3f9095 (diff) | |
| download | rust-88cd36714c6d62393f18d8efa2ea2724e1ec4a9d.tar.gz rust-88cd36714c6d62393f18d8efa2ea2724e1ec4a9d.zip | |
Auto merge of #50245 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - #50177 (mark std::str::replace(,n) as #[must_use]) - #50207 (Hash EntryKind::AssociatedConst const data) - #50214 (Js improvements) - #50219 (Added missing `.` in docs.) Failed merges: - #50229 (Add setting to go to item if there is only one result)
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/str.rs | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index f5980f4599e..e52a0216dd3 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -60,7 +60,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// ## Thread Safety /// /// Unlike [`Rc<T>`], `Arc<T>` uses atomic operations for its reference -/// counting This means that it is thread-safe. The disadvantage is that +/// counting. This means that it is thread-safe. The disadvantage is that /// atomic operations are more expensive than ordinary memory accesses. If you /// are not sharing reference-counted values between threads, consider using /// [`Rc<T>`] for lower overhead. [`Rc<T>`] is a safe default, because the diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 6399be98cd5..021395d0c82 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -96,6 +96,7 @@ #![feature(dropck_eyepatch)] #![feature(exact_size_is_empty)] #![feature(fmt_internals)] +#![feature(fn_must_use)] #![feature(from_ref)] #![feature(fundamental)] #![feature(lang_items)] diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index cac94edf649..0cbe65db53c 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -207,6 +207,7 @@ impl str { /// let s = "this is old"; /// assert_eq!(s, s.replace("cookie monster", "little lamb")); /// ``` + #[must_use] #[stable(feature = "rust1", since = "1.0.0")] #[inline] pub fn replace<'a, P: Pattern<'a>>(&'a self, from: P, to: &str) -> String { @@ -246,6 +247,7 @@ impl str { /// let s = "this is old"; /// assert_eq!(s, s.replacen("cookie monster", "little lamb", 10)); /// ``` + #[must_use] #[stable(feature = "str_replacen", since = "1.16.0")] pub fn replacen<'a, P: Pattern<'a>>(&'a self, pat: P, to: &str, count: usize) -> String { // Hope to reduce the times of re-allocation |
