1 // ignore-musl - dlsym doesn't see symbols without "-C link-arg=-Wl,--export-dynamic"
3 #![feature(rustc_private)]
5 // We're testing linkage visibility; the compiler warns us, but we want to
6 // do the runtime check that these functions aren't exported.
7 #![allow(private_no_mangle_fns)]
9 extern crate rustc_metadata;
11 use rustc_metadata::dynamic_lib::DynamicLibrary;
14 pub fn foo() { bar(); }
31 let lib = DynamicLibrary::open(None).unwrap();
33 assert!(lib.symbol::<isize>("foo").is_ok());
34 assert!(lib.symbol::<isize>("baz").is_ok());
35 assert!(lib.symbol::<isize>("bar").is_ok());