Created
October 25, 2019 15:08
-
-
Save alexcrichton/b3ba3becdf2009973270d2aef3453670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
rm -rf tmp | |
mkdir tmp | |
rustc="rustc --out-dir tmp -L tmp -C debuginfo=2" | |
$rustc mycore.rs --crate-type rlib | |
$rustc mystd.rs --crate-type dylib -C prefer-dynamic | |
$rustc mygetopts.rs --crate-type rlib | |
$rustc mytest.rs --crate-type dylib -C prefer-dynamic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Object { fn method(&self) { } } | |
impl Object for u32 { } | |
impl Object for () { } | |
impl<T> Object for &T { } | |
pub fn unused() { | |
let ref u = 0_u32; | |
let _d = &u as &dyn crate::Object; | |
loop { } | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate mystd; | |
use mystd::Object; | |
pub fn another_dyn_debug() { | |
let ref u = 1_u32; | |
let _d = &u as &dyn crate::Object; | |
loop { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate mycore; | |
pub use mycore::Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate mygetopts; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment