]> git.lizzy.rs Git - rust.git/commit
Auto merge of #52011 - oli-obk:dont_you_hate_it_too_when_everything_panics_constantly...
authorbors <bors@rust-lang.org>
Wed, 22 Aug 2018 22:08:03 +0000 (22:08 +0000)
committerbors <bors@rust-lang.org>
Wed, 22 Aug 2018 22:08:03 +0000 (22:08 +0000)
commit917945d662c42053383fe3e71cb0f313d585e459
tree5a1fc5d8f5be9e7a429cb264a914150975a5ada6
parentf1b506af022fdcb054aa90da1fbcf8c0226292d0
parentbd6ae6a6d10f3ebe51d0a7a8d7ef342a65f68ff4
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]`?
src/librustc/ich/impls_ty.rs
src/librustc/ty/structural_impls.rs
src/librustc_mir/transform/qualify_consts.rs