Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created April 4, 2019 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcrichton/e0caabab7ad014486e7ed3ac53e48945 to your computer and use it in GitHub Desktop.
Save alexcrichton/e0caabab7ad014486e7ed3ac53e48945 to your computer and use it in GitHub Desktop.
extern crate foo;
pub fn bar() {
foo::foo();
}
pub fn foo() {}
@alexcrichton
Copy link
Author

$ rustc foo.rs --crate-type lib --emit metadata
$ rustc bar.rs --crate-type lib --extern foo=libfoo.rmeta

@alexcrichton
Copy link
Author

rustc +nightly foo.rs --crate-type lib --emit metadata,link

@alexcrichton
Copy link
Author

rustc +nightly --crate-type lib bar.rs --extern foo=libfoo.rmeta --error-format=json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment