Skip to content

Commit e20f1d1

Browse files
author
Robin Kruppe
committed
Fix typo in improper_ctypes suggestion
closes #52345
1 parent c0955a3 commit e20f1d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
673673
return FfiUnsafe {
674674
ty: ty,
675675
reason: "this function pointer has Rust-specific calling convention",
676-
help: Some("consider using an `fn \"extern\"(...) -> ...` \
676+
help: Some("consider using an `extern fn(...) -> ...` \
677677
function pointer instead"),
678678
}
679679
}

src/test/ui/lint-ctypes.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ error: `extern` block uses type `fn()` which is not FFI-safe: this function poin
126126
LL | pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
127127
| ^^^^^^
128128
|
129-
= help: consider using an `fn "extern"(...) -> ...` function pointer instead
129+
= help: consider using an `extern fn(...) -> ...` function pointer instead
130130

131131
error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
132132
--> $DIR/lint-ctypes.rs:70:24
133133
|
134134
LL | pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
135135
| ^^^^
136136
|
137-
= help: consider using an `fn "extern"(...) -> ...` function pointer instead
137+
= help: consider using an `extern fn(...) -> ...` function pointer instead
138138

139139
error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
140140
--> $DIR/lint-ctypes.rs:71:28

0 commit comments

Comments
 (0)