Well, you can rename dependencies as described in the documentation here. It's designed for pulling in two versions of the same crate, but I figure it works for your situation as well (haven't tried it myself, though).
If you want to do this all within one package, you could create two different modules that are compiled from the same source files. (These modules would both be within the same crate; a Cargo package can't contain multiple library crates.)
#[path = "foo/mod.rs"]
mod a;
#[path = "foo/mod.rs"]
mod b;