mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
7aee04878f
(Did not touch strings.rs, which is fixed by @llogiq's PR)
20 lines
392 B
Rust
Executable file
20 lines
392 B
Rust
Executable file
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#[deny(ptr_arg)]
|
|
#[allow(unused)]
|
|
fn do_vec(x: &Vec<i64>) { //~ERROR writing `&Vec<_>` instead of `&[_]`
|
|
//Nothing here
|
|
}
|
|
|
|
#[deny(ptr_arg)]
|
|
#[allow(unused)]
|
|
fn do_str(x: &String) { //~ERROR writing `&String` instead of `&str`
|
|
//Nothing here either
|
|
}
|
|
|
|
fn main() {
|
|
let x = vec![1i64, 2, 3];
|
|
do_vec(&x);
|
|
do_str(&"hello".to_owned());
|
|
}
|