]> git.lizzy.rs Git - rust.git/blob - tests/ui/toplevel_ref_arg.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / toplevel_ref_arg.rs
1 #![feature(tool_lints)]
2
3
4 #![warn(clippy::all)]
5 #![allow(unused)]
6
7 fn the_answer(ref mut x: u8) {
8   *x = 42;
9 }
10
11 fn main() {
12   let mut x = 0;
13   the_answer(x);
14   // Closures should not warn
15   let y = |ref x| { println!("{:?}", x) };
16   y(1u8);
17
18   let ref x = 1;
19
20   let ref y: (&_, u8) = (&1, 2);
21
22   let ref z = 1 + 2;
23
24   let ref mut z = 1 + 2;
25
26   let (ref x, _) = (1,2); // okay, not top level
27   println!("The answer is {}.", x);
28 }