@@ -40,14 +40,12 @@ extern crate rustc_data_structures;
40
40
extern crate syntax;
41
41
extern crate syntax_pos;
42
42
43
- use rustc:: ty:: TyCtxt ;
43
+ use rustc:: ty:: { TyCtxt , Instance } ;
44
44
use rustc:: hir;
45
45
use rustc:: hir:: def_id:: LOCAL_CRATE ;
46
46
use rustc:: hir:: map as hir_map;
47
47
use rustc:: util:: nodemap:: NodeSet ;
48
48
49
- use syntax:: attr;
50
-
51
49
pub mod common;
52
50
pub mod link;
53
51
pub mod collector;
@@ -77,7 +75,7 @@ pub fn check_for_rustc_errors_attr(tcx: TyCtxt) {
77
75
///
78
76
/// This list is later used by linkers to determine the set of symbols needed to
79
77
/// 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 {
81
79
tcx. reachable_set ( LOCAL_CRATE ) . 0 . iter ( ) . cloned ( ) . filter ( |& id| {
82
80
// Next, we want to ignore some FFI functions that are not exposed from
83
81
// this crate. Reachable FFI functions can be lumped into two
@@ -110,8 +108,7 @@ pub fn find_exported_symbols(tcx: TyCtxt) -> NodeSet {
110
108
( generics. parent_types == 0 && generics. types . is_empty ( ) ) &&
111
109
// Functions marked with #[inline] are only ever translated
112
110
// 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) )
115
112
}
116
113
117
114
_ => false
0 commit comments