diff options
| author | Alexander Regueiro <alexreg@me.com> | 2018-01-10 02:57:50 +0000 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2018-01-11 20:13:06 +0000 |
| commit | e2c1a9393be807bd69bead134b79e9f4e753daec (patch) | |
| tree | 282d4ecdb3500b32e41afc4d287f39dce6bc0569 /src/test | |
| parent | 73ac5d6a80f26c692f1e084b72d69637d7de2c8c (diff) | |
| download | rust-e2c1a9393be807bd69bead134b79e9f4e753daec.tar.gz rust-e2c1a9393be807bd69bead134b79e9f4e753daec.zip | |
Don't track local_needs_drop separately in qualify_consts (fixes #47351).
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/static-drop-scope.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/static-drop-scope.rs b/src/test/compile-fail/static-drop-scope.rs index c96cadece97..e22eb7e4484 100644 --- a/src/test/compile-fail/static-drop-scope.rs +++ b/src/test/compile-fail/static-drop-scope.rs @@ -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 () {} |
