Support general warnings and errors in lint pass via flags and attrs. Close #1543.
This commit is contained in:
parent
7b3cb05311
commit
8a7fd4a04f
11 changed files with 273 additions and 130 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// error-pattern:unused import
|
||||
// compile-flags:--warn-unused-imports
|
||||
// compile-flags:-W unused-imports
|
||||
import cal = bar::c::cc;
|
||||
|
||||
mod foo {
|
||||
|
|
|
|||
10
src/test/compile-fail/warn-ctypes-err-attr.rs
Normal file
10
src/test/compile-fail/warn-ctypes-err-attr.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// error-pattern:found rust type
|
||||
#[warn(err_ctypes)];
|
||||
|
||||
#[nolink]
|
||||
native mod libc {
|
||||
fn malloc(size: int) -> *u8;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
9
src/test/compile-fail/warn-ctypes.rs
Normal file
9
src/test/compile-fail/warn-ctypes.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// compile-flags:-W err-ctypes
|
||||
// error-pattern:found rust type
|
||||
#[nolink]
|
||||
native mod libc {
|
||||
fn malloc(size: int) -> *u8;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue