Skip to content

Commit 51b7639

Browse files
Update tests for extern block linting
1 parent aa13795 commit 51b7639

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

core/src/sync/atomic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ impl AtomicBool {
809809
/// ```ignore (extern-declaration)
810810
/// # fn main() {
811811
/// use std::sync::atomic::AtomicBool;
812-
/// extern {
812+
/// extern "C" {
813813
/// fn my_atomic_op(arg: *mut bool);
814814
/// }
815815
///
@@ -2068,7 +2068,7 @@ macro_rules! atomic_int {
20682068
/// # fn main() {
20692069
#[doc = concat!($extra_feature, "use std::sync::atomic::", stringify!($atomic_type), ";")]
20702070
///
2071-
/// extern {
2071+
/// extern "C" {
20722072
#[doc = concat!(" fn my_atomic_op(arg: *mut ", stringify!($int_type), ");")]
20732073
/// }
20742074
///

std/src/ffi/c_str.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ use crate::sys;
8686
/// use std::ffi::CString;
8787
/// use std::os::raw::c_char;
8888
///
89-
/// extern {
89+
/// extern "C" {
9090
/// fn my_printer(s: *const c_char);
9191
/// }
9292
///
@@ -144,7 +144,7 @@ pub struct CString {
144144
/// use std::ffi::CStr;
145145
/// use std::os::raw::c_char;
146146
///
147-
/// extern { fn my_string() -> *const c_char; }
147+
/// extern "C" { fn my_string() -> *const c_char; }
148148
///
149149
/// unsafe {
150150
/// let slice = CStr::from_ptr(my_string());
@@ -159,7 +159,7 @@ pub struct CString {
159159
/// use std::os::raw::c_char;
160160
///
161161
/// fn work(data: &CStr) {
162-
/// extern { fn work_with(data: *const c_char); }
162+
/// extern "C" { fn work_with(data: *const c_char); }
163163
///
164164
/// unsafe { work_with(data.as_ptr()) }
165165
/// }
@@ -174,7 +174,7 @@ pub struct CString {
174174
/// use std::ffi::CStr;
175175
/// use std::os::raw::c_char;
176176
///
177-
/// extern { fn my_string() -> *const c_char; }
177+
/// extern "C" { fn my_string() -> *const c_char; }
178178
///
179179
/// fn my_string_safe() -> String {
180180
/// unsafe {
@@ -359,7 +359,7 @@ impl CString {
359359
/// use std::ffi::CString;
360360
/// use std::os::raw::c_char;
361361
///
362-
/// extern { fn puts(s: *const c_char); }
362+
/// extern "C" { fn puts(s: *const c_char); }
363363
///
364364
/// let to_print = CString::new("Hello!").expect("CString::new failed");
365365
/// unsafe {
@@ -465,7 +465,7 @@ impl CString {
465465
/// use std::ffi::CString;
466466
/// use std::os::raw::c_char;
467467
///
468-
/// extern {
468+
/// extern "C" {
469469
/// fn some_extern_function(s: *mut c_char);
470470
/// }
471471
///
@@ -1147,7 +1147,7 @@ impl CStr {
11471147
/// use std::ffi::CStr;
11481148
/// use std::os::raw::c_char;
11491149
///
1150-
/// extern {
1150+
/// extern "C" {
11511151
/// fn my_string() -> *const c_char;
11521152
/// }
11531153
///

0 commit comments

Comments
 (0)