diff options
| author | Albin Hedman <albin9604@gmail.com> | 2021-06-14 17:35:29 +0200 |
|---|---|---|
| committer | Albin Hedman <albin9604@gmail.com> | 2021-06-27 12:05:18 +0200 |
| commit | 7de63be56d875272bf8c8d7d500348043765d066 (patch) | |
| tree | 4df5d27d930b15fb44361633cb0504c5a0278ff5 | |
| parent | 38e95381227ab26222befb224b9d1ccf417035c6 (diff) | |
Revert "With the revert of PR 83091, `swap` is not a `const fn` anymore."
This reverts commit 34deda3cc250c2607a68cda75fe256f43b110fdc.
| -rw-r--r-- | src/test/ui/thread-local-static.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/thread-local-static.stderr | 10 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/test/ui/thread-local-static.rs b/src/test/ui/thread-local-static.rs index dc542fe2db9..c7fee9e6b4c 100644 --- a/src/test/ui/thread-local-static.rs +++ b/src/test/ui/thread-local-static.rs @@ -11,7 +11,6 @@ const fn g(x: &mut [u32; 8]) { //~| ERROR mutable references are not allowed //~| ERROR use of mutable static is unsafe //~| constant functions cannot refer to statics - //~| ERROR calls in constant functions are limited to constant functions } fn main() {} diff --git a/src/test/ui/thread-local-static.stderr b/src/test/ui/thread-local-static.stderr index a213282eb85..08bf593a5a7 100644 --- a/src/test/ui/thread-local-static.stderr +++ b/src/test/ui/thread-local-static.stderr @@ -30,12 +30,6 @@ LL | std::mem::swap(x, &mut STATIC_VAR_2) = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants - --> $DIR/thread-local-static.rs:9:5 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - error[E0133]: use of mutable static is unsafe and requires unsafe function or block --> $DIR/thread-local-static.rs:9:23 | @@ -44,7 +38,7 @@ LL | std::mem::swap(x, &mut STATIC_VAR_2) | = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors -Some errors have detailed explanations: E0013, E0015, E0133, E0658. +Some errors have detailed explanations: E0013, E0133, E0658. For more information about an error, try `rustc --explain E0013`. |
