Skip to content

Commit b266ba7

Browse files
committed
update test to match new doc(hidden) thread_local api
1 parent dfe51a7 commit b266ba7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/test/ui/issues/issue-43733.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ static __KEY: std::thread::__FastLocalKeyInner<Foo> =
1313
static __KEY: std::thread::__OsLocalKeyInner<Foo> =
1414
std::thread::__OsLocalKeyInner::new();
1515

16-
fn __getit(init: fn() -> Foo) -> std::option::Option<&'static Foo>
16+
fn __getit() -> std::option::Option<&'static Foo>
1717
{
18-
__KEY.get(init) //~ ERROR call to unsafe function is unsafe
18+
__KEY.get(Default::default) //~ ERROR call to unsafe function is unsafe
1919
}
2020

2121
static FOO: std::thread::LocalKey<Foo> =
22-
std::thread::LocalKey::new(__getit, Default::default);
22+
std::thread::LocalKey::new(__getit);
2323
//~^ ERROR call to unsafe function is unsafe
2424

2525
fn main() {

src/test/ui/issues/issue-43733.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
22
--> $DIR/issue-43733.rs:18:5
33
|
4-
LL | __KEY.get(init)
5-
| ^^^^^^^^^^^^^^^ call to unsafe function
4+
LL | __KEY.get(Default::default)
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
66
|
77
= note: consult the function's documentation for information on how to avoid undefined behavior
88

99
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
1010
--> $DIR/issue-43733.rs:22:5
1111
|
12-
LL | std::thread::LocalKey::new(__getit, Default::default);
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
12+
LL | std::thread::LocalKey::new(__getit);
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
1414
|
1515
= note: consult the function's documentation for information on how to avoid undefined behavior
1616

0 commit comments

Comments
 (0)