From 2613563d950e57e02404532dc7a3a5bbd17128db Mon Sep 17 00:00:00 2001 From: Ryan Baker Date: Wed, 2 Jul 2014 23:38:41 -0400 Subject: [PATCH] changes lint name: ctypes -> ffi_rust_types --- src/etc/zsh/_rust | 2 +- src/libcore/failure.rs | 2 +- src/libcore/should_not_exist.rs | 2 +- src/libcore/str.rs | 2 +- src/librustc/lint/builtin.rs | 14 +++++++------- src/librustc/lint/context.rs | 2 +- src/test/compile-fail/lint-ctypes-enum.rs | 2 +- src/test/compile-fail/lint-ctypes.rs | 2 +- src/test/compile-fail/warn-foreign-int-types.rs | 2 +- src/test/run-pass/warn-ctypes-inhibit.rs | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/etc/zsh/_rust b/src/etc/zsh/_rust index 9c82111720542..3f8fbe32a9fe7 100644 --- a/src/etc/zsh/_rust +++ b/src/etc/zsh/_rust @@ -40,7 +40,7 @@ _rustc_opts_switches=( ) _rustc_opts_lint=( 'attribute-usage[detects bad use of attributes]' - 'ctypes[proper use of libc types in foreign modules]' + 'ffi-rust-types[proper use of libc types in foreign modules]' 'dead-assignment[detect assignments that will never be read]' 'dead-code[detect piece of code that will never be used]' 'default-type-param-usage[prevents explicitly setting a type parameter with a default]' diff --git a/src/libcore/failure.rs b/src/libcore/failure.rs index 4bc39db8ecf09..7de8c65fca7d3 100644 --- a/src/libcore/failure.rs +++ b/src/libcore/failure.rs @@ -55,7 +55,7 @@ fn fail_bounds_check(file: &'static str, line: uint, #[cold] pub fn begin_unwind(fmt: &fmt::Arguments, file: &'static str, line: uint) -> ! { - #[allow(ctypes)] + #[allow(ffi_rust_types)] extern { #[lang = "begin_unwind"] fn begin_unwind(fmt: &fmt::Arguments, file: &'static str, diff --git a/src/libcore/should_not_exist.rs b/src/libcore/should_not_exist.rs index ed6b73df38d4d..067ff14a4d642 100644 --- a/src/libcore/should_not_exist.rs +++ b/src/libcore/should_not_exist.rs @@ -37,7 +37,7 @@ use ptr; use raw::Vec; use slice::ImmutableVector; -#[allow(ctypes)] +#[allow(ffi_rust_types)] extern { fn rust_allocate(size: uint, align: uint) -> *u8; fn rust_deallocate(ptr: *u8, size: uint, align: uint); diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 94df7a5a6c2d9..ed0763a7d6491 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -603,7 +603,7 @@ Section: Comparing strings /// to compare &[u8] byte slices that are not necessarily valid UTF-8. #[inline] fn eq_slice_(a: &str, b: &str) -> bool { - #[allow(ctypes)] + #[allow(ffi_rust_types)] extern { fn memcmp(s1: *const i8, s2: *const i8, n: uint) -> i32; } a.len() == b.len() && unsafe { memcmp(a.as_ptr() as *const i8, diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 30296cb318617..daffd6b704a41 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -316,14 +316,14 @@ impl LintPass for TypeLimits { } } -declare_lint!(CTYPES, Warn, +declare_lint!(FFI_RUST_TYPES, Warn, "proper use of libc types in foreign modules") -pub struct CTypes; +pub struct FFIRustTypes; -impl LintPass for CTypes { +impl LintPass for FFIRustTypes { fn get_lints(&self) -> LintArray { - lint_array!(CTYPES) + lint_array!(FFI_RUST_TYPES) } fn check_item(&mut self, cx: &Context, it: &ast::Item) { @@ -332,18 +332,18 @@ impl LintPass for CTypes { ast::TyPath(_, _, id) => { match cx.tcx.def_map.borrow().get_copy(&id) { def::DefPrimTy(ast::TyInt(ast::TyI)) => { - cx.span_lint(CTYPES, ty.span, + cx.span_lint(FFI_RUST_TYPES, ty.span, "found rust type `int` in foreign module, while \ libc::c_int or libc::c_long should be used"); } def::DefPrimTy(ast::TyUint(ast::TyU)) => { - cx.span_lint(CTYPES, ty.span, + cx.span_lint(FFI_RUST_TYPES, ty.span, "found rust type `uint` in foreign module, while \ libc::c_uint or libc::c_ulong should be used"); } def::DefTy(def_id) => { if !adt::is_ffi_safe(cx.tcx, def_id) { - cx.span_lint(CTYPES, ty.span, + cx.span_lint(FFI_RUST_TYPES, ty.span, "found enum type without foreign-function-safe \ representation annotation in foreign module"); // hmm... this message could be more helpful diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 79fbd73c23d3c..de14f29f0193a 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -140,7 +140,7 @@ impl LintStore { HardwiredLints, WhileTrue, UnusedCasts, - CTypes, + FFIRustTypes, HeapMemory, UnusedAttribute, PathStatement, diff --git a/src/test/compile-fail/lint-ctypes-enum.rs b/src/test/compile-fail/lint-ctypes-enum.rs index e968bd601c572..eca81048a87b8 100644 --- a/src/test/compile-fail/lint-ctypes-enum.rs +++ b/src/test/compile-fail/lint-ctypes-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(ctypes)] +#![deny(ffi_rust_types)] #![allow(dead_code)] enum Z { } diff --git a/src/test/compile-fail/lint-ctypes.rs b/src/test/compile-fail/lint-ctypes.rs index 9e609814c8b3c..554ef7b8a0d28 100644 --- a/src/test/compile-fail/lint-ctypes.rs +++ b/src/test/compile-fail/lint-ctypes.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(ctypes)] +#![deny(ffi_rust_types)] extern crate libc; diff --git a/src/test/compile-fail/warn-foreign-int-types.rs b/src/test/compile-fail/warn-foreign-int-types.rs index cfa6623176ca3..eb5d28575014c 100644 --- a/src/test/compile-fail/warn-foreign-int-types.rs +++ b/src/test/compile-fail/warn-foreign-int-types.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![forbid(ctypes)] +#![forbid(ffi_rust_types)] #![allow(dead_code)] mod xx { diff --git a/src/test/run-pass/warn-ctypes-inhibit.rs b/src/test/run-pass/warn-ctypes-inhibit.rs index 93112e3e7ec9d..4d1c6c50dc67a 100644 --- a/src/test/run-pass/warn-ctypes-inhibit.rs +++ b/src/test/run-pass/warn-ctypes-inhibit.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags:-D ctypes +// compile-flags:-D ffi_rust_types -#![allow(ctypes)] +#![allow(ffi_rust_types)] mod libc { extern {