]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/ptr_arg.rs
7ba291b1439098d2ee7796f64e5bdb87127d3e9d
[rust.git] / tests / compile-fail / ptr_arg.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #[deny(ptr_arg)]
5 #[allow(unused)]
6 fn do_vec(x: &Vec<i64>) { //~ERROR: Writing '&Vec<_>' instead of '&[_]'
7     //Nothing here
8 }
9
10 #[deny(ptr_arg)]
11 #[allow(unused)]
12 fn do_str(x: &String) { //~ERROR
13     //Nothing here either
14 }
15
16 fn main() {
17     let x = vec![1i64, 2, 3];
18     do_vec(&x);
19     do_str(&"hello".to_owned());
20 }