Explain missing error in test

This commit is contained in:
Oliver Scherer 2018-11-20 11:13:19 +01:00
parent f98235ed9d
commit 6bcb0d6152
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@ fn foo() {}
static BAR: () = unsafe {
*FOO.0.get() = 5;
// we do not error on the above access, because that is not detectable statically. Instead,
// const evaluation will error when trying to evaluate it. Due to the error below, we never even
// attempt to const evaluate `BAR`, so we don't see the error
foo();
//~^ ERROR calls in statics are limited to constant functions, tuple structs and tuple variants

View File

@ -1,5 +1,5 @@
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
--> $DIR/mod-static-with-const-fn.rs:31:5
--> $DIR/mod-static-with-const-fn.rs:34:5
|
LL | foo();
| ^^^^^