Issue 1:
Building exa fails at link stage if LTO is used and system package for libssh2-dev is not installed:

Compiling exa v0.3.0 (file:///home/butler/packs/exa)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m64" "-L" "/home/butler/.multirust/toolchains/nightly/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/butler/packs/exa/target/release/exa.0.o" "-o" "/home/butler/packs/exa/target/release/exa" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-Wl,--whole-archive" "/tmp/rustc.0qWCH5Q46Uym/liblibgit2_sys-92cc88eed912bce1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0qWCH5Q46Uym/liblibssh2_sys-63d236645b9d2140.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0qWCH5Q46Uym/libopenssl_sys-e0bd245bf09b1a3f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0qWCH5Q46Uym/libstd-35017696.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.0qWCH5Q46Uym/liballoc_jemalloc-35017696.rlib" "-Wl,--no-whole-archive" "-L" "/home/butler/packs/exa/target/release" "-L" "/home/butler/packs/exa/target/release/deps" "-L" "/home/butler/packs/exa/target/release/build/libgit2-sys-92cc88eed912bce1/out/lib" "-L" "/home/butler/packs/exa/target/release/build/libssh2-sys-63d236645b9d2140/out/lib" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/butler/packs/exa/target/release/build/libssh2-sys-63d236645b9d2140/out/lib" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/butler/packs/exa/target/release/build/openssl-sys-e0bd245bf09b1a3f/out" "-L" "/home/butler/.multirust/toolchains/nightly/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/butler/packs/exa/.rust/lib/x86_64-unknown-linux-gnu" "-L" "/home/butler/packs/exa/lib/x86_64-unknown-linux-gnu" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-l" "rt" "-l" "ssl" "-l" "crypto" "-l" "dl" "-l" "z" "-l" "ssl" "-l" "crypto" "-l" "z" "-l" "c" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "rt" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-Wl,-rpath,$ORIGIN/../../../../.multirust/toolchains/nightly/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "compiler-rt"
note: /tmp/rustc.0qWCH5Q46Uym/liblibssh2_sys-63d236645b9d2140.rlib(openssl.c.o): In function `_libssh2_rsa_new':
openssl.c:(.text._libssh2_rsa_new+0x0): multiple definition of `_libssh2_rsa_new'
/tmp/rustc.0qWCH5Q46Uym/liblibgit2_sys-92cc88eed912bce1.rlib(openssl.c.o):openssl.c:(.text._libssh2_rsa_new+0x0): first defined here
/tmp/rustc.0qWCH5Q46Uym/liblibssh2_sys-63d236645b9d2140.rlib(openssl.c.o): In function `_libssh2_dsa_new':
openssl.c:(.text._libssh2_dsa_new+0x0): multiple definition of `_libssh2_dsa_new'
/tmp/rustc.0qWCH5Q46Uym/liblibgit2_sys-92cc88eed912bce1.rlib(openssl.c.o):openssl.c:(.text._libssh2_dsa_new+0x0): first defined here
/tmp/rustc.0qWCH5Q46Uym/liblibssh2_sys-63d236645b9d2140.rlib(openssl.c.o): In function `_libssh2_cipher_init':
openssl.c:(.text._libssh2_cipher_init+0x0): multiple definition of `_libssh2_cipher_init'
..... more lines

Exa depends on libssh2-sys and libgit2-sys. If pkg-config cannot find libssh2, it's compiled locally by build.rs while building libssh2-sys and is embedded into resulting rlib as expected. For some reason, it's also present in libgit2-sys that doesn't depend on libssh2 directly. So we get second copy and linkage breaks.

This bug appeared after this commit: 9bc8e6d

Here is original bug report for reference: ogham/exa#72

Issue 2:
cargo new mycrate

Add to Cargo.toml:

[dependencies]
num = "*"

Make empty x.rs file: touch mycrate/src/x.rs

Contents of mycrate/src/lib.rs:

extern crate num;
use num as num_export;
use self::x::*;

$ cargo build
Compiling issue v0.1.0 (file:///home/stephen/Desktop/rust/issue)
src/lib.rs:2:5: 2:22 error: unresolved import (maybe you meant `num as num_export::*`?)
src/lib.rs:2 use num as num_export;
^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `issue`.

To learn more, run the command again with --verbose.

Try removing the use self::x::*; line and everything will work just fine.

OS: Ubuntu 15.04 (beta)

rustc --version: rustc 1.1.0 (35ceea399 2015-06-19)