Skip to content

Rollup of 11 pull requests #50546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
May 9, 2018
Merged
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
20a795e
Mention Result<!, E> in never docs.
Apr 15, 2018
2843e64
turn `ManuallyDrop::new` into a constant function
japaric Apr 21, 2018
4b444f5
Updated RELEASES.md for 1.26.0
May 1, 2018
fc6d6c9
Fixed typos
May 5, 2018
160063a
make `String::new()` const
F001 May 5, 2018
6c8ec84
Remove some transmutes
est31 May 5, 2018
b61a4c2
make the const constructor unstable
japaric May 7, 2018
85f3ecf
Update RELEASES.md
Aaronepower May 7, 2018
31a8ffe
Added regression function match value test, closes #44333
May 7, 2018
1abed9c
Add explanation for #[must_use] on Result
Manishearth May 7, 2018
6e49c83
Add explanation for #[must_use] on Debug builders
Manishearth May 7, 2018
f8b774f
Add explanation for #[must_use] on mutex guards
Manishearth May 7, 2018
a72a080
Add explanation for #[must_use] on string replace methods
Manishearth May 7, 2018
663c096
Cleanup a `use` in a raw_vec test
glandium May 8, 2018
576aab9
Update the Cargo/stdsimd submodules
alexcrichton May 5, 2018
23b6e46
Add more logarithm constants
May 8, 2018
65ea0ff
Optimize string handling in lit_token().
nnethercote May 4, 2018
e6a309e
Rollup merge of #50456 - alexcrichton:update-cargo, r=alexcrichton
kennytm May 9, 2018
0fa0850
Rollup merge of #50525 - nnethercote:lit_token, r=michaelwoerister
kennytm May 9, 2018
8e7f6db
Rollup merge of #50539 - clarcharr:log_const, r=dtolnay
kennytm May 9, 2018
bb690c6
Rollup merge of #49988 - clarcharr:never_docs, r=steveklabnik
kennytm May 9, 2018
dea03f1
Rollup merge of #50148 - japaric:const-manuallydrop, r=oli-obk
kennytm May 9, 2018
111786d
Update RELEASES.md
Aaronepower May 9, 2018
1f4718a
Rollup merge of #50460 - F001:const_string, r=kennytm
kennytm May 9, 2018
e6e58a3
Rollup merge of #50464 - est31:master, r=rkruppe
kennytm May 9, 2018
4c3ab33
Rollup merge of #50505 - Aaronepower:add-test, r=oli-obk
kennytm May 9, 2018
4924fea
Rollup merge of #50511 - Manishearth:must-use, r=QuietMisdreavus
kennytm May 9, 2018
553d25e
Rollup merge of #50527 - glandium:cleanup, r=sfackler
kennytm May 9, 2018
99cd9a9
Rollup merge of #49523 - Aaronepower:master, r=Mark-Simulacrum
kennytm May 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@
#![feature(inclusive_range_methods)]
#![cfg_attr(stage0, feature(generic_param_attrs))]
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]

#![cfg_attr(not(test), feature(fn_traits, i128))]
#![cfg_attr(test, feature(test))]
3 changes: 2 additions & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
@@ -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() }
}

Original file line number Diff line number Diff line change
@@ -8,10 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test that Vec::new() can be used for constants
// Test several functions can be used for constants
// 1. Vec::new()
// 2. String::new()

#![feature(const_vec_new)]
#![feature(const_string_new)]

const MY_VEC: Vec<usize> = Vec::new();

const MY_STRING: String = String::new();

pub fn main() {}