]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #35069 - wesleywiser:too_many_symbols, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 30 Jul 2016 20:04:30 +0000 (13:04 -0700)
committerGitHub <noreply@github.com>
Sat, 30 Jul 2016 20:04:30 +0000 (13:04 -0700)
Only export #[no_mangle] extern symbols during LTO

Fixes #34985

1  2 
src/librustc_metadata/decoder.rs

index 63345a15e6a9bea386e3966e5c1bc556ab40826f,062bbc3be40f79b888448441daca36dfdc482e52..24e8b33f44c7539feaa1d60e77d135a0d0aabea6
@@@ -55,7 -55,6 +55,6 @@@ use rustc_serialize::Decodable
  use syntax::attr;
  use syntax::parse::token;
  use syntax::ast;
- use syntax::abi::Abi;
  use syntax::codemap;
  use syntax::print::pprust;
  use syntax::ptr::P;
@@@ -1160,7 -1159,15 +1159,7 @@@ fn get_attributes(md: rbml::Doc) -> Vec
                  // an attribute
                  assert_eq!(meta_items.len(), 1);
                  let meta_item = meta_items.into_iter().nth(0).unwrap();
 -                codemap::Spanned {
 -                    node: ast::Attribute_ {
 -                        id: attr::mk_attr_id(),
 -                        style: ast::AttrStyle::Outer,
 -                        value: meta_item,
 -                        is_sugared_doc: is_sugared_doc,
 -                    },
 -                    span: syntax_pos::DUMMY_SP
 -                }
 +                attr::mk_doc_attr_outer(attr::mk_attr_id(), meta_item, is_sugared_doc)
              }).collect()
          },
          None => vec![],
@@@ -1534,13 -1541,9 +1533,9 @@@ pub fn is_extern_item<'a, 'tcx>(cdata: 
      let applicable = match item_family(item_doc) {
          ImmStatic | MutStatic => true,
          Fn => {
-             let ty::TypeScheme { generics, ty } = get_type(cdata, id, tcx);
+             let ty::TypeScheme { generics, .. } = get_type(cdata, id, tcx);
              let no_generics = generics.types.is_empty();
-             match ty.sty {
-                 ty::TyFnDef(_, _, fn_ty) | ty::TyFnPtr(fn_ty)
-                     if fn_ty.abi != Abi::Rust => return no_generics,
-                 _ => no_generics,
-             }
+             no_generics
          },
          _ => false,
      };