rust/tests/ui/range/range-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
371 B
Rust
Raw Normal View History

2014-12-15 01:23:00 +00:00
// Test range syntax - type errors.
pub fn main() {
// Mixed types.
2015-01-31 16:23:42 +00:00
let _ = 0u32..10i32;
//~^ ERROR mismatched types
2014-12-15 01:23:00 +00:00
// Bool => does not implement iterator.
for i in false..true {}
//~^ ERROR `bool: Step` is not satisfied
2014-12-15 01:23:00 +00:00
// Unsized type.
let arr: &[_] = &[1, 2, 3];
let range = *arr..;
2018-07-10 21:10:13 +00:00
//~^ ERROR the size for values of type
2014-12-15 01:23:00 +00:00
}