Skip to content

Commit 6282e5d

Browse files
luqmanacatamorphism
authored andcommitted
librustc: tidy
1 parent 601c2ed commit 6282e5d

File tree

9 files changed

+43
-33
lines changed

9 files changed

+43
-33
lines changed

src/librustc/back/link.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ pub fn exported_name(sess: Session,
686686
path_name(sess.ident_of(vers.to_owned()))));
687687
}
688688

689-
pub fn mangle_exported_name(ccx: @CrateContext, +path: path, t: ty::t) -> ~str {
689+
pub fn mangle_exported_name(ccx: @CrateContext,
690+
+path: path,
691+
t: ty::t) -> ~str {
690692
let hash = get_symbol_hash(ccx, t);
691693
return exported_name(ccx.sess, path,
692694
hash,

src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,8 @@ fn encode_attributes(ebml_w: writer::Encoder, attrs: &[attribute]) {
10711071
// metadata that Rust cares about for linking crates. This attribute requires
10721072
// 'name' and 'vers' items, so if the user didn't provide them we will throw
10731073
// them in anyway with default values.
1074-
fn synthesize_crate_attrs(ecx: @EncodeContext, crate: &crate) -> ~[attribute] {
1074+
fn synthesize_crate_attrs(ecx: @EncodeContext,
1075+
crate: &crate) -> ~[attribute] {
10751076
10761077
fn synthesize_link_attr(ecx: @EncodeContext, +items: ~[@meta_item]) ->
10771078
attribute {

src/librustc/middle/astencode.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ fn encode_method_map_entry(ecx: @e::EncodeContext,
565565
}
566566
567567
impl read_method_map_entry_helper for reader::Decoder {
568-
fn read_method_map_entry(xcx: @ExtendedDecodeContext) -> method_map_entry {
568+
fn read_method_map_entry(xcx: @ExtendedDecodeContext)
569+
-> method_map_entry {
569570
do self.read_rec {
570571
method_map_entry {
571572
self_arg: self.read_field(~"self_arg", 0u, || {
@@ -672,7 +673,8 @@ fn encode_vtable_origin(ecx: @e::EncodeContext,
672673
673674
trait vtable_decoder_helpers {
674675
fn read_vtable_res(xcx: @ExtendedDecodeContext) -> typeck::vtable_res;
675-
fn read_vtable_origin(xcx: @ExtendedDecodeContext) -> typeck::vtable_origin;
676+
fn read_vtable_origin(xcx: @ExtendedDecodeContext)
677+
-> typeck::vtable_origin;
676678
}
677679
678680
impl vtable_decoder_helpers for reader::Decoder {

src/librustc/middle/check_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn check_crate(tcx: ty::ctxt, crate: @crate) {
4545
}, v);
4646
}
4747
expr_fn_block(_, ref b) => {
48-
(v.visit_block)((*b), Context {
48+
(v.visit_block)((*b), Context {
4949
in_loop: false,
5050
can_ret: false
5151
}, v);

src/librustc/middle/lint.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,142 +130,142 @@ pub fn get_lint_dict() -> LintDict {
130130

131131
(@~"unused_imports",
132132
@LintSpec {
133-
lint: unused_imports,
133+
lint: unused_imports,
134134
desc: "imports that are never used",
135135
default: allow
136136
}),
137137

138138
(@~"while_true",
139139
@LintSpec {
140-
lint: while_true,
140+
lint: while_true,
141141
desc: "suggest using loop { } instead of while(true) { }",
142142
default: warn
143143
}),
144144

145145
(@~"path_statement",
146146
@LintSpec {
147-
lint: path_statement,
147+
lint: path_statement,
148148
desc: "path statements with no effect",
149149
default: warn
150150
}),
151151

152152
(@~"unrecognized_lint",
153153
@LintSpec {
154-
lint: unrecognized_lint,
154+
lint: unrecognized_lint,
155155
desc: "unrecognized lint attribute",
156156
default: warn
157157
}),
158158

159159
(@~"non_implicitly_copyable_typarams",
160160
@LintSpec {
161-
lint: non_implicitly_copyable_typarams,
161+
lint: non_implicitly_copyable_typarams,
162162
desc: "passing non implicitly copyable types as copy type params",
163163
default: warn
164164
}),
165165

166166
(@~"vecs_implicitly_copyable",
167167
@LintSpec {
168-
lint: vecs_implicitly_copyable,
168+
lint: vecs_implicitly_copyable,
169169
desc: "make vecs and strs not implicitly copyable \
170170
(only checked at top level)",
171171
default: warn
172172
}),
173173

174174
(@~"implicit_copies",
175175
@LintSpec {
176-
lint: implicit_copies,
176+
lint: implicit_copies,
177177
desc: "implicit copies of non implicitly copyable data",
178178
default: warn
179179
}),
180180

181181
(@~"deprecated_mode",
182182
@LintSpec {
183-
lint: deprecated_mode,
183+
lint: deprecated_mode,
184184
desc: "warn about deprecated uses of modes",
185185
default: warn
186186
}),
187187

188188
(@~"deprecated_pattern",
189189
@LintSpec {
190-
lint: deprecated_pattern,
190+
lint: deprecated_pattern,
191191
desc: "warn about deprecated uses of pattern bindings",
192192
default: allow
193193
}),
194194

195195
(@~"non_camel_case_types",
196196
@LintSpec {
197-
lint: non_camel_case_types,
197+
lint: non_camel_case_types,
198198
desc: "types, variants and traits should have camel case names",
199199
default: allow
200200
}),
201201

202202
(@~"managed_heap_memory",
203203
@LintSpec {
204-
lint: managed_heap_memory,
204+
lint: managed_heap_memory,
205205
desc: "use of managed (@ type) heap memory",
206206
default: allow
207207
}),
208208

209209
(@~"owned_heap_memory",
210210
@LintSpec {
211-
lint: owned_heap_memory,
211+
lint: owned_heap_memory,
212212
desc: "use of owned (~ type) heap memory",
213213
default: allow
214214
}),
215215

216216
(@~"heap_memory",
217217
@LintSpec {
218-
lint: heap_memory,
218+
lint: heap_memory,
219219
desc: "use of any (~ type or @ type) heap memory",
220220
default: allow
221221
}),
222222

223223
(@~"structural_records",
224224
@LintSpec {
225-
lint: structural_records,
225+
lint: structural_records,
226226
desc: "use of any structural records",
227227
default: deny
228228
}),
229229

230230
(@~"legacy modes",
231231
@LintSpec {
232-
lint: legacy_modes,
232+
lint: legacy_modes,
233233
desc: "allow legacy modes",
234234
default: forbid
235235
}),
236236

237237
(@~"type_limits",
238238
@LintSpec {
239-
lint: type_limits,
239+
lint: type_limits,
240240
desc: "comparisons made useless by limits of the types involved",
241241
default: warn
242242
}),
243243

244244
(@~"default_methods",
245245
@LintSpec {
246-
lint: default_methods,
246+
lint: default_methods,
247247
desc: "allow default methods",
248248
default: deny
249249
}),
250250

251251
(@~"deprecated_self",
252252
@LintSpec {
253-
lint: deprecated_self,
253+
lint: deprecated_self,
254254
desc: "warn about deprecated uses of `self`",
255255
default: warn
256256
}),
257257

258258
/* FIXME(#3266)--make liveness warnings lintable
259259
(@~"unused_variable",
260260
@LintSpec {
261-
lint: unused_variable,
261+
lint: unused_variable,
262262
desc: "detect variables which are not used in any way",
263263
default: warn
264264
}),
265265
266266
(@~"dead_assignment",
267267
@LintSpec {
268-
lint: dead_assignment,
268+
lint: dead_assignment,
269269
desc: "detect assignments that will never be read",
270270
default: warn
271271
}),

src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ pub fn extract_variant_args(bcx: block,
854854
GEP_enum(bcx, blobptr, vdefs_tg, vdefs_var,
855855
/*bad*/copy enum_ty_substs, i)
856856
};
857-
857+
858858
ExtractedBlock { vals: args, bcx: bcx }
859859
}
860860

src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub fn malloc_general_dyn(bcx: block, t: ty::t, heap: heap, size: ValueRef)
353353
let Result {bcx: bcx, val: llbox} = malloc_raw_dyn(bcx, t, heap, size);
354354
let non_gc_box = non_gc_box_cast(bcx, llbox);
355355
let body = GEPi(bcx, non_gc_box, [0u, abi::box_field_body]);
356-
356+
357357
MallocResult { bcx: bcx, box: llbox, body: body }
358358
}
359359

@@ -479,7 +479,9 @@ pub fn get_res_dtor(ccx: @CrateContext, did: ast::def_id,
479479
inline::maybe_instantiate_inline(ccx, did, true)
480480
} else { did };
481481
assert did.crate == ast::local_crate;
482-
let (val, _) = monomorphize::monomorphic_fn(ccx, did, substs, None, None, None);
482+
let (val, _) =
483+
monomorphize::monomorphic_fn(ccx, did, substs, None, None, None);
484+
483485
val
484486
} else if did.crate == ast::local_crate {
485487
get_item_val(ccx, did.node)
@@ -2206,7 +2208,8 @@ pub fn is_main_fn(sess: &Session, node_id: ast::node_id) -> bool {
22062208
22072209
// Create a _rust_main(args: ~[str]) function which will be called from the
22082210
// runtime rust_start function
2209-
pub fn create_main_wrapper(ccx: @CrateContext, _sp: span, main_llfn: ValueRef) {
2211+
pub fn create_main_wrapper(ccx: @CrateContext,
2212+
_sp: span, main_llfn: ValueRef) {
22102213
22112214
let llfn = create_main(ccx, main_llfn);
22122215
create_entry_fn(ccx, llfn);
@@ -2911,7 +2914,8 @@ pub fn fill_crate_map(ccx: @CrateContext, map: ValueRef) {
29112914
}
29122915
}
29132916
2914-
pub fn crate_ctxt_to_encode_parms(cx: @CrateContext) -> encoder::EncodeParams {
2917+
pub fn crate_ctxt_to_encode_parms(cx: @CrateContext)
2918+
-> encoder::EncodeParams {
29152919
let encode_inlined_item: encoder::encode_inlined_item =
29162920
|ecx, ebml_w, path, ii|
29172921
astencode::encode_inlined_item(ecx, ebml_w, path, ii, cx.maps);

src/librustc/middle/trans/debuginfo.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct LocalVarMetadata {
146146
struct TyDescMetadata {
147147
hash: uint
148148
}
149-
struct BlockMetadata {
149+
struct BlockMetadata {
150150
start: codemap::Loc,
151151
end: codemap::Loc
152152
}
@@ -261,7 +261,8 @@ fn get_file_path_and_dir(work_dir: &str, full_path: &str) -> (~str, ~str) {
261261
}, str::from_slice(work_dir))
262262
}
263263

264-
fn create_file(cx: @CrateContext, +full_path: ~str) -> @Metadata<FileMetadata> {
264+
fn create_file(cx: @CrateContext, +full_path: ~str)
265+
-> @Metadata<FileMetadata> {
265266
let cache = get_cache(cx);;
266267
let tg = FileDescriptorTag;
267268
match cached_metadata::<@Metadata<FileMetadata>>(

src/librustc/middle/typeck/infer/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub impl ResolveState {
223223
let bounds = nde.possible_types;
224224

225225
let t1 = match bounds {
226-
Bounds { ub:_, lb:Some(t) } if !type_is_bot(t)
226+
Bounds { ub:_, lb:Some(t) } if !type_is_bot(t)
227227
=> self.resolve_type(t),
228228
Bounds { ub:Some(t), lb:_ } => self.resolve_type(t),
229229
Bounds { ub:_, lb:Some(t) } => self.resolve_type(t),

0 commit comments

Comments
 (0)