Add linting for crate_type attribute values.
This ensures that the `crate_type` attribute always contains a value, and does not contain an invalid value.
This commit is contained in:
parent
c34ef5d7e4
commit
8965e34789
6 changed files with 35 additions and 6 deletions
6
src/test/compile-fail/invalid-crate-type.rs
Normal file
6
src/test/compile-fail/invalid-crate-type.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// regression test for issue 11256
|
||||
#[crate_type="foo"]; //~ ERROR invalid `crate_type` value
|
||||
|
||||
fn main() {
|
||||
return
|
||||
}
|
||||
6
src/test/compile-fail/no_crate_type.rs
Normal file
6
src/test/compile-fail/no_crate_type.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// regresion test for issue 11256
|
||||
#[crate_type]; //~ ERROR `crate_type` requires a value
|
||||
|
||||
fn main() {
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue