Don't track local_needs_drop separately in qualify_consts (fixes #47351).
This commit is contained in:
parent
73ac5d6a80
commit
e2c1a9393b
2 changed files with 41 additions and 23 deletions
|
|
@ -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 () {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue