rust/tests/compile-fail/ptr_arg.rs
Georg Brandl bcd95aec1c all: make style of lint messages consistent
* start first sentence lowercased
* use backticks to delimit code snippets
* use "this is wrong. Consider doing X." consistently
2015-08-12 10:47:09 +02:00

20 lines
357 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
//Nothing here either
}
fn main() {
let x = vec![1i64, 2, 3];
do_vec(&x);
do_str(&"hello".to_owned());
}