Skip to content

Commit 778d72b

Browse files
committed
static_local compiles fine in unsafe
1 parent 90eb182 commit 778d72b

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

tests/unit/out/unsafe/static_local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::io::{Read, Write};
88
use std::os::fd::{AsFd, FromRawFd, IntoRawFd};
99
use std::rc::Rc;
1010
pub unsafe fn foo_0() -> i32 {
11-
static kX1: i32 = 1;;
11+
static mut kX1: i32 = 1;;
1212
static kX2: i32 = 2;;
1313
kX1 += 1;
1414
return ((kX1) + (kX2));

tests/unit/static_local.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) 2022-present INESC-ID.
22
// Distributed under the MIT license that can be found in the LICENSE file.
33

4-
// no-compile: unsafe
54
int foo() {
65
static int kX1 = 1;
76
static const int kX2 = 2;

0 commit comments

Comments
 (0)