]> git.lizzy.rs Git - rust.git/blob - tests/ui/ptr_arg.rs
f262d2a8dba197540e95d014fa0f7fbffad6cdeb
[rust.git] / tests / ui / ptr_arg.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3 #![allow(unused)]
4 #![deny(ptr_arg)]
5
6 fn do_vec(x: &Vec<i64>) {
7     //Nothing here
8 }
9
10 fn do_vec_mut(x: &mut Vec<i64>) { // no error here
11     //Nothing here
12 }
13
14 fn do_str(x: &String) {
15     //Nothing here either
16 }
17
18 fn do_str_mut(x: &mut String) { // no error here
19     //Nothing here either
20 }
21
22 fn main() {
23 }
24
25 trait Foo {
26     type Item;
27     fn do_vec(x: &Vec<i64>);
28     fn do_item(x: &Self::Item);
29 }
30
31 struct Bar;
32
33 // no error, in trait impl (#425)
34 impl Foo for Bar {
35     type Item = Vec<u8>;
36     fn do_vec(x: &Vec<i64>) {}
37     fn do_item(x: &Vec<u8>) {}  
38 }