]> git.lizzy.rs Git - rust.git/commitdiff
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)
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]`?

1  2 
src/librustc/ich/impls_ty.rs
src/librustc/ty/structural_impls.rs
src/librustc_mir/transform/qualify_consts.rs

Simple merge
Simple merge