File tree 6 files changed +19
-18
lines changed
src/test/ui/consts/min_const_fn
6 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ const fn foo() -> u32 { 42 }
12
12
13
13
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
14
14
// can't call non-min_const_fn
15
- const fn bar ( ) -> u32 { foo ( ) } //~ ERROR can only call other `const`
15
+ const fn bar ( ) -> u32 { foo ( ) } //~ ERROR can only call other `const fn `
16
16
17
17
#[ unstable( feature = "rust1" , issue="0" ) ]
18
18
const fn foo2 ( ) -> u32 { 42 }
19
19
20
20
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
21
21
// can't call non-min_const_fn
22
- const fn bar2 ( ) -> u32 { foo2 ( ) } //~ ERROR can only call other `const`
22
+ const fn bar2 ( ) -> u32 { foo2 ( ) } //~ ERROR can only call other `const fn `
23
23
24
24
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
25
25
// conformity is required, even with `const_fn` feature gate
@@ -31,6 +31,6 @@ const fn foo2_gated() -> u32 { 42 }
31
31
32
32
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
33
33
// can't call non-min_const_fn
34
- const fn bar2_gated ( ) -> u32 { foo2_gated ( ) } //~ ERROR can only call other `const`
34
+ const fn bar2_gated ( ) -> u32 { foo2_gated ( ) } //~ ERROR can only call other `const fn `
35
35
36
36
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
1
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo` is not stable as `const fn ` (see issue #57563)
2
2
--> $DIR/min_const_fn_libstd_stability.rs:15:25
3
3
|
4
4
LL | const fn bar() -> u32 { foo() }
5
5
| ^^^^^
6
6
|
7
7
= help: add #![feature(const_fn)] to the crate attributes to enable
8
8
9
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
9
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2` is not stable as `const fn ` (see issue #57563)
10
10
--> $DIR/min_const_fn_libstd_stability.rs:22:26
11
11
|
12
12
LL | const fn bar2() -> u32 { foo2() }
@@ -22,7 +22,7 @@ LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
22
22
|
23
23
= help: add #![feature(const_fn)] to the crate attributes to enable
24
24
25
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
25
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2_gated` is not stable as `const fn ` (see issue #57563)
26
26
--> $DIR/min_const_fn_libstd_stability.rs:34:32
27
27
|
28
28
LL | const fn bar2_gated() -> u32 { foo2_gated() }
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ const unsafe fn foo() -> u32 { 42 }
12
12
13
13
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
14
14
// can't call non-min_const_fn
15
- const unsafe fn bar ( ) -> u32 { unsafe { foo ( ) } } //~ ERROR can only call other `const`
15
+ const unsafe fn bar ( ) -> u32 { unsafe { foo ( ) } } //~ ERROR can only call other `const fn `
16
16
17
17
#[ unstable( feature = "rust1" , issue="0" ) ]
18
18
const unsafe fn foo2 ( ) -> u32 { 42 }
19
19
20
20
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
21
21
// can't call non-min_const_fn
22
- const unsafe fn bar2 ( ) -> u32 { unsafe { foo2 ( ) } } //~ ERROR can only call other `const`
22
+ const unsafe fn bar2 ( ) -> u32 { unsafe { foo2 ( ) } } //~ ERROR can only call other `const fn `
23
23
24
24
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
25
25
// conformity is required, even with `const_fn` feature gate
@@ -31,6 +31,7 @@ const unsafe fn foo2_gated() -> u32 { 42 }
31
31
32
32
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
33
33
// can't call non-min_const_fn
34
- const unsafe fn bar2_gated ( ) -> u32 { unsafe { foo2_gated ( ) } } //~ ERROR can only call other
34
+ const unsafe fn bar2_gated ( ) -> u32 { unsafe { foo2_gated ( ) } }
35
+ //~^ ERROR can only call other `const fn`
35
36
36
37
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
1
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo` is not stable as `const fn ` (see issue #57563)
2
2
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:15:41
3
3
|
4
4
LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
5
5
| ^^^^^
6
6
|
7
7
= help: add #![feature(const_fn)] to the crate attributes to enable
8
8
9
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
9
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2` is not stable as `const fn ` (see issue #57563)
10
10
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:22:42
11
11
|
12
12
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
@@ -22,7 +22,7 @@ LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
22
22
|
23
23
= help: add #![feature(const_fn)] to the crate attributes to enable
24
24
25
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
25
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2_gated` is not stable as `const fn ` (see issue #57563)
26
26
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:34:48
27
27
|
28
28
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
Original file line number Diff line number Diff line change @@ -12,21 +12,21 @@ const fn foo() -> u32 { 42 }
12
12
13
13
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
14
14
// can't call non-min_const_fn
15
- const unsafe fn bar ( ) -> u32 { foo ( ) } //~ ERROR can only call other `const`
15
+ const unsafe fn bar ( ) -> u32 { foo ( ) } //~ ERROR can only call other `const fn `
16
16
17
17
#[ unstable( feature = "rust1" , issue="0" ) ]
18
18
const fn foo2 ( ) -> u32 { 42 }
19
19
20
20
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
21
21
// can't call non-min_const_fn
22
- const unsafe fn bar2 ( ) -> u32 { foo2 ( ) } //~ ERROR can only call other `const`
22
+ const unsafe fn bar2 ( ) -> u32 { foo2 ( ) } //~ ERROR can only call other `const fn `
23
23
24
24
// check whether this function cannot be called even with the feature gate active
25
25
#[ unstable( feature = "foo2" , issue="0" ) ]
26
26
const fn foo2_gated ( ) -> u32 { 42 }
27
27
28
28
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
29
29
// can't call non-min_const_fn
30
- const unsafe fn bar2_gated ( ) -> u32 { foo2_gated ( ) } //~ ERROR can only call other `const`
30
+ const unsafe fn bar2_gated ( ) -> u32 { foo2_gated ( ) } //~ ERROR can only call other `const fn `
31
31
32
32
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
1
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo` is not stable as `const fn ` (see issue #57563)
2
2
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:15:32
3
3
|
4
4
LL | const unsafe fn bar() -> u32 { foo() }
5
5
| ^^^^^
6
6
|
7
7
= help: add #![feature(const_fn)] to the crate attributes to enable
8
8
9
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
9
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2` is not stable as `const fn ` (see issue #57563)
10
10
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:22:33
11
11
|
12
12
LL | const unsafe fn bar2() -> u32 { foo2() }
13
13
| ^^^^^^
14
14
|
15
15
= help: add #![feature(const_fn)] to the crate attributes to enable
16
16
17
- error[E0723]: can only call other `const` within a `const` (see issue #57563)
17
+ error[E0723]: can only call other `const fn ` within a `const fn`, but `const foo2_gated` is not stable as `const fn ` (see issue #57563)
18
18
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:30:39
19
19
|
20
20
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
You can’t perform that action at this time.
0 commit comments