Skip to content

Commit 50fb9f1

Browse files
Bless tests
1 parent a9d63ba commit 50fb9f1

13 files changed

+106
-44
lines changed

src/test/ui/consts/const-eval/const_fn_ptr.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@ help: skipping check that does not even have a feature gate
1010
|
1111
LL | X_CONST(x)
1212
| ^^^^^^^^^^
13+
help: skipping check for `const_fn_fn_ptr_basics` feature
14+
--> $DIR/const_fn_ptr.rs:19:14
15+
|
16+
LL | const fn foo(x: fn(usize) -> usize, y: usize) -> usize {
17+
| ^
18+
help: skipping check for `const_fn_fn_ptr_basics` feature
19+
--> $DIR/const_fn_ptr.rs:20:5
20+
|
21+
LL | x(y)
22+
| ^
1323
help: skipping check that does not even have a feature gate
1424
--> $DIR/const_fn_ptr.rs:20:5
1525
|
1626
LL | x(y)
1727
| ^^^^
1828

19-
warning: 1 warning emitted
29+
error: `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine
30+
31+
error: aborting due to previous error; 1 warning emitted
2032

src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ LL | assert_eq!(Z, 4);
2020

2121
warning: skipping const checks
2222
|
23+
help: skipping check for `const_fn_fn_ptr_basics` feature
24+
--> $DIR/const_fn_ptr_fail2.rs:12:14
25+
|
26+
LL | const fn bar(x: fn(usize) -> usize, y: usize) -> usize {
27+
| ^
28+
help: skipping check for `const_fn_fn_ptr_basics` feature
29+
--> $DIR/const_fn_ptr_fail2.rs:13:5
30+
|
31+
LL | x(y)
32+
| ^
2333
help: skipping check that does not even have a feature gate
2434
--> $DIR/const_fn_ptr_fail2.rs:13:5
2535
|

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0723]: function pointers in const fn are unstable
1+
error[E0658]: function pointers cannot appear in constant functions
22
--> $DIR/const-extern-fn-min-const-fn.rs:4:41
33
|
44
LL | const unsafe extern "C" fn closure() -> fn() { || {} }
55
| ^^^^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
8+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
99

1010
error[E0658]: floating point arithmetic is not allowed in constant functions
1111
--> $DIR/const-extern-fn-min-const-fn.rs:6:38
@@ -27,5 +27,4 @@ LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
2727

2828
error: aborting due to 3 previous errors
2929

30-
Some errors have detailed explanations: E0658, E0723.
31-
For more information about an error, try `rustc --explain E0658`.
30+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/consts/issue-56164.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | const fn foo() { (||{})() }
55
| ^^^^^^^^
66

77
error: function pointers are not allowed in const fn
8-
--> $DIR/issue-56164.rs:8:5
8+
--> $DIR/issue-56164.rs:7:5
99
|
1010
LL | input()
1111
| ^^^^^^^

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

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
error[E0723]: function pointers in const fn are unstable
2-
--> $DIR/allow_const_fn_ptr.rs:5:16
1+
error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]`
2+
--> $DIR/allow_const_fn_ptr.rs:6:16
33
|
44
LL | const fn error(_: fn()) {}
55
| ^
66
|
7-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
7+
= note: otherwise `#[allow_internal_unstable]` can be used to bypass stability checks
8+
help: if it is not part of the public API, make this function unstably const
9+
|
10+
LL | #[rustc_const_unstable(feature = "...", issue = "...")]
11+
|
912

1013
error: aborting due to previous error
1114

12-
For more information about this error, try `rustc --explain E0723`.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
error[E0658]: internal implementation detail
2-
--> $DIR/allow_const_fn_ptr_feature_gate.rs:7:1
1+
error: stable const functions must have either `rustc_const_stable` or `rustc_const_unstable` attribute
2+
--> $DIR/allow_const_fn_ptr_feature_gate.rs:4:1
33
|
4-
LL | #[rustc_allow_const_fn_ptr]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | const fn error(_: fn()) {}
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: stable const functions must have either `rustc_const_stable` or `rustc_const_unstable` attribute
8+
--> $DIR/allow_const_fn_ptr_feature_gate.rs:4:1
9+
|
10+
LL | const fn error(_: fn()) {}
11+
| ^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
error[E0658]: function pointers cannot appear in constant functions
14+
--> $DIR/allow_const_fn_ptr_feature_gate.rs:4:16
15+
|
16+
LL | const fn error(_: fn()) {}
17+
| ^
18+
|
19+
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
20+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
21+
22+
error[E0658]: function pointers cannot appear in constant functions
23+
--> $DIR/allow_const_fn_ptr_feature_gate.rs:11:19
24+
|
25+
LL | const fn compiles(_: fn()) {}
26+
| ^
627
|
7-
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
28+
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
29+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
830

9-
error: aborting due to previous error
31+
error: aborting due to 4 previous errors
1032

1133
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
error[E0723]: function pointers in const fn are unstable
1+
error[E0658]: function pointers cannot appear in constant functions
22
--> $DIR/cast_errors.rs:4:23
33
|
44
LL | const fn closure() -> fn() { || {} }
55
| ^^^^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
8+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
99

10-
error[E0723]: function pointers in const fn are unstable
10+
error[E0658]: function pointers cannot appear in constant functions
1111
--> $DIR/cast_errors.rs:7:5
1212
|
1313
LL | (|| {}) as fn();
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_fn_ptr_basics)]` to the crate attributes to enable
1818

19-
error[E0723]: function pointers in const fn are unstable
19+
error[E0658]: function pointers cannot appear in constant functions
2020
--> $DIR/cast_errors.rs:10:28
2121
|
2222
LL | const fn reify(f: fn()) -> unsafe fn() { f }
2323
| ^^^^^^^^^^^
2424
|
2525
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
26-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
26+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
2727

28-
error[E0723]: function pointers in const fn are unstable
28+
error[E0658]: function pointers cannot appear in constant functions
2929
--> $DIR/cast_errors.rs:12:21
3030
|
3131
LL | const fn reify2() { main as unsafe fn(); }
3232
| ^^^^^^^^^^^^^^^^^^^
3333
|
3434
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
35-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
35+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
3636

3737
error: aborting due to 4 previous errors
3838

39-
For more information about this error, try `rustc --explain E0723`.
39+
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error[E0723]: function pointers in const fn are unstable
1+
error[E0658]: function pointers cannot appear in constant functions
22
--> $DIR/cmp_fn_pointers.rs:1:14
33
|
44
LL | const fn cmp(x: fn(), y: fn()) -> bool {
55
| ^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
8+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
99

1010
error: aborting due to previous error
1111

12-
For more information about this error, try `rustc --explain E0723`.
12+
For more information about this error, try `rustc --explain E0658`.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,23 +209,23 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1
209209
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
210210
= help: add `#![feature(const_fn)]` to the crate attributes to enable
211211

212-
error[E0723]: function pointers in const fn are unstable
212+
error[E0658]: function pointers cannot appear in constant functions
213213
--> $DIR/min_const_fn.rs:130:21
214214
|
215215
LL | const fn no_fn_ptrs(_x: fn()) {}
216216
| ^^
217217
|
218218
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
219-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
219+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
220220

221-
error[E0723]: function pointers in const fn are unstable
221+
error[E0658]: function pointers cannot appear in constant functions
222222
--> $DIR/min_const_fn.rs:132:27
223223
|
224224
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
225225
| ^^^^
226226
|
227227
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
228-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
228+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
229229

230230
error: aborting due to 26 previous errors
231231

Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
error[E0723]: function pointers in const fn are unstable
1+
error[E0658]: function pointers cannot appear in constant functions
22
--> $DIR/min_const_fn_fn_ptr.rs:11:5
33
|
44
LL | x.0.field;
55
| ^^^^^^^^^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
8+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
99

10-
error[E0723]: function pointers in const fn are unstable
10+
error[E0658]: function pointers cannot appear in constant functions
1111
--> $DIR/min_const_fn_fn_ptr.rs:14:59
1212
|
1313
LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasPtr { field }) }
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_fn_ptr_basics)]` to the crate attributes to enable
1818

1919
error: aborting due to 2 previous errors
2020

21-
For more information about this error, try `rustc --explain E0723`.
21+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/consts/miri_unleashed/abi-mismatch.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "
1212

1313
warning: skipping const checks
1414
|
15-
help: skipping check for `const_fn` feature
15+
help: skipping check for `const_fn_fn_ptr_basics` feature
1616
--> $DIR/abi-mismatch.rs:9:23
1717
|
1818
LL | const fn call_rust_fn(my_fn: extern "Rust" fn()) {
1919
| ^^^^^
20-
help: skipping check for `const_fn` feature
20+
help: skipping check for `const_fn_fn_ptr_basics` feature
2121
--> $DIR/abi-mismatch.rs:10:5
2222
|
2323
LL | my_fn();

src/test/ui/issues/issue-37550.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error[E0723]: function pointers in const fn are unstable
1+
error[E0658]: function pointers cannot appear in constant functions
22
--> $DIR/issue-37550.rs:3:9
33
|
44
LL | let x = || t;
55
| ^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
8-
= help: add `#![feature(const_fn)]` to the crate attributes to enable
8+
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
99

1010
error: aborting due to previous error
1111

12-
For more information about this error, try `rustc --explain E0723`.
12+
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
warning: skipping const checks
22
|
3+
help: skipping check for `const_fn_fn_ptr_basics` feature
4+
--> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:20:9
5+
|
6+
LL | let ptr: fn() -> L = attributed;
7+
| ^^^
8+
help: skipping check for `const_fn_fn_ptr_basics` feature
9+
--> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:21:5
10+
|
11+
LL | ptr()
12+
| ^^^
13+
help: skipping check for `const_fn_fn_ptr_basics` feature
14+
--> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:20:26
15+
|
16+
LL | let ptr: fn() -> L = attributed;
17+
| ^^^^^^^^^^
318
help: skipping check that does not even have a feature gate
419
--> $DIR/caller-location-fnptr-rt-ctfe-equiv.rs:21:5
520
|
621
LL | ptr()
722
| ^^^^^
823

9-
warning: 1 warning emitted
24+
error: `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine
25+
26+
error: aborting due to previous error; 1 warning emitted
1027

0 commit comments

Comments
 (0)