Skip to content

Commit 233b82c

Browse files
committed
Prefix label with panic:
1 parent 64a7ed3 commit 233b82c

File tree

60 files changed

+92
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+92
-92
lines changed

compiler/rustc_const_eval/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ const_eval_overflow_arith =
300300
const_eval_overflow_shift =
301301
overflowing shift by {$shift_amount} in `{$intrinsic}`
302302
303-
const_eval_panic = {$msg}
303+
const_eval_panic = panic: {$msg}
304304
305305
const_eval_panic_non_str = argument to `panic!()` in a const context must have type `&str`
306306

tests/ui/borrowck/issue-81899.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-81899.rs:4:24
33
|
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
5-
| ^^^^^^^^^^^^^^ explicit panic
5+
| ^^^^^^^^^^^^^^ panic: explicit panic
66
|
77
note: called from `f::<{closure@$DIR/issue-81899.rs:4:31: 4:34}>`
88
--> $DIR/issue-81899.rs:11:5

tests/ui/borrowck/issue-88434-minimal-example.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-88434-minimal-example.rs:3:22
33
|
44
LL | const _CONST: &() = &f(&|_| {});
5-
| ^^^^^^^^^^ explicit panic
5+
| ^^^^^^^^^^ panic: explicit panic
66
|
77
note: called from `f::<{closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28}>`
88
--> $DIR/issue-88434-minimal-example.rs:10:5

tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:24
33
|
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
5-
| ^^^^^^^^^^^^^^ explicit panic
5+
| ^^^^^^^^^^^^^^ panic: explicit panic
66
|
77
note: called from `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
88
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5

tests/ui/coherence/const-errs-dont-conflict-103369.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const-errs-dont-conflict-103369.rs:5:25
33
|
44
LL | impl ConstGenericTrait<{my_fn(1)}> for () {}
5-
| ^^^^^^^^ Some error occurred
5+
| ^^^^^^^^ panic: Some error occurred
66
|
77
note: called from `my_fn`
88
--> $DIR/const-errs-dont-conflict-103369.rs:10:5
@@ -15,7 +15,7 @@ error[E0080]: evaluation of constant value failed
1515
--> $DIR/const-errs-dont-conflict-103369.rs:7:25
1616
|
1717
LL | impl ConstGenericTrait<{my_fn(2)}> for () {}
18-
| ^^^^^^^^ Some error occurred
18+
| ^^^^^^^^ panic: Some error occurred
1919
|
2020
note: called from `my_fn`
2121
--> $DIR/const-errs-dont-conflict-103369.rs:10:5

tests/ui/const-ptr/forbidden_slices.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ error[E0080]: could not evaluate static initializer
103103
--> $DIR/forbidden_slices.rs:50:33
104104
|
105105
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; // errors inside libcore
106-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
106+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
107107
|
108108
note: called from `from_ptr_range::<'_, ()>`
109109
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL

tests/ui/consts/assert-type-intrinsics.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/assert-type-intrinsics.rs:11:9
33
|
44
LL | MaybeUninit::<!>::uninit().assume_init();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: aborted execution: attempted to instantiate uninhabited type `!`
66

77
error[E0080]: evaluation of constant value failed
88
--> $DIR/assert-type-intrinsics.rs:15:9
99
|
1010
LL | intrinsics::assert_mem_uninitialized_valid::<&'static i32>();
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `&i32` uninitialized, which is invalid
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: aborted execution: attempted to leave type `&i32` uninitialized, which is invalid
1212

1313
error[E0080]: evaluation of constant value failed
1414
--> $DIR/assert-type-intrinsics.rs:19:9
1515
|
1616
LL | intrinsics::assert_zero_valid::<&'static i32>();
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: aborted execution: attempted to zero-initialize type `&i32`, which is invalid
1818

1919
error: aborting due to 3 previous errors
2020

tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic-normalize-tabs-115498.rs:3:17
33
|
44
LL | struct Bug([u8; panic!{"\t"}]);
5-
| ^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^ panic:
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

tests/ui/consts/const-eval/const_panic.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,95 +2,95 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic.rs:6:15
33
|
44
LL | const Z: () = std::panic!("cheese");
5-
| ^^^^^^^^^^^^^^^^^^^^^ cheese
5+
| ^^^^^^^^^^^^^^^^^^^^^ panic: cheese
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic.rs:9:16
1111
|
1212
LL | const Z2: () = std::panic!();
13-
| ^^^^^^^^^^^^^ explicit panic
13+
| ^^^^^^^^^^^^^ panic: explicit panic
1414
|
1515
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic.rs:12:15
1919
|
2020
LL | const Y: () = std::unreachable!();
21-
| ^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
21+
| ^^^^^^^^^^^^^^^^^^^ panic: internal error: entered unreachable code
2222
|
2323
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

2525
error[E0080]: evaluation of constant value failed
2626
--> $DIR/const_panic.rs:15:15
2727
|
2828
LL | const X: () = std::unimplemented!();
29-
| ^^^^^^^^^^^^^^^^^^^^^ not implemented
29+
| ^^^^^^^^^^^^^^^^^^^^^ panic: not implemented
3030
|
3131
= note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
3232

3333
error[E0080]: evaluation of constant value failed
3434
--> $DIR/const_panic.rs:18:15
3535
|
3636
LL | const W: () = std::panic!(MSG);
37-
| ^^^^^^^^^^^^^^^^ hello
37+
| ^^^^^^^^^^^^^^^^ panic: hello
3838
|
3939
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4040

4141
error[E0080]: evaluation of constant value failed
4242
--> $DIR/const_panic.rs:21:16
4343
|
4444
LL | const W2: () = std::panic!("{}", MSG);
45-
| ^^^^^^^^^^^^^^^^^^^^^^ hello
45+
| ^^^^^^^^^^^^^^^^^^^^^^ panic: hello
4646
|
4747
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4848

4949
error[E0080]: evaluation of constant value failed
5050
--> $DIR/const_panic.rs:24:20
5151
|
5252
LL | const Z_CORE: () = core::panic!("cheese");
53-
| ^^^^^^^^^^^^^^^^^^^^^^ cheese
53+
| ^^^^^^^^^^^^^^^^^^^^^^ panic: cheese
5454
|
5555
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
5656

5757
error[E0080]: evaluation of constant value failed
5858
--> $DIR/const_panic.rs:27:21
5959
|
6060
LL | const Z2_CORE: () = core::panic!();
61-
| ^^^^^^^^^^^^^^ explicit panic
61+
| ^^^^^^^^^^^^^^ panic: explicit panic
6262
|
6363
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
6464

6565
error[E0080]: evaluation of constant value failed
6666
--> $DIR/const_panic.rs:30:20
6767
|
6868
LL | const Y_CORE: () = core::unreachable!();
69-
| ^^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
69+
| ^^^^^^^^^^^^^^^^^^^^ panic: internal error: entered unreachable code
7070
|
7171
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
7272

7373
error[E0080]: evaluation of constant value failed
7474
--> $DIR/const_panic.rs:33:20
7575
|
7676
LL | const X_CORE: () = core::unimplemented!();
77-
| ^^^^^^^^^^^^^^^^^^^^^^ not implemented
77+
| ^^^^^^^^^^^^^^^^^^^^^^ panic: not implemented
7878
|
7979
= note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
8080

8181
error[E0080]: evaluation of constant value failed
8282
--> $DIR/const_panic.rs:36:20
8383
|
8484
LL | const W_CORE: () = core::panic!(MSG);
85-
| ^^^^^^^^^^^^^^^^^ hello
85+
| ^^^^^^^^^^^^^^^^^ panic: hello
8686
|
8787
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
8888

8989
error[E0080]: evaluation of constant value failed
9090
--> $DIR/const_panic.rs:39:21
9191
|
9292
LL | const W2_CORE: () = core::panic!("{}", MSG);
93-
| ^^^^^^^^^^^^^^^^^^^^^^^ hello
93+
| ^^^^^^^^^^^^^^^^^^^^^^^ panic: hello
9494
|
9595
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
9696

tests/ui/consts/const-eval/const_panic_2021.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,79 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_2021.rs:6:15
33
|
44
LL | const A: () = std::panic!("blåhaj");
5-
| ^^^^^^^^^^^^^^^^^^^^^ blåhaj
5+
| ^^^^^^^^^^^^^^^^^^^^^ panic: blåhaj
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic_2021.rs:9:15
1111
|
1212
LL | const B: () = std::panic!();
13-
| ^^^^^^^^^^^^^ explicit panic
13+
| ^^^^^^^^^^^^^ panic: explicit panic
1414
|
1515
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic_2021.rs:12:15
1919
|
2020
LL | const C: () = std::unreachable!();
21-
| ^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
21+
| ^^^^^^^^^^^^^^^^^^^ panic: internal error: entered unreachable code
2222
|
2323
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

2525
error[E0080]: evaluation of constant value failed
2626
--> $DIR/const_panic_2021.rs:15:15
2727
|
2828
LL | const D: () = std::unimplemented!();
29-
| ^^^^^^^^^^^^^^^^^^^^^ not implemented
29+
| ^^^^^^^^^^^^^^^^^^^^^ panic: not implemented
3030
|
3131
= note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
3232

3333
error[E0080]: evaluation of constant value failed
3434
--> $DIR/const_panic_2021.rs:18:15
3535
|
3636
LL | const E: () = std::panic!("{}", MSG);
37-
| ^^^^^^^^^^^^^^^^^^^^^^ hello
37+
| ^^^^^^^^^^^^^^^^^^^^^^ panic: hello
3838
|
3939
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4040

4141
error[E0080]: evaluation of constant value failed
4242
--> $DIR/const_panic_2021.rs:21:20
4343
|
4444
LL | const A_CORE: () = core::panic!("shark");
45-
| ^^^^^^^^^^^^^^^^^^^^^ shark
45+
| ^^^^^^^^^^^^^^^^^^^^^ panic: shark
4646
|
4747
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4848

4949
error[E0080]: evaluation of constant value failed
5050
--> $DIR/const_panic_2021.rs:24:20
5151
|
5252
LL | const B_CORE: () = core::panic!();
53-
| ^^^^^^^^^^^^^^ explicit panic
53+
| ^^^^^^^^^^^^^^ panic: explicit panic
5454
|
5555
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
5656

5757
error[E0080]: evaluation of constant value failed
5858
--> $DIR/const_panic_2021.rs:27:20
5959
|
6060
LL | const C_CORE: () = core::unreachable!();
61-
| ^^^^^^^^^^^^^^^^^^^^ internal error: entered unreachable code
61+
| ^^^^^^^^^^^^^^^^^^^^ panic: internal error: entered unreachable code
6262
|
6363
= note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
6464

6565
error[E0080]: evaluation of constant value failed
6666
--> $DIR/const_panic_2021.rs:30:20
6767
|
6868
LL | const D_CORE: () = core::unimplemented!();
69-
| ^^^^^^^^^^^^^^^^^^^^^^ not implemented
69+
| ^^^^^^^^^^^^^^^^^^^^^^ panic: not implemented
7070
|
7171
= note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
7272

7373
error[E0080]: evaluation of constant value failed
7474
--> $DIR/const_panic_2021.rs:33:20
7575
|
7676
LL | const E_CORE: () = core::panic!("{}", MSG);
77-
| ^^^^^^^^^^^^^^^^^^^^^^^ hello
77+
| ^^^^^^^^^^^^^^^^^^^^^^^ panic: hello
7878
|
7979
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
8080

tests/ui/consts/const-eval/const_panic_libcore_bin.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_libcore_bin.rs:8:15
33
|
44
LL | const Z: () = panic!("cheese");
5-
| ^^^^^^^^^^^^^^^^ cheese
5+
| ^^^^^^^^^^^^^^^^ panic: cheese
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of constant value failed
1010
--> $DIR/const_panic_libcore_bin.rs:11:15
1111
|
1212
LL | const Y: () = unreachable!();
13-
| ^^^^^^^^^^^^^^ internal error: entered unreachable code
13+
| ^^^^^^^^^^^^^^ panic: internal error: entered unreachable code
1414
|
1515
= note: this error originates in the macro `$crate::panic::unreachable_2015` which comes from the expansion of the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant value failed
1818
--> $DIR/const_panic_libcore_bin.rs:14:15
1919
|
2020
LL | const X: () = unimplemented!();
21-
| ^^^^^^^^^^^^^^^^ not implemented
21+
| ^^^^^^^^^^^^^^^^ panic: not implemented
2222
|
2323
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

tests/ui/consts/const-eval/const_panic_track_caller.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const_panic_track_caller.rs:18:16
33
|
44
LL | const X: u32 = c();
5-
| ^^^ hey
5+
| ^^^ panic: hey
66
|
77
note: called from `c`
88
--> $DIR/const_panic_track_caller.rs:15:5

tests/ui/consts/const-eval/panic-assoc-never-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/panic-assoc-never-type.rs:9:21
33
|
44
LL | const VOID: ! = panic!();
5-
| ^^^^^^^^ explicit panic
5+
| ^^^^^^^^ panic: explicit panic
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

tests/ui/consts/const-eval/panic-never-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/panic-never-type.rs:4:17
33
|
44
LL | const VOID: ! = panic!();
5-
| ^^^^^^^^ explicit panic
5+
| ^^^^^^^^ panic: explicit panic
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

tests/ui/consts/const-eval/parse_ints.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/parse_ints.rs:5:24
33
|
44
LL | const _TOO_LOW: () = { u64::from_str_radix("12345ABCD", 1); };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ from_ascii_radix: radix must lie in the range `[2, 36]`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: from_ascii_radix: radix must lie in the range `[2, 36]`
66
|
77
note: called from `core::num::<impl u64>::from_str_radix`
88
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
@@ -14,7 +14,7 @@ error[E0080]: evaluation of constant value failed
1414
--> $DIR/parse_ints.rs:6:25
1515
|
1616
LL | const _TOO_HIGH: () = { u64::from_str_radix("12345ABCD", 37); };
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ from_ascii_radix: radix must lie in the range `[2, 36]`
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: from_ascii_radix: radix must lie in the range `[2, 36]`
1818
|
1919
note: called from `core::num::<impl u64>::from_str_radix`
2020
--> $SRC_DIR/core/src/num/mod.rs:LL:COL

tests/ui/consts/const-eval/unwind-abort.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/unwind-abort.rs:5:15
33
|
44
LL | const _: () = foo();
5-
| ^^^^^ explicit panic
5+
| ^^^^^ panic: explicit panic
66
|
77
note: called from `foo`
88
--> $DIR/unwind-abort.rs:2:5

tests/ui/consts/const-ptr-is-null.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const-ptr-is-null.rs:22:14
33
|
44
LL | assert!(!ptr.wrapping_sub(512).is_null());
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null-ness of this pointer cannot be determined in const context
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: null-ness of this pointer cannot be determined in const context
66
|
77
note: called from `std::ptr::const_ptr::<impl *const i32>::is_null`
88
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL

tests/ui/consts/const-unwrap.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed
22
--> $DIR/const-unwrap.rs:6:18
33
|
44
LL | const BAR: i32 = Option::<i32>::None.unwrap();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called `Option::unwrap()` on a `None` value
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: called `Option::unwrap()` on a `None` value
66

77
error[E0080]: evaluation of constant value failed
88
--> $DIR/const-unwrap.rs:10:18
99
|
1010
LL | const BAZ: i32 = Option::<i32>::None.expect("absolutely not!");
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ absolutely not!
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ panic: absolutely not!
1212

1313
error: aborting due to 2 previous errors
1414

0 commit comments

Comments
 (0)