@@ -117,117 +117,117 @@ type lint_spec = @{lint: lint,
117
117
desc : & static/str ,
118
118
default : level } ;
119
119
120
- pub type lint_dict = HashMap < ~str , lint_spec > ;
120
+ pub type lint_dict = HashMap < @ ~str , lint_spec > ;
121
121
122
122
/*
123
123
Pass names should not contain a '-', as the compiler normalizes
124
124
'-' to '_' in command-line flags
125
125
*/
126
126
pub fn get_lint_dict ( ) -> lint_dict {
127
127
let v = ~[
128
- ( ~"ctypes",
128
+ ( @ ~"ctypes",
129
129
@{ lint: ctypes,
130
130
desc: "proper use of core::libc types in foreign modules" ,
131
131
default : warn} ) ,
132
132
133
- ( ~"unused_imports",
133
+ ( @ ~"unused_imports",
134
134
@{ lint: unused_imports,
135
135
desc: "imports that are never used" ,
136
136
default : allow} ) ,
137
137
138
- ( ~"while_true",
138
+ ( @ ~"while_true",
139
139
@{ lint: while_true,
140
140
desc: "suggest using loop { } instead of while(true) { }" ,
141
141
default : warn} ) ,
142
142
143
- ( ~"path_statement",
143
+ ( @ ~"path_statement",
144
144
@{ lint: path_statement,
145
145
desc: "path statements with no effect" ,
146
146
default : warn} ) ,
147
147
148
- ( ~"unrecognized_lint",
148
+ ( @ ~"unrecognized_lint",
149
149
@{ lint: unrecognized_lint,
150
150
desc: "unrecognized lint attribute" ,
151
151
default : warn} ) ,
152
152
153
- ( ~"non_implicitly_copyable_typarams",
153
+ ( @ ~"non_implicitly_copyable_typarams",
154
154
@{ lint: non_implicitly_copyable_typarams,
155
155
desc: "passing non implicitly copyable types as copy type params" ,
156
156
default : warn} ) ,
157
157
158
- ( ~"vecs_implicitly_copyable",
158
+ ( @ ~"vecs_implicitly_copyable",
159
159
@{ lint: vecs_implicitly_copyable,
160
160
desc: "make vecs and strs not implicitly copyable \
161
161
(only checked at top level)",
162
162
default : warn} ) ,
163
163
164
- ( ~"implicit_copies",
164
+ ( @ ~"implicit_copies",
165
165
@{ lint: implicit_copies,
166
166
desc: "implicit copies of non implicitly copyable data" ,
167
167
default : warn} ) ,
168
168
169
- ( ~"deprecated_mode",
169
+ ( @ ~"deprecated_mode",
170
170
@{ lint: deprecated_mode,
171
171
desc: "warn about deprecated uses of modes" ,
172
172
default : warn} ) ,
173
173
174
- ( ~"deprecated_pattern",
174
+ ( @ ~"deprecated_pattern",
175
175
@{ lint: deprecated_pattern,
176
176
desc: "warn about deprecated uses of pattern bindings" ,
177
177
default : allow} ) ,
178
178
179
- ( ~"non_camel_case_types",
179
+ ( @ ~"non_camel_case_types",
180
180
@{ lint: non_camel_case_types,
181
181
desc: "types, variants and traits should have camel case names" ,
182
182
default : allow} ) ,
183
183
184
- ( ~"managed_heap_memory",
184
+ ( @ ~"managed_heap_memory",
185
185
@{ lint: managed_heap_memory,
186
186
desc: "use of managed (@ type) heap memory" ,
187
187
default : allow} ) ,
188
188
189
- ( ~"owned_heap_memory",
189
+ ( @ ~"owned_heap_memory",
190
190
@{ lint: owned_heap_memory,
191
191
desc: "use of owned (~ type) heap memory" ,
192
192
default : allow} ) ,
193
193
194
- ( ~"heap_memory",
194
+ ( @ ~"heap_memory",
195
195
@{ lint: heap_memory,
196
196
desc: "use of any (~ type or @ type) heap memory" ,
197
197
default : allow} ) ,
198
198
199
- ( ~"structural_records",
199
+ ( @ ~"structural_records",
200
200
@{ lint: structural_records,
201
201
desc: "use of any structural records" ,
202
202
default : deny} ) ,
203
203
204
- ( ~"legacy modes",
204
+ ( @ ~"legacy modes",
205
205
@{ lint: legacy_modes,
206
206
desc: "allow legacy modes" ,
207
207
default : forbid} ) ,
208
208
209
- ( ~"type_limits",
209
+ ( @ ~"type_limits",
210
210
@{ lint: type_limits,
211
211
desc: "comparisons made useless by limits of the types involved" ,
212
212
default : warn} ) ,
213
213
214
- ( ~"default_methods",
214
+ ( @ ~"default_methods",
215
215
@{ lint: default_methods,
216
216
desc: "allow default methods" ,
217
217
default : deny} ) ,
218
218
219
- ( ~"deprecated_self",
219
+ ( @ ~"deprecated_self",
220
220
@{ lint: deprecated_self,
221
221
desc: "warn about deprecated uses of `self`" ,
222
222
default : warn} ) ,
223
223
224
224
/* FIXME(#3266)--make liveness warnings lintable
225
- (~"unused_variable",
225
+ (@ ~"unused_variable",
226
226
@{lint: unused_variable,
227
227
desc: "detect variables which are not used in any way",
228
228
default: warn}),
229
229
230
- (~"dead_assignment",
230
+ (@ ~"dead_assignment",
231
231
@{lint: dead_assignment,
232
232
desc: "detect assignments that will never be read",
233
233
default: warn}),
@@ -344,9 +344,14 @@ impl ctxt {
344
344
}
345
345
}
346
346
347
- for triples. each |pair| {
348
- let ( meta, level, lintname) = /*bad*/ copy * pair;
349
- match self . dict . find ( & * lintname) {
347
+ for triples. each |triple| {
348
+ // FIXME(#3874): it would be nicer to write this...
349
+ // let (meta, level, lintname) = /*bad*/copy *pair;
350
+ let ( meta, level, lintname) = match * triple {
351
+ ( ref meta, level, lintname) => ( meta, level, lintname)
352
+ } ;
353
+
354
+ match self . dict . find ( & lintname) {
350
355
None => {
351
356
self . span_lint (
352
357
new_ctxt. get_level ( unrecognized_lint) ,
0 commit comments