File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
tests/ui/missing_const_for_fn Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff 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)
3029fn string ( ) -> String {
3130 String :: new ( )
3231}
Original file line number Diff line number Diff line change @@ -26,39 +26,39 @@ LL | | }
2626 | |_^
2727
2828error: this could be a `const fn`
29- --> $DIR/could_be_const.rs:30 :1
29+ --> $DIR/could_be_const.rs:29 :1
3030 |
3131LL | / fn string() -> String {
3232LL | | String::new()
3333LL | | }
3434 | |_^
3535
3636error: this could be a `const fn`
37- --> $DIR/could_be_const.rs:35 :1
37+ --> $DIR/could_be_const.rs:34 :1
3838 |
3939LL | / unsafe fn four() -> i32 {
4040LL | | 4
4141LL | | }
4242 | |_^
4343
4444error: this could be a `const fn`
45- --> $DIR/could_be_const.rs:40 :1
45+ --> $DIR/could_be_const.rs:39 :1
4646 |
4747LL | / fn generic<T>(t: T) -> T {
4848LL | | t
4949LL | | }
5050 | |_^
5151
5252error: this could be a `const fn`
53- --> $DIR/could_be_const.rs:44 :1
53+ --> $DIR/could_be_const.rs:43 :1
5454 |
5555LL | / fn sub(x: u32) -> usize {
5656LL | | unsafe { transmute(&x) }
5757LL | | }
5858 | |_^
5959
6060error: this could be a `const fn`
61- --> $DIR/could_be_const.rs:63 :9
61+ --> $DIR/could_be_const.rs:62 :9
6262 |
6363LL | / pub fn b(self, a: &A) -> B {
6464LL | | B
You can’t perform that action at this time.
0 commit comments