summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/shadow.stderr
blob: 7fa58cf76499b8016b9c062a647ef041cc5d2444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
error: `x` is shadowed by itself in `&mut x`
  --> $DIR/shadow.rs:26:5
   |
LL |     let x = &mut x;
   |     ^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::shadow-same` implied by `-D warnings`
note: previous binding is here
  --> $DIR/shadow.rs:25:13
   |
LL |     let mut x = 1;
   |             ^

error: `x` is shadowed by itself in `{ x }`
  --> $DIR/shadow.rs:27:5
   |
LL |     let x = { x };
   |     ^^^^^^^^^^^^^^
   |
note: previous binding is here
  --> $DIR/shadow.rs:26:9
   |
LL |     let x = &mut x;
   |         ^

error: `x` is shadowed by itself in `(&*x)`
  --> $DIR/shadow.rs:28:5
   |
LL |     let x = (&*x);
   |     ^^^^^^^^^^^^^^
   |
note: previous binding is here
  --> $DIR/shadow.rs:27:9
   |
LL |     let x = { x };
   |         ^

error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
  --> $DIR/shadow.rs:29:9
   |
LL |     let x = { *x + 1 };
   |         ^
   |
   = note: `-D clippy::shadow-reuse` implied by `-D warnings`
note: initialization happens here
  --> $DIR/shadow.rs:29:13
   |
LL |     let x = { *x + 1 };
   |             ^^^^^^^^^^
note: previous binding is here
  --> $DIR/shadow.rs:28:9
   |
LL |     let x = (&*x);
   |         ^

error: `x` is shadowed by `id(x)` which reuses the original value
  --> $DIR/shadow.rs:30:9
   |
LL |     let x = id(x);
   |         ^
   |
note: initialization happens here
  --> $DIR/shadow.rs:30:13
   |
LL |     let x = id(x);
   |             ^^^^^
note: previous binding is here
  --> $DIR/shadow.rs:29:9
   |
LL |     let x = { *x + 1 };
   |         ^

error: `x` is shadowed by `(1, x)` which reuses the original value
  --> $DIR/shadow.rs:31:9
   |
LL |     let x = (1, x);
   |         ^
   |
note: initialization happens here
  --> $DIR/shadow.rs:31:13
   |
LL |     let x = (1, x);
   |             ^^^^^^
note: previous binding is here
  --> $DIR/shadow.rs:30:9
   |
LL |     let x = id(x);
   |         ^

error: `x` is shadowed by `first(x)` which reuses the original value
  --> $DIR/shadow.rs:32:9
   |
LL |     let x = first(x);
   |         ^
   |
note: initialization happens here
  --> $DIR/shadow.rs:32:13
   |
LL |     let x = first(x);
   |             ^^^^^^^^
note: previous binding is here
  --> $DIR/shadow.rs:31:9
   |
LL |     let x = (1, x);
   |         ^

error: `x` is shadowed by `y`
  --> $DIR/shadow.rs:34:9
   |
LL |     let x = y;
   |         ^
   |
   = note: `-D clippy::shadow-unrelated` implied by `-D warnings`
note: initialization happens here
  --> $DIR/shadow.rs:34:13
   |
LL |     let x = y;
   |             ^
note: previous binding is here
  --> $DIR/shadow.rs:32:9
   |
LL |     let x = first(x);
   |         ^

error: `x` shadows a previous declaration
  --> $DIR/shadow.rs:36:5
   |
LL |     let x;
   |     ^^^^^^
   |
note: previous binding is here
  --> $DIR/shadow.rs:34:9
   |
LL |     let x = y;
   |         ^

error: aborting due to 9 previous errors