diff options
| author | bors <bors@rust-lang.org> | 2018-08-22 22:08:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-22 22:08:03 +0000 |
| commit | 917945d662c42053383fe3e71cb0f313d585e459 (patch) | |
| tree | 5a1fc5d8f5be9e7a429cb264a914150975a5ada6 /src/libsyntax | |
| parent | f1b506af022fdcb054aa90da1fbcf8c0226292d0 (diff) | |
| parent | bd6ae6a6d10f3ebe51d0a7a8d7ef342a65f68ff4 (diff) | |
| download | rust-917945d662c42053383fe3e71cb0f313d585e459.tar.gz rust-917945d662c42053383fe3e71cb0f313d585e459.zip | |
Auto merge of #52011 - oli-obk:dont_you_hate_it_too_when_everything_panics_constantly, r=eddyb
Allow panicking with string literal messages inside constants
r? @eddyb
cc https://github.com/rust-lang/rust/issues/51999
we can't implement things like `panic!("foo: {}", x)` right now because we can't call trait methods (most notably `Display::fmt`) inside constants. Also most of these impls probably have loops and conditions, so it's messy anyway.
But hey `panic!("foo")` works at least.
cc @japaric got any test ideas for `#![no_std]`?
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 71ad118ed8e..6c33c4c245b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -224,6 +224,9 @@ declare_features! ( // Allows comparing raw pointers during const eval (active, const_compare_raw_pointers, "1.27.0", Some(53020), None), + // Allows panicking during const eval (produces compile-time errors) + (active, const_panic, "1.30.0", Some(51999), None), + // Allows using #[prelude_import] on glob `use` items. // // rustc internal |
