Explain missing error in test
This commit is contained in:
parent
f98235ed9d
commit
6bcb0d6152
@ -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
|
||||
|
@ -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();
|
||||
| ^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user