]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/logging-right-crate.rs
Imported Upstream version 1.8.0+dfsg1
[rustc.git] / src / test / run-pass / logging-right-crate.rs
1 // Copyright 2013-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:logging_right_crate.rs
12 // exec-env:RUST_LOG=logging-right-crate=debug
13
14 // This is a test for issue #3046 to make sure that when we monomorphize a
15 // function from one crate to another the right top-level logging name is
16 // preserved.
17 //
18 // It used to be the case that if logging were turned on for this crate, all
19 // monomorphized functions from other crates had logging turned on (their
20 // logging module names were all incorrect). This test ensures that this no
21 // longer happens by enabling logging for *this* crate and then invoking a
22 // function in an external crate which will panic when logging is enabled.
23
24 // pretty-expanded FIXME #23616
25
26 extern crate logging_right_crate;
27
28 pub fn main() {
29 // this function panicks if logging is turned on
30 logging_right_crate::foo::<isize>();
31 }