Skip to content

Commit b428f28

Browse files
Bless tests
1 parent 6a52c09 commit b428f28

9 files changed

+24
-24
lines changed

src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const extern fn unsize(x: &[u8; 3]) -> &[u8] { x }
44
const unsafe extern "C" fn closure() -> fn() { || {} }
55
//~^ ERROR function pointers in const fn are unstable
66
const unsafe extern fn use_float() { 1.0 + 1.0; }
7-
//~^ ERROR only int, `bool` and `char` operations are stable in const fn
7+
//~^ ERROR floating point arithmetic
88
const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
99
//~^ ERROR casting pointers to integers
1010

src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ LL | const unsafe extern "C" fn closure() -> fn() { || {} }
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
88
= help: add `#![feature(const_fn)]` to the crate attributes to enable
99

10-
error[E0723]: only int, `bool` and `char` operations are stable in const fn
10+
error[E0658]: floating point arithmetic is not allowed in constant functions
1111
--> $DIR/const-extern-fn-min-const-fn.rs:6:38
1212
|
1313
LL | const unsafe extern fn use_float() { 1.0 + 1.0; }
1414
| ^^^^^^^^^
1515
|
1616
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
17-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
17+
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
1818

1919
error[E0658]: casting pointers to integers in constant functions is unstable
2020
--> $DIR/const-extern-fn-min-const-fn.rs:8:48

src/test/ui/consts/const_let_eq_float.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// run-pass
22

3-
#![feature(const_fn)]
3+
#![feature(const_fn_floating_point_arithmetic)]
44

55
struct Foo<T>(T);
66
struct Bar<T> { x: T }

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
7878
const fn foo11_2<T: Send>(t: T) -> T { t }
7979
//~^ ERROR trait bounds other than `Sized` on const fn parameters are unstable
8080
const fn foo19(f: f32) -> f32 { f * 2.0 }
81-
//~^ ERROR int, `bool` and `char` operations
81+
//~^ ERROR floating point arithmetic
8282
const fn foo19_2(f: f32) -> f32 { 2.0 - f }
83-
//~^ ERROR int, `bool` and `char` operations
83+
//~^ ERROR floating point arithmetic
8484
const fn foo19_3(f: f32) -> f32 { -f }
85-
//~^ ERROR int, `bool` and `char` operations
85+
//~^ ERROR floating point arithmetic
8686
const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
87-
//~^ ERROR int, `bool` and `char` operations
87+
//~^ ERROR floating point arithmetic
8888

8989
static BAR: u32 = 42;
9090
const fn foo25() -> u32 { BAR } //~ ERROR cannot refer to statics

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -76,41 +76,41 @@ LL | const fn foo11_2<T: Send>(t: T) -> T { t }
7676
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
7777
= help: add `#![feature(const_fn)]` to the crate attributes to enable
7878

79-
error[E0723]: only int, `bool` and `char` operations are stable in const fn
79+
error[E0658]: floating point arithmetic is not allowed in constant functions
8080
--> $DIR/min_const_fn.rs:80:33
8181
|
8282
LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
8383
| ^^^^^^^
8484
|
8585
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
86-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
86+
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
8787

88-
error[E0723]: only int, `bool` and `char` operations are stable in const fn
88+
error[E0658]: floating point arithmetic is not allowed in constant functions
8989
--> $DIR/min_const_fn.rs:82:35
9090
|
9191
LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
9292
| ^^^^^^^
9393
|
9494
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
95-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
95+
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
9696

97-
error[E0723]: only int, `bool` and `char` operations are stable in const fn
97+
error[E0658]: floating point arithmetic is not allowed in constant functions
9898
--> $DIR/min_const_fn.rs:84:35
9999
|
100100
LL | const fn foo19_3(f: f32) -> f32 { -f }
101101
| ^^
102102
|
103103
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
104-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
104+
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
105105

106-
error[E0723]: only int, `bool` and `char` operations are stable in const fn
106+
error[E0658]: floating point arithmetic is not allowed in constant functions
107107
--> $DIR/min_const_fn.rs:86:43
108108
|
109109
LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
110110
| ^^^^^
111111
|
112112
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
113-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
113+
= help: add `#![feature(const_fn_floating_point_arithmetic)]` to the crate attributes to enable
114114

115115
error[E0013]: constant functions cannot refer to statics
116116
--> $DIR/min_const_fn.rs:90:27

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
we're apparently really bad at it",
44
issue = "none")]
55

6-
#![feature(const_fn, foo, foo2)]
6+
#![feature(const_fn, const_fn_floating_point_arithmetic, foo, foo2)]
77
#![feature(staged_api)]
88

99
#[stable(feature = "rust1", since = "1.0.0")]
@@ -25,9 +25,9 @@ const fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn
2525

2626
#[stable(feature = "rust1", since = "1.0.0")]
2727
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
28-
// conformity is required, even with `const_fn` feature gate
28+
// Const-stable functions cannot rely on unstable const-eval features.
2929
const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
30-
//~^ ERROR const-stable function cannot use `#[feature(const_fn)]`
30+
//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
3131

3232
// check whether this function cannot be called even with the feature gate active
3333
#[unstable(feature = "foo2", issue = "none")]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | const fn bar2() -> u32 { foo2() }
1414
|
1515
= help: Const-stable functions can only call other const-stable functions
1616

17-
error: const-stable function cannot use `#[feature(const_fn)]`
17+
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
1818
--> $DIR/min_const_fn_libstd_stability.rs:29:26
1919
|
2020
LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
we're apparently really bad at it",
44
issue = "none")]
55

6-
#![feature(const_fn, foo, foo2)]
6+
#![feature(const_fn, const_fn_floating_point_arithmetic, foo, foo2)]
77
#![feature(staged_api)]
88

99
#[stable(feature = "rust1", since = "1.0.0")]
@@ -27,7 +27,7 @@ const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR not yet stable as
2727
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
2828
// conformity is required, even with `const_fn` feature gate
2929
const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
30-
//~^ ERROR const-stable function cannot use `#[feature(const_fn)]`
30+
//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
3131

3232
// check whether this function cannot be called even with the feature gate active
3333
#[unstable(feature = "foo2", issue = "none")]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
1414
|
1515
= help: Const-stable functions can only call other const-stable functions
1616

17-
error: const-stable function cannot use `#[feature(const_fn)]`
17+
error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
1818
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33
1919
|
2020
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }

0 commit comments

Comments
 (0)