rust/library/core
Matthias Krüger ec84633b54
Rollup merge of #90687 - jhpratt:const_panic, r=oli-obk
Permit const panics in stable const contexts in stdlib

Without this change, it is not possible to use `panic!` and similar (including `assert!`) in stable const contexts inside of stdlib. See #89542 for a real-world case that currently fails for this reason. This does _not_ affect any user code.

For example, this snippet currently fails to compile:

```rust
#[stable(feature = "foo", since = "1.0.0")]
#[rustc_const_stable(feature = "foo", since = "1.0.0")]
const fn foo() {
    assert!(false);
    assert!(false, "foo");
}
```

With the addition of `#[rustc_const_unstable]` to `core::panicking::panic`, the error no longer occurs. This snippet has been added verbatim in this PR as a UI test.

To avoid needing to add `#![feature(core_panic)]` to libcore, the two instances of direct calls to `core::panicking::panic` have been switched to use the `panic!` macro.

I am requesting prioritization because this is holding up other stabilizations such as #89542 (which is otherwise ready to merge and succeeds with this change)
2021-11-17 15:58:00 +01:00
..
benches Auto merge of #88788 - falk-hueffner:speedup-int-log10-branchless, r=joshtriplett 2021-10-12 03:18:54 +00:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #90687 - jhpratt:const_panic, r=oli-obk 2021-11-17 15:58:00 +01:00
tests Rollup merge of #90909 - RalfJung:miri-no-portable-simd, r=workingjubilee 2021-11-16 09:14:23 +09:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00