Issue 1:
This error can be shown with two rust files compiled directly via rustc (or cargo, but just using rustc is simpler for showing the error).

cratea.rs:

#![crate_name = "cratea"]
#![crate_type = "lib"]

pub mod pub_dispatch {
use dispatch;

pub fn create_dispatch() -> dispatch::Dispatch {
return dispatch::Dispatch;
}
}

mod dispatch {
pub struct Dispatch;

impl Dispatch {
pub fn dispatch(self) {
}
}
}

crateb.rs:

#![crate_name = "crateb"]
extern crate cratea;

fn main() {
let dispatch = cratea::pub_dispatch::create_dispatch();

dispatch.dispatch();
}

Output from compiling:

$ rustc cratea.rs
cratea.rs:16:9: 17:10 warning: method is never used: `dispatch`, #[warn(dead_code)] on by default
cratea.rs:16 pub fn dispatch(self) {
cratea.rs:17 }
$ rustc -L crate=./ crateb.rs
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "crateb" "crateb.o" "-Wl,--whole-archive" "-lmorestack" "-Wl,--no-whole-archive" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "/tmp/tmp.8n2IVQ5qlk/libcratea.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4e7c5e5c.rlib" "-L" "./" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/tmp/tmp.8n2IVQ5qlk/.rust/lib/x86_64-unknown-linux-gnu" "-L" "/tmp/tmp.8n2IVQ5qlk/lib/x86_64-unknown-linux-gnu" "-Wl,--whole-archive" "-Wl,-Bstatic" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-ldl" "-lpthread" "-lrt" "-lgcc_s" "-lpthread" "-lc" "-lm" "-lcompiler-rt"
note: crateb.o: In function `main::h69a169139aab5413faa':
crateb.0.rs:(.text._ZN4main20h69a169139aab5413faaE+0x2c): undefined reference to `dispatch::Dispatch::dispatch::ha28d1bdf4c2d8d39uaa'
collect2: error: ld returned 1 exit status

error: aborting due to previous error

Happens in rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02) and rustc 1.0.0-nightly (083b8a404 2015-04-05) (built 2015-04-05).

I would expect this to fail when compiling cratea, but instead cratea compiles fine, but then any crate using it will fail compiling.

Issue 2:
// foo.rs
pub use foo::Bar;

pub fn test() -> Bar<i32> {
loop {}
}

mod foo {
pub type Bar<T> = Result<T, Baz>;

pub struct Baz;

impl Baz {
pub fn foo(&self) {}
}
}

// bar.rs
extern crate foo;

fn main() {
match foo::test() {
Ok(..) => {}
Err(e) => e.foo()
}
}

$ rustc --crate-type lib foo.rs
foo.rs:13:9: 13:29 warning: code is never used: `foo`, #[warn(dead_code)] on by default
foo.rs:13 pub fn foo(&self) {}
^~~~~~~~~~~~~~~~~~~~
$ rustc bar.rs -L.
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'bar' 'bar.o' '-Wl,--whole-archive' '-lmorestack' '-Wl,--no-whole-archive' '-nodefaultlibs' '-Wl,--gc-sections' '-pie' '-Wl,--as-needed' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-4e7c5e5c.rlib' '/home/alex/libfoo.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libsync-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustrt-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-4e7c5e5c.rlib' '/home/alex/code/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4e7c5e5c.rlib' '-L' '.' '-L' '/home/alex/.rust' '-L' '/home/alex' '-Wl,--whole-archive' '-Wl,-Bstatic' '-Wl,--no-whole-archive' '-Wl,-Bdynamic' '-ldl' '-lpthread' '-lgcc_s' '-lpthread' '-lc' '-lm' '-lcompiler-rt'
note: bar.o: In function `main::hbeb79415393a4115faa':
bar.rs:(.text._ZN4main20hbeb79415393a4115faaE+0x45): undefined reference to `foo::Baz::foo::h3d69757c908833a5Yaa'
collect2: error: ld returned 1 exit status

error: aborting due to previous error

There are a number of problems with this, and they may likely all be inter-related.

linker error

dead code which is not actually dead code

it should be an error that Baz is a publicly visible private type.

Nominating due to the publicly visible private type not generating an error.