diff options
| author | F001 <changchun.fan@qq.com> | 2018-05-05 16:34:43 +0800 |
|---|---|---|
| committer | F001 <changchun.fan@qq.com> | 2018-05-05 16:38:27 +0800 |
| commit | 160063aad2206a35e6312bfaa159f0f4475af0ae (patch) | |
| tree | cfd992dac840404b7921f39670bdc27ef6d82f20 /src/liballoc/string.rs | |
| parent | 1d168261a1bc0031ef27de735992a4842fd62553 (diff) | |
| download | rust-160063aad2206a35e6312bfaa159f0f4475af0ae.tar.gz rust-160063aad2206a35e6312bfaa159f0f4475af0ae.zip | |
make `String::new()` const
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 2f84d5f7f86..da9afdd2ca3 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -380,7 +380,8 @@ impl String { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub fn new() -> String { + #[rustc_const_unstable(feature = "const_string_new")] + pub const fn new() -> String { String { vec: Vec::new() } } |
