This repository was archived by the owner on May 28, 2025. It is now read-only.
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 {
25
25
abc
26
26
}
27
27
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)
30
29
fn string ( ) -> String {
31
30
String :: new ( )
32
31
}
Original file line number Diff line number Diff line change @@ -26,39 +26,39 @@ LL | | }
26
26
| |_^
27
27
28
28
error: this could be a `const fn`
29
- --> $DIR/could_be_const.rs:30 :1
29
+ --> $DIR/could_be_const.rs:29 :1
30
30
|
31
31
LL | / fn string() -> String {
32
32
LL | | String::new()
33
33
LL | | }
34
34
| |_^
35
35
36
36
error: this could be a `const fn`
37
- --> $DIR/could_be_const.rs:35 :1
37
+ --> $DIR/could_be_const.rs:34 :1
38
38
|
39
39
LL | / unsafe fn four() -> i32 {
40
40
LL | | 4
41
41
LL | | }
42
42
| |_^
43
43
44
44
error: this could be a `const fn`
45
- --> $DIR/could_be_const.rs:40 :1
45
+ --> $DIR/could_be_const.rs:39 :1
46
46
|
47
47
LL | / fn generic<T>(t: T) -> T {
48
48
LL | | t
49
49
LL | | }
50
50
| |_^
51
51
52
52
error: this could be a `const fn`
53
- --> $DIR/could_be_const.rs:44 :1
53
+ --> $DIR/could_be_const.rs:43 :1
54
54
|
55
55
LL | / fn sub(x: u32) -> usize {
56
56
LL | | unsafe { transmute(&x) }
57
57
LL | | }
58
58
| |_^
59
59
60
60
error: this could be a `const fn`
61
- --> $DIR/could_be_const.rs:63 :9
61
+ --> $DIR/could_be_const.rs:62 :9
62
62
|
63
63
LL | / pub fn b(self, a: &A) -> B {
64
64
LL | | B
You can’t perform that action at this time.
0 commit comments