mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
21 lines
342 B
Rust
21 lines
342 B
Rust
|
#![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());
|
||
|
}
|