mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
17 lines
249 B
Rust
17 lines
249 B
Rust
type Range = std::ops::Range<usize>;
|
|
|
|
fn demo(r: &Range) {
|
|
println!("{:?}", r);
|
|
}
|
|
|
|
fn tell(x: usize) -> usize {
|
|
x
|
|
}
|
|
|
|
fn main() {
|
|
demo(tell(1)..tell(10));
|
|
//~^ ERROR mismatched types
|
|
demo(1..10);
|
|
//~^ ERROR mismatched types
|
|
}
|