Skip to content

changes lint name: ctypes -> ffi_rust_types #15277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/etc/zsh/_rust
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/should_not_exist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl LintStore {
HardwiredLints,
WhileTrue,
UnusedCasts,
CTypes,
FFIRustTypes,
HeapMemory,
UnusedAttribute,
PathStatement,
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/lint-ctypes-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/lint-ctypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/warn-foreign-int-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/warn-ctypes-inhibit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down