File tree 3 files changed +69
-2
lines changed
3 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -404,11 +404,23 @@ pub fn find_reachable(tcx: ty::ctxt,
404
404
let reachable_context = ReachableContext :: new ( tcx, method_map) ;
405
405
406
406
// Step 1: Seed the worklist with all nodes which were found to be public as
407
- // a result of the privacy pass
407
+ // a result of the privacy pass along with all local lang items. If
408
+ // other crates link to us, they're going to expect to be able to
409
+ // use the lang items, so we need to be sure to mark them as
410
+ // exported.
411
+ let mut worklist = reachable_context. worklist . borrow_mut ( ) ;
408
412
for & id in exported_items. iter ( ) {
409
- let mut worklist = reachable_context. worklist . borrow_mut ( ) ;
410
413
worklist. get ( ) . push ( id) ;
411
414
}
415
+ for ( _, item) in tcx. lang_items . items ( ) {
416
+ match * item {
417
+ Some ( did) if is_local ( did) => {
418
+ worklist. get ( ) . push ( did. node ) ;
419
+ }
420
+ _ => { }
421
+ }
422
+ }
423
+ drop ( worklist) ;
412
424
413
425
// Step 2: Mark all symbols that the symbols on the worklist touch.
414
426
reachable_context. propagate ( ) ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #[ no_std] ;
12
+
13
+ #[ lang="fail_" ]
14
+ fn fail ( _: * i8 , _: * i8 , _: uint ) -> ! { loop { } }
15
+
16
+ #[ no_mangle]
17
+ pub extern "C" fn rust_stack_exhausted ( ) { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // aux-build:lang-item-public.rs
12
+ // ignore-fast
13
+ // ignore-android
14
+
15
+ #[ no_std] ;
16
+
17
+ extern crate lang_lib = "lang-item-public" ;
18
+
19
+ #[ cfg( target_os = "linux" ) ]
20
+ #[ link( name = "c" ) ]
21
+ extern { }
22
+
23
+ #[ cfg( target_os = "android" ) ]
24
+ #[ link( name = "c" ) ]
25
+ extern { }
26
+
27
+ #[ cfg( target_os = "freebsd" ) ]
28
+ #[ link( name = "execinfo" ) ]
29
+ extern { }
30
+
31
+ #[ cfg( target_os = "macos" ) ]
32
+ #[ link( name = "System" ) ]
33
+ extern { }
34
+
35
+ #[ start]
36
+ fn main ( _: int , _: * * u8 ) -> int {
37
+ 1 % 1
38
+ }
You can’t perform that action at this time.
0 commit comments