rust/src/test/ui/estr-subtyping.rs
2018-12-25 21:08:33 -07:00

16 lines
230 B
Rust

fn wants_uniq(x: String) { }
fn wants_slice(x: &str) { }
fn has_uniq(x: String) {
wants_uniq(x);
wants_slice(&*x);
}
fn has_slice(x: &str) {
wants_uniq(x); //~ ERROR mismatched types
wants_slice(x);
}
fn main() {
}