librustc: tidy
This commit is contained in:
parent
601c2edb4d
commit
6282e5da67
9 changed files with 43 additions and 33 deletions
|
@ -686,7 +686,9 @@ pub fn exported_name(sess: Session,
|
|||
path_name(sess.ident_of(vers.to_owned()))));
|
||||
}
|
||||
|
||||
pub fn mangle_exported_name(ccx: @CrateContext, +path: path, t: ty::t) -> ~str {
|
||||
pub fn mangle_exported_name(ccx: @CrateContext,
|
||||
+path: path,
|
||||
t: ty::t) -> ~str {
|
||||
let hash = get_symbol_hash(ccx, t);
|
||||
return exported_name(ccx.sess, path,
|
||||
hash,
|
||||
|
|
|
@ -1071,7 +1071,8 @@ fn encode_attributes(ebml_w: writer::Encoder, attrs: &[attribute]) {
|
|||
// metadata that Rust cares about for linking crates. This attribute requires
|
||||
// 'name' and 'vers' items, so if the user didn't provide them we will throw
|
||||
// them in anyway with default values.
|
||||
fn synthesize_crate_attrs(ecx: @EncodeContext, crate: &crate) -> ~[attribute] {
|
||||
fn synthesize_crate_attrs(ecx: @EncodeContext,
|
||||
crate: &crate) -> ~[attribute] {
|
||||
|
||||
fn synthesize_link_attr(ecx: @EncodeContext, +items: ~[@meta_item]) ->
|
||||
attribute {
|
||||
|
|
|
@ -565,7 +565,8 @@ fn encode_method_map_entry(ecx: @e::EncodeContext,
|
|||
}
|
||||
|
||||
impl read_method_map_entry_helper for reader::Decoder {
|
||||
fn read_method_map_entry(xcx: @ExtendedDecodeContext) -> method_map_entry {
|
||||
fn read_method_map_entry(xcx: @ExtendedDecodeContext)
|
||||
-> method_map_entry {
|
||||
do self.read_rec {
|
||||
method_map_entry {
|
||||
self_arg: self.read_field(~"self_arg", 0u, || {
|
||||
|
@ -672,7 +673,8 @@ fn encode_vtable_origin(ecx: @e::EncodeContext,
|
|||
|
||||
trait vtable_decoder_helpers {
|
||||
fn read_vtable_res(xcx: @ExtendedDecodeContext) -> typeck::vtable_res;
|
||||
fn read_vtable_origin(xcx: @ExtendedDecodeContext) -> typeck::vtable_origin;
|
||||
fn read_vtable_origin(xcx: @ExtendedDecodeContext)
|
||||
-> typeck::vtable_origin;
|
||||
}
|
||||
|
||||
impl vtable_decoder_helpers for reader::Decoder {
|
||||
|
|
|
@ -479,7 +479,9 @@ pub fn get_res_dtor(ccx: @CrateContext, did: ast::def_id,
|
|||
inline::maybe_instantiate_inline(ccx, did, true)
|
||||
} else { did };
|
||||
assert did.crate == ast::local_crate;
|
||||
let (val, _) = monomorphize::monomorphic_fn(ccx, did, substs, None, None, None);
|
||||
let (val, _) =
|
||||
monomorphize::monomorphic_fn(ccx, did, substs, None, None, None);
|
||||
|
||||
val
|
||||
} else if did.crate == ast::local_crate {
|
||||
get_item_val(ccx, did.node)
|
||||
|
@ -2206,7 +2208,8 @@ pub fn is_main_fn(sess: &Session, node_id: ast::node_id) -> bool {
|
|||
|
||||
// Create a _rust_main(args: ~[str]) function which will be called from the
|
||||
// runtime rust_start function
|
||||
pub fn create_main_wrapper(ccx: @CrateContext, _sp: span, main_llfn: ValueRef) {
|
||||
pub fn create_main_wrapper(ccx: @CrateContext,
|
||||
_sp: span, main_llfn: ValueRef) {
|
||||
|
||||
let llfn = create_main(ccx, main_llfn);
|
||||
create_entry_fn(ccx, llfn);
|
||||
|
@ -2911,7 +2914,8 @@ pub fn fill_crate_map(ccx: @CrateContext, map: ValueRef) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn crate_ctxt_to_encode_parms(cx: @CrateContext) -> encoder::EncodeParams {
|
||||
pub fn crate_ctxt_to_encode_parms(cx: @CrateContext)
|
||||
-> encoder::EncodeParams {
|
||||
let encode_inlined_item: encoder::encode_inlined_item =
|
||||
|ecx, ebml_w, path, ii|
|
||||
astencode::encode_inlined_item(ecx, ebml_w, path, ii, cx.maps);
|
||||
|
|
|
@ -261,7 +261,8 @@ fn get_file_path_and_dir(work_dir: &str, full_path: &str) -> (~str, ~str) {
|
|||
}, str::from_slice(work_dir))
|
||||
}
|
||||
|
||||
fn create_file(cx: @CrateContext, +full_path: ~str) -> @Metadata<FileMetadata> {
|
||||
fn create_file(cx: @CrateContext, +full_path: ~str)
|
||||
-> @Metadata<FileMetadata> {
|
||||
let cache = get_cache(cx);;
|
||||
let tg = FileDescriptorTag;
|
||||
match cached_metadata::<@Metadata<FileMetadata>>(
|
||||
|
|
Loading…
Reference in a new issue