@@ -40,14 +40,12 @@ extern crate rustc_data_structures;
4040extern crate syntax;
4141extern crate syntax_pos;
4242
43- use rustc:: ty:: TyCtxt ;
43+ use rustc:: ty:: { TyCtxt , Instance } ;
4444use rustc:: hir;
4545use rustc:: hir:: def_id:: LOCAL_CRATE ;
4646use rustc:: hir:: map as hir_map;
4747use rustc:: util:: nodemap:: NodeSet ;
4848
49- use syntax:: attr;
50-
5149pub mod common;
5250pub mod link;
5351pub mod collector;
@@ -77,7 +75,7 @@ pub fn check_for_rustc_errors_attr(tcx: TyCtxt) {
7775///
7876/// This list is later used by linkers to determine the set of symbols needed to
7977/// be exposed from a dynamic library and it's also encoded into the metadata.
80- pub fn find_exported_symbols ( tcx : TyCtxt ) -> NodeSet {
78+ pub fn find_exported_symbols < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> NodeSet {
8179 tcx. reachable_set ( LOCAL_CRATE ) . 0 . iter ( ) . cloned ( ) . filter ( |& id| {
8280 // Next, we want to ignore some FFI functions that are not exposed from
8381 // this crate. Reachable FFI functions can be lumped into two
@@ -110,8 +108,7 @@ pub fn find_exported_symbols(tcx: TyCtxt) -> NodeSet {
110108 ( generics. parent_types == 0 && generics. types . is_empty ( ) ) &&
111109 // Functions marked with #[inline] are only ever translated
112110 // with "internal" linkage and are never exported.
113- !attr:: requests_inline ( & tcx. get_attrs ( def_id) ) &&
114- !tcx. is_const_fn ( def_id)
111+ !common:: requests_inline ( tcx, & Instance :: mono ( tcx, def_id) )
115112 }
116113
117114 _ => false
0 commit comments