diff options
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-17718-const-destructors.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/static-drop-scope.rs | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/test/compile-fail/issue-17718-const-destructors.rs b/src/test/compile-fail/issue-17718-const-destructors.rs index e888f917741..6c2eafe040a 100644 --- a/src/test/compile-fail/issue-17718-const-destructors.rs +++ b/src/test/compile-fail/issue-17718-const-destructors.rs @@ -14,6 +14,6 @@ impl Drop for A { } const FOO: A = A; -//~^ ERROR: constants are not allowed to have destructors +//~^ ERROR: destructors in constants are an unstable feature fn main() {} diff --git a/src/test/compile-fail/static-drop-scope.rs b/src/test/compile-fail/static-drop-scope.rs index e5f10b65cee..f8fdf8c45cb 100644 --- a/src/test/compile-fail/static-drop-scope.rs +++ b/src/test/compile-fail/static-drop-scope.rs @@ -16,11 +16,18 @@ impl Drop for WithDtor { fn drop(&mut self) {} } -static FOO: Option<&'static WithDtor> = Some(&WithDtor); +static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor); //~^ ERROR statics are not allowed to have destructors //~| ERROR borrowed value does not live long enoug -static BAR: i32 = (WithDtor, 0).1; +const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor); +//~^ ERROR constants are not allowed to have destructors +//~| ERROR borrowed value does not live long enoug + +static EARLY_DROP_S: i32 = (WithDtor, 0).1; //~^ ERROR statics are not allowed to have destructors +const EARLY_DROP_C: i32 = (WithDtor, 0).1; +//~^ ERROR constants are not allowed to have destructors + fn main () {} |
