]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/ref_binding_to_reference.stderr
Auto merge of #97191 - wesleywiser:main_thread_name, r=ChrisDenton
[rust.git] / src / tools / clippy / tests / ui / ref_binding_to_reference.stderr
1 error: this pattern creates a reference to a reference
2   --> $DIR/ref_binding_to_reference.rs:30:14
3    |
4 LL |         Some(ref x) => x,
5    |              ^^^^^
6    |
7    = note: `-D clippy::ref-binding-to-reference` implied by `-D warnings`
8 help: try this
9    |
10 LL |         Some(x) => &x,
11    |              ~     ~~
12
13 error: this pattern creates a reference to a reference
14   --> $DIR/ref_binding_to_reference.rs:36:14
15    |
16 LL |         Some(ref x) => {
17    |              ^^^^^
18    |
19 help: try this
20    |
21 LL ~         Some(x) => {
22 LL |             f1(x);
23 LL ~             f1(x);
24 LL ~             &x
25    |
26
27 error: this pattern creates a reference to a reference
28   --> $DIR/ref_binding_to_reference.rs:46:14
29    |
30 LL |         Some(ref x) => m2!(x),
31    |              ^^^^^
32    |
33 help: try this
34    |
35 LL |         Some(x) => m2!(&x),
36    |              ~         ~~
37
38 error: this pattern creates a reference to a reference
39   --> $DIR/ref_binding_to_reference.rs:51:15
40    |
41 LL |     let _ = |&ref x: &&String| {
42    |               ^^^^^
43    |
44 help: try this
45    |
46 LL ~     let _ = |&x: &&String| {
47 LL ~         let _: &&String = &x;
48    |
49
50 error: this pattern creates a reference to a reference
51   --> $DIR/ref_binding_to_reference.rs:57:12
52    |
53 LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
54    |            ^^^^^
55    |
56 help: try this
57    |
58 LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
59 LL ~     let _: &&String = &x;
60 LL ~     x
61    |
62
63 error: this pattern creates a reference to a reference
64   --> $DIR/ref_binding_to_reference.rs:64:11
65    |
66 LL |     fn f(&ref x: &&String) {
67    |           ^^^^^
68    |
69 help: try this
70    |
71 LL ~     fn f(&x: &&String) {
72 LL ~         let _: &&String = &x;
73    |
74
75 error: this pattern creates a reference to a reference
76   --> $DIR/ref_binding_to_reference.rs:72:11
77    |
78 LL |     fn f(&ref x: &&String) {
79    |           ^^^^^
80    |
81 help: try this
82    |
83 LL ~     fn f(&x: &&String) {
84 LL ~         let _: &&String = &x;
85    |
86
87 error: aborting due to 7 previous errors
88