Skip to content

Commit 79368db

Browse files
committed
Surround PhantomData in backticks
1 parent df7e496 commit 79368db

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
903903
self.cx.span_lint(IMPROPER_CTYPES,
904904
sp,
905905
&format!("`extern` block uses type `{}` which is not FFI-safe: \
906-
composed only of PhantomData", ty));
906+
composed only of `PhantomData`", ty));
907907
}
908908
FfiResult::FfiUnsafe { ty: unsafe_ty, reason, help } => {
909909
let msg = format!("`extern` block uses type `{}` which is not FFI-safe: {}",

src/test/ui/lint/lint-ctypes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#![deny(improper_ctypes)]
21
#![feature(rustc_private)]
32

43
#![allow(private_in_public)]
4+
#![deny(improper_ctypes)]
55

66
extern crate libc;
77

@@ -55,9 +55,9 @@ extern {
5555
pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
5656
pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
5757
pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields
58-
pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData
58+
pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of `PhantomData`
5959
pub fn zero_size_phantom_toplevel()
60-
-> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData
60+
-> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of `PhantomData`
6161
pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
6262
pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
6363
pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`

src/test/ui/lint/lint-ctypes.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | pub fn ptr_type1(size: *const Foo);
55
| ^^^^^^^^^^
66
|
77
note: lint level defined here
8-
--> $DIR/lint-ctypes.rs:1:9
8+
--> $DIR/lint-ctypes.rs:4:9
99
|
1010
LL | #![deny(improper_ctypes)]
1111
| ^^^^^^^^^^^^^^^
@@ -108,13 +108,13 @@ note: type defined here
108108
LL | pub struct ZeroSize;
109109
| ^^^^^^^^^^^^^^^^^^^^
110110

111-
error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData
111+
error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of `PhantomData`
112112
--> $DIR/lint-ctypes.rs:58:33
113113
|
114114
LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData);
115115
| ^^^^^^^^^^^^^^^^^^^^^^^
116116

117-
error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData
117+
error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of `PhantomData`
118118
--> $DIR/lint-ctypes.rs:60:12
119119
|
120120
LL | -> ::std::marker::PhantomData<bool>;

0 commit comments

Comments
 (0)