Don't track local_needs_drop separately in qualify_consts (fixes #47351).

This commit is contained in:
Alexander Regueiro 2018-01-10 02:57:50 +00:00
parent 73ac5d6a80
commit e2c1a9393b
2 changed files with 41 additions and 23 deletions

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
struct WithDtor;
impl Drop for WithDtor {
@ -28,4 +30,12 @@ static EARLY_DROP_S: i32 = (WithDtor, 0).1;
const EARLY_DROP_C: i32 = (WithDtor, 0).1;
//~^ ERROR destructors cannot be evaluated at compile-time
const fn const_drop<T>(_: T) {}
//~^ ERROR destructors cannot be evaluated at compile-time
const fn const_drop2<T>(x: T) {
(x, ()).1
//~^ ERROR destructors cannot be evaluated at compile-time
}
fn main () {}