diff options
Diffstat (limited to 'src/comp/metadata')
| -rw-r--r-- | src/comp/metadata/creader.rs | 28 | ||||
| -rw-r--r-- | src/comp/metadata/decoder.rs | 5 |
2 files changed, 15 insertions, 18 deletions
diff --git a/src/comp/metadata/creader.rs b/src/comp/metadata/creader.rs index abbc887cd12..b0fa97f7ea9 100644 --- a/src/comp/metadata/creader.rs +++ b/src/comp/metadata/creader.rs @@ -122,22 +122,20 @@ fn find_library_crate(sess: &session::session, ident: &ast::ident, attr::require_unique_names(sess, metas); - let - // FIXME: Probably want a warning here since the user - // is using the wrong type of meta item - crate_name = - { - let name_items = attr::find_meta_items_by_name(metas, "name"); - alt ivec::last(name_items) { - some(i) { - alt attr::get_meta_item_value_str(i) { - some(n) { n } - _ { ident } - } - } - none. { ident } + // FIXME: Probably want a warning here since the user + // is using the wrong type of meta item + let crate_name = { + let name_items = attr::find_meta_items_by_name(metas, "name"); + alt ivec::last(name_items) { + some(i) { + alt attr::get_meta_item_value_str(i) { + some(n) { n } + _ { ident } } - }; + } + none. { ident } + } + }; let nn = default_native_lib_naming(sess, sess.get_opts().static); let x = diff --git a/src/comp/metadata/decoder.rs b/src/comp/metadata/decoder.rs index d7d82c1fa36..ab9c07981b9 100644 --- a/src/comp/metadata/decoder.rs +++ b/src/comp/metadata/decoder.rs @@ -164,9 +164,8 @@ fn lookup_def(cnum: ast::crate_num, data: @u8[], did_: &ast::def_id) -> let item = lookup_item(did_.node, data); let kind_ch = item_kind(item); let did = {crate: cnum, node: did_.node}; - let - // We treat references to tags as references to types. - def = + // We treat references to tags as references to types. + let def = alt kind_ch as char { 'c' { ast::def_const(did) } 'f' { ast::def_fn(did, ast::impure_fn) } |
