Skip to content

Commit ae2ed21

Browse files
committed
Improve wording
1 parent e008e4f commit ae2ed21

7 files changed

+18
-18
lines changed

src/librustc_mir/transform/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fn check_terminator(
326326
abi::Abi::Rust if tcx.is_min_const_fn(def_id) => {},
327327
abi::Abi::Rust => return Err((
328328
span,
329-
"can only call other `min_const_fn` within a `min_const_fn`".into(),
329+
"can only call other `const` within a `const`".into(),
330330
)),
331331
abi => return Err((
332332
span,

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 `min_const_fn`
15+
const fn bar() -> u32 { foo() } //~ ERROR can only call other `const`
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 `min_const_fn`
22+
const fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const`
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 `min_const_fn`
34+
const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const`
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 `min_const_fn` within a `min_const_fn` (see issue #57563)
1+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
9+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
25+
error[E0723]: can only call other `const` within a `const` (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

+2-2
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 `min_const_fn`
15+
const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `const`
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 `min_const_fn`
22+
const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `const`
2323

2424
#[stable(feature = "rust1", since = "1.0.0")]
2525
// conformity is required, even with `const_fn` feature gate

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 `min_const_fn` within a `min_const_fn` (see issue #57563)
1+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
9+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
25+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn`
15+
const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `const`
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 `min_const_fn`
22+
const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const`
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 `min_const_fn`
30+
const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `const`
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 `min_const_fn` within a `min_const_fn` (see issue #57563)
1+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
9+
error[E0723]: can only call other `const` within a `const` (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 `min_const_fn` within a `min_const_fn` (see issue #57563)
17+
error[E0723]: can only call other `const` within a `const` (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)