// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::unstable::dynamic_lib::DynamicLibrary; #[no_mangle] pub fn foo() { bar(); } pub fn foo2() { fn bar2() { bar(); } bar2(); } #[no_mangle] fn bar() { } #[no_mangle] fn baz() { } pub fn test() { let none: Option = None; // appease the typechecker let lib = DynamicLibrary::open(none).unwrap(); unsafe { assert!(lib.symbol::("foo").is_ok()); assert!(lib.symbol::("baz").is_err()); assert!(lib.symbol::("bar").is_err()); } }