]> git.lizzy.rs Git - rust.git/blob - tests/ui/shadow.stderr
Move all our tests back to ui tests
[rust.git] / tests / ui / shadow.stderr
1 error: `x` is shadowed by itself in `&mut x`
2   --> $DIR/shadow.rs:13:9
3    |
4 13 |     let x = &mut x;
5    |         ^^^^^^^^^^
6    |
7    = note: `-D shadow-same` implied by `-D warnings`
8 note: previous binding is here
9   --> $DIR/shadow.rs:12:13
10    |
11 12 |     let mut x = 1;
12    |             ^
13
14 error: `x` is shadowed by itself in `{ x }`
15   --> $DIR/shadow.rs:14:9
16    |
17 14 |     let x = { x };
18    |         ^^^^^^^^^
19    |
20 note: previous binding is here
21   --> $DIR/shadow.rs:13:9
22    |
23 13 |     let x = &mut x;
24    |         ^
25
26 error: `x` is shadowed by itself in `(&*x)`
27   --> $DIR/shadow.rs:15:9
28    |
29 15 |     let x = (&*x);
30    |         ^^^^^^^^^
31    |
32 note: previous binding is here
33   --> $DIR/shadow.rs:14:9
34    |
35 14 |     let x = { x };
36    |         ^
37
38 error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
39   --> $DIR/shadow.rs:16:9
40    |
41 16 |     let x = { *x + 1 };
42    |         ^
43    |
44    = note: `-D shadow-reuse` implied by `-D warnings`
45 note: initialization happens here
46   --> $DIR/shadow.rs:16:13
47    |
48 16 |     let x = { *x + 1 };
49    |             ^^^^^^^^^^
50 note: previous binding is here
51   --> $DIR/shadow.rs:15:9
52    |
53 15 |     let x = (&*x);
54    |         ^
55
56 error: `x` is shadowed by `id(x)` which reuses the original value
57   --> $DIR/shadow.rs:17:9
58    |
59 17 |     let x = id(x);
60    |         ^
61    |
62 note: initialization happens here
63   --> $DIR/shadow.rs:17:13
64    |
65 17 |     let x = id(x);
66    |             ^^^^^
67 note: previous binding is here
68   --> $DIR/shadow.rs:16:9
69    |
70 16 |     let x = { *x + 1 };
71    |         ^
72
73 error: `x` is shadowed by `(1, x)` which reuses the original value
74   --> $DIR/shadow.rs:18:9
75    |
76 18 |     let x = (1, x);
77    |         ^
78    |
79 note: initialization happens here
80   --> $DIR/shadow.rs:18:13
81    |
82 18 |     let x = (1, x);
83    |             ^^^^^^
84 note: previous binding is here
85   --> $DIR/shadow.rs:17:9
86    |
87 17 |     let x = id(x);
88    |         ^
89
90 error: `x` is shadowed by `first(x)` which reuses the original value
91   --> $DIR/shadow.rs:19:9
92    |
93 19 |     let x = first(x);
94    |         ^
95    |
96 note: initialization happens here
97   --> $DIR/shadow.rs:19:13
98    |
99 19 |     let x = first(x);
100    |             ^^^^^^^^
101 note: previous binding is here
102   --> $DIR/shadow.rs:18:9
103    |
104 18 |     let x = (1, x);
105    |         ^
106
107 error: `x` is shadowed by `y`
108   --> $DIR/shadow.rs:21:9
109    |
110 21 |     let x = y;
111    |         ^
112    |
113    = note: `-D shadow-unrelated` implied by `-D warnings`
114 note: initialization happens here
115   --> $DIR/shadow.rs:21:13
116    |
117 21 |     let x = y;
118    |             ^
119 note: previous binding is here
120   --> $DIR/shadow.rs:19:9
121    |
122 19 |     let x = first(x);
123    |         ^
124
125 error: `x` shadows a previous declaration
126   --> $DIR/shadow.rs:23:9
127    |
128 23 |     let x;
129    |         ^
130    |
131 note: previous binding is here
132   --> $DIR/shadow.rs:21:9
133    |
134 21 |     let x = y;
135    |         ^
136
137 error: aborting due to 9 previous errors
138