fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB43 linesraw
1error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
2  --> $DIR/toplevel_ref_arg.rs:14:9
3   |
4LL |     let ref _x = 1;
5   |     ----^^^^^^----- help: try: `let _x = &1;`
6   |
7   = note: `-D clippy::toplevel-ref-arg` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::toplevel_ref_arg)]`
9
10error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
11  --> $DIR/toplevel_ref_arg.rs:16:9
12   |
13LL |     let ref _y: (&_, u8) = (&1, 2);
14   |     ----^^^^^^--------------------- help: try: `let _y: &(&_, u8) = &(&1, 2);`
15
16error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
17  --> $DIR/toplevel_ref_arg.rs:18:9
18   |
19LL |     let ref _z = 1 + 2;
20   |     ----^^^^^^--------- help: try: `let _z = &(1 + 2);`
21
22error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
23  --> $DIR/toplevel_ref_arg.rs:20:9
24   |
25LL |     let ref mut _z = 1 + 2;
26   |     ----^^^^^^^^^^--------- help: try: `let _z = &mut (1 + 2);`
27
28error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
29  --> $DIR/toplevel_ref_arg.rs:25:9
30   |
31LL |     let ref _x = vec![1, 2, 3];
32   |     ----^^^^^^----------------- help: try: `let _x = &vec![1, 2, 3];`
33
34error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
35  --> $DIR/toplevel_ref_arg.rs:35:17
36   |
37LL |     inline!(let ref _y = 42;);
38   |             ----^^^^^^------ help: try: `let _y = &42;`
39   |
40   = note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
41
42error: aborting due to 6 previous errors
43