We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
String::new
1 parent d5fe583 commit 9b3e11fCopy full SHA for 9b3e11f
src/liballoc/string.rs
@@ -369,7 +369,7 @@ impl String {
369
/// ```
370
#[inline]
371
#[stable(feature = "rust1", since = "1.0.0")]
372
- #[rustc_const_unstable(feature = "const_string_new")]
+ #[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_string_new"))]
373
pub const fn new() -> String {
374
String { vec: Vec::new() }
375
}
src/test/ui/collections-const-new.rs
@@ -1,11 +1,9 @@
1
-// run-pass
+// check-pass
2
3
// Test several functions can be used for constants
4
// 1. Vec::new()
5
// 2. String::new()
6
7
-#![feature(const_string_new)]
8
-
9
const MY_VEC: Vec<usize> = Vec::new();
10
11
const MY_STRING: String = String::new();
0 commit comments