Skip to content

Commit 4075415

Browse files
committed
Fix tests
1 parent dce86f9 commit 4075415

6 files changed

+19
-18
lines changed

src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const fn foo() -> u32 { 42 }
1212

1313
#[stable(feature = "rust1", since = "1.0.0")]
1414
// 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`
1616

1717
#[unstable(feature = "rust1", issue="0")]
1818
const fn foo2() -> u32 { 42 }
1919

2020
#[stable(feature = "rust1", since = "1.0.0")]
2121
// 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`
2323

2424
#[stable(feature = "rust1", since = "1.0.0")]
2525
// conformity is required, even with `const_fn` feature gate
@@ -31,6 +31,6 @@ const fn foo2_gated() -> u32 { 42 }
3131

3232
#[stable(feature = "rust1", since = "1.0.0")]
3333
// 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`
3535

3636
fn main() {}

src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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)
22
--> $DIR/min_const_fn_libstd_stability.rs:15:25
33
|
44
LL | const fn bar() -> u32 { foo() }
55
| ^^^^^
66
|
77
= help: add #![feature(const_fn)] to the crate attributes to enable
88

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)
1010
--> $DIR/min_const_fn_libstd_stability.rs:22:26
1111
|
1212
LL | const fn bar2() -> u32 { foo2() }
@@ -22,7 +22,7 @@ LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
2222
|
2323
= help: add #![feature(const_fn)] to the crate attributes to enable
2424

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)
2626
--> $DIR/min_const_fn_libstd_stability.rs:34:32
2727
|
2828
LL | const fn bar2_gated() -> u32 { foo2_gated() }

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const unsafe fn foo() -> u32 { 42 }
1212

1313
#[stable(feature = "rust1", since = "1.0.0")]
1414
// 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`
1616

1717
#[unstable(feature = "rust1", issue="0")]
1818
const unsafe fn foo2() -> u32 { 42 }
1919

2020
#[stable(feature = "rust1", since = "1.0.0")]
2121
// 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`
2323

2424
#[stable(feature = "rust1", since = "1.0.0")]
2525
// conformity is required, even with `const_fn` feature gate
@@ -31,6 +31,7 @@ const unsafe fn foo2_gated() -> u32 { 42 }
3131

3232
#[stable(feature = "rust1", since = "1.0.0")]
3333
// 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`
3536

3637
fn main() {}

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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)
22
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:15:41
33
|
44
LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
55
| ^^^^^
66
|
77
= help: add #![feature(const_fn)] to the crate attributes to enable
88

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)
1010
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:22:42
1111
|
1212
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
@@ -22,7 +22,7 @@ LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
2222
|
2323
= help: add #![feature(const_fn)] to the crate attributes to enable
2424

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)
2626
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:34:48
2727
|
2828
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ const fn foo() -> u32 { 42 }
1212

1313
#[stable(feature = "rust1", since = "1.0.0")]
1414
// 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`
1616

1717
#[unstable(feature = "rust1", issue="0")]
1818
const fn foo2() -> u32 { 42 }
1919

2020
#[stable(feature = "rust1", since = "1.0.0")]
2121
// 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`
2323

2424
// check whether this function cannot be called even with the feature gate active
2525
#[unstable(feature = "foo2", issue="0")]
2626
const fn foo2_gated() -> u32 { 42 }
2727

2828
#[stable(feature = "rust1", since = "1.0.0")]
2929
// 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`
3131

3232
fn main() {}

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
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)
22
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:15:32
33
|
44
LL | const unsafe fn bar() -> u32 { foo() }
55
| ^^^^^
66
|
77
= help: add #![feature(const_fn)] to the crate attributes to enable
88

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)
1010
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:22:33
1111
|
1212
LL | const unsafe fn bar2() -> u32 { foo2() }
1313
| ^^^^^^
1414
|
1515
= help: add #![feature(const_fn)] to the crate attributes to enable
1616

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)
1818
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:30:39
1919
|
2020
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }

0 commit comments

Comments
 (0)