From 79368db1ce0b6c14d295593a1c12ab691e74b41c Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 10 Sep 2019 18:16:47 +0100 Subject: [PATCH] Surround `PhantomData` in backticks --- src/librustc_lint/types.rs | 2 +- src/test/ui/lint/lint-ctypes.rs | 6 +++--- src/test/ui/lint/lint-ctypes.stderr | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 63fe11f3443e6..1df1ca9cc5e42 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -903,7 +903,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { self.cx.span_lint(IMPROPER_CTYPES, sp, &format!("`extern` block uses type `{}` which is not FFI-safe: \ - composed only of PhantomData", ty)); + composed only of `PhantomData`", ty)); } FfiResult::FfiUnsafe { ty: unsafe_ty, reason, help } => { let msg = format!("`extern` block uses type `{}` which is not FFI-safe: {}", diff --git a/src/test/ui/lint/lint-ctypes.rs b/src/test/ui/lint/lint-ctypes.rs index a3d9b6febdbb7..39206cd0418f1 100644 --- a/src/test/ui/lint/lint-ctypes.rs +++ b/src/test/ui/lint/lint-ctypes.rs @@ -1,7 +1,7 @@ -#![deny(improper_ctypes)] #![feature(rustc_private)] #![allow(private_in_public)] +#![deny(improper_ctypes)] extern crate libc; @@ -55,9 +55,9 @@ extern { pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)` pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)` pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields - pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData + pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of `PhantomData` pub fn zero_size_phantom_toplevel() - -> ::std::marker::PhantomData; //~ ERROR: composed only of PhantomData + -> ::std::marker::PhantomData; //~ ERROR: composed only of `PhantomData` pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box` diff --git a/src/test/ui/lint/lint-ctypes.stderr b/src/test/ui/lint/lint-ctypes.stderr index c78463beb6559..0dbfd7be41d68 100644 --- a/src/test/ui/lint/lint-ctypes.stderr +++ b/src/test/ui/lint/lint-ctypes.stderr @@ -5,7 +5,7 @@ LL | pub fn ptr_type1(size: *const Foo); | ^^^^^^^^^^ | note: lint level defined here - --> $DIR/lint-ctypes.rs:1:9 + --> $DIR/lint-ctypes.rs:4:9 | LL | #![deny(improper_ctypes)] | ^^^^^^^^^^^^^^^ @@ -108,13 +108,13 @@ note: type defined here LL | pub struct ZeroSize; | ^^^^^^^^^^^^^^^^^^^^ -error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData +error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of `PhantomData` --> $DIR/lint-ctypes.rs:58:33 | LL | pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); | ^^^^^^^^^^^^^^^^^^^^^^^ -error: `extern` block uses type `std::marker::PhantomData` which is not FFI-safe: composed only of PhantomData +error: `extern` block uses type `std::marker::PhantomData` which is not FFI-safe: composed only of `PhantomData` --> $DIR/lint-ctypes.rs:60:12 | LL | -> ::std::marker::PhantomData;