diff options
| author | tyler <tyler@brainiumstudios.com> | 2019-05-02 23:27:03 -0700 |
|---|---|---|
| committer | tyler <tyler@brainiumstudios.com> | 2019-05-15 07:30:33 -0700 |
| commit | b266ba7850d3996b0f19f66d7a28478acfdcdbaf (patch) | |
| tree | 28970c27e7a207423d79130bfa2c9d35bd48bc86 | |
| parent | dfe51a7249e04431526cf3b4779316aabef53cca (diff) | |
| download | rust-b266ba7850d3996b0f19f66d7a28478acfdcdbaf.tar.gz rust-b266ba7850d3996b0f19f66d7a28478acfdcdbaf.zip | |
update test to match new doc(hidden) thread_local api
| -rw-r--r-- | src/test/ui/issues/issue-43733.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-43733.stderr | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/test/ui/issues/issue-43733.rs b/src/test/ui/issues/issue-43733.rs index ba599ff7ce4..a602d7667c4 100644 --- a/src/test/ui/issues/issue-43733.rs +++ b/src/test/ui/issues/issue-43733.rs @@ -13,13 +13,13 @@ static __KEY: std::thread::__FastLocalKeyInner<Foo> = static __KEY: std::thread::__OsLocalKeyInner<Foo> = std::thread::__OsLocalKeyInner::new(); -fn __getit(init: fn() -> Foo) -> std::option::Option<&'static Foo> +fn __getit() -> std::option::Option<&'static Foo> { - __KEY.get(init) //~ ERROR call to unsafe function is unsafe + __KEY.get(Default::default) //~ ERROR call to unsafe function is unsafe } static FOO: std::thread::LocalKey<Foo> = - std::thread::LocalKey::new(__getit, Default::default); + std::thread::LocalKey::new(__getit); //~^ ERROR call to unsafe function is unsafe fn main() { diff --git a/src/test/ui/issues/issue-43733.stderr b/src/test/ui/issues/issue-43733.stderr index 0ea931d7fb6..ee6a3b065d6 100644 --- a/src/test/ui/issues/issue-43733.stderr +++ b/src/test/ui/issues/issue-43733.stderr @@ -1,16 +1,16 @@ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block --> $DIR/issue-43733.rs:18:5 | -LL | __KEY.get(init) - | ^^^^^^^^^^^^^^^ call to unsafe function +LL | __KEY.get(Default::default) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function is unsafe and requires unsafe function or block --> $DIR/issue-43733.rs:22:5 | -LL | std::thread::LocalKey::new(__getit, Default::default); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function +LL | std::thread::LocalKey::new(__getit); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior |
