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;
|
2016-01-13 06:29:39 +00:00
|
|
|
//~^ ERROR mismatched types
|
2014-12-15 01:23:00 +00:00
|
|
|
|
2015-03-20 06:42:18 +00:00
|
|
|
// Bool => does not implement iterator.
|
|
|
|
for i in false..true {}
|
2020-09-02 07:40:56 +00:00
|
|
|
//~^ ERROR `bool: Step` is not satisfied
|
2014-12-15 01:23:00 +00:00
|
|
|
|
|
|
|
// Unsized type.
|
2015-03-03 08:42:26 +00:00
|
|
|
let arr: &[_] = &[1, 2, 3];
|
2015-01-19 16:07:13 +00:00
|
|
|
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
|
|
|
}
|