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> =
13
13
static __KEY: std:: thread:: __OsLocalKeyInner < Foo > =
14
14
std:: thread:: __OsLocalKeyInner:: new ( ) ;
15
15
16
- fn __getit ( init : fn ( ) -> Foo ) -> std:: option:: Option < & ' static Foo >
16
+ fn __getit ( ) -> std:: option:: Option < & ' static Foo >
17
17
{
18
- __KEY. get ( init ) //~ ERROR call to unsafe function is unsafe
18
+ __KEY. get ( Default :: default ) //~ ERROR call to unsafe function is unsafe
19
19
}
20
20
21
21
static FOO : std:: thread:: LocalKey < Foo > =
22
- std:: thread:: LocalKey :: new ( __getit, Default :: default ) ;
22
+ std:: thread:: LocalKey :: new ( __getit) ;
23
23
//~^ ERROR call to unsafe function is unsafe
24
24
25
25
fn main ( ) {
Original file line number Diff line number Diff line change 1
1
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
2
2
--> $DIR/issue-43733.rs:18:5
3
3
|
4
- LL | __KEY.get(init )
5
- | ^^^^^^^^^^^^^^^ call to unsafe function
4
+ LL | __KEY.get(Default::default )
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
6
6
|
7
7
= note: consult the function's documentation for information on how to avoid undefined behavior
8
8
9
9
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
10
10
--> $DIR/issue-43733.rs:22:5
11
11
|
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
14
14
|
15
15
= note: consult the function's documentation for information on how to avoid undefined behavior
16
16
You can’t perform that action at this time.
0 commit comments