File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ static __KEY: std::thread::__FastLocalKeyInner<Foo> =
1313static __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
2121static 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
2525fn main ( ) {
Original file line number Diff line number Diff line change 11error[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
99error[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
You can’t perform that action at this time.
0 commit comments