diff options
| author | bors <bors@rust-lang.org> | 2019-05-16 09:58:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-16 09:58:30 +0000 |
| commit | 1962adea6ad9b992516ae56ad7f8c5bc33b951cb (patch) | |
| tree | c22f44a66cb659b62e795883d0d661949ea563fc /src/liballoc/string.rs | |
| parent | 472211ab0ae2beec0fbec23c7f90f5d15c51317d (diff) | |
| parent | b59ce94bceca7d0be2b6d81820d95bdaf0f020df (diff) | |
| download | rust-1962adea6ad9b992516ae56ad7f8c5bc33b951cb.tar.gz rust-1962adea6ad9b992516ae56ad7f8c5bc33b951cb.zip | |
Auto merge of #60877 - Centril:rollup-j0o5mo5, r=Centril
Rollup of 6 pull requests Successful merges: - #59825 (string: implement From<&String> for String) - #59923 (Fix convert module's documentation links) - #60691 (Include expression to wait for to the span of Await) - #60769 (Update rustc book CLI docs.) - #60816 (README.md: Mention MSVC 2017+, not 2013(!)) - #60851 (Move `box` from the stable keyword to unstable keywords list) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 63f7769fee5..e74d37c1c2b 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -2189,6 +2189,14 @@ impl From<&str> for String { } } +#[stable(feature = "from_ref_string", since = "1.35.0")] +impl From<&String> for String { + #[inline] + fn from(s: &String) -> String { + s.clone() + } +} + // note: test pulls in libstd, which causes errors here #[cfg(not(test))] #[stable(feature = "string_from_box", since = "1.18.0")] |
