Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fa046d2

Browse files
committed
Auto merge of rust-lang#5097 - phansch:remove_fixme, r=llogiq
Resolve FIXME: String::new is now a const fn `const_string_new` is stable since Rust 1.39 changelog: none
2 parents b6a9766 + 4533310 commit fa046d2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tests/ui/missing_const_for_fn/could_be_const.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ fn two() -> i32 {
2525
abc
2626
}
2727

28-
// FIXME: This is a false positive in the `is_min_const_fn` function.
29-
// At least until the `const_string_new` feature is stabilzed.
28+
// Could be const (since Rust 1.39)
3029
fn string() -> String {
3130
String::new()
3231
}

tests/ui/missing_const_for_fn/could_be_const.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,39 @@ LL | | }
2626
| |_^
2727

2828
error: this could be a `const fn`
29-
--> $DIR/could_be_const.rs:30:1
29+
--> $DIR/could_be_const.rs:29:1
3030
|
3131
LL | / fn string() -> String {
3232
LL | | String::new()
3333
LL | | }
3434
| |_^
3535

3636
error: this could be a `const fn`
37-
--> $DIR/could_be_const.rs:35:1
37+
--> $DIR/could_be_const.rs:34:1
3838
|
3939
LL | / unsafe fn four() -> i32 {
4040
LL | | 4
4141
LL | | }
4242
| |_^
4343

4444
error: this could be a `const fn`
45-
--> $DIR/could_be_const.rs:40:1
45+
--> $DIR/could_be_const.rs:39:1
4646
|
4747
LL | / fn generic<T>(t: T) -> T {
4848
LL | | t
4949
LL | | }
5050
| |_^
5151

5252
error: this could be a `const fn`
53-
--> $DIR/could_be_const.rs:44:1
53+
--> $DIR/could_be_const.rs:43:1
5454
|
5555
LL | / fn sub(x: u32) -> usize {
5656
LL | | unsafe { transmute(&x) }
5757
LL | | }
5858
| |_^
5959

6060
error: this could be a `const fn`
61-
--> $DIR/could_be_const.rs:63:9
61+
--> $DIR/could_be_const.rs:62:9
6262
|
6363
LL | / pub fn b(self, a: &A) -> B {
6464
LL | | B

0 commit comments

Comments
 (0)