2014-12-15 14:23:00 +13:00
|
|
|
// Test range syntax - type errors.
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
// Mixed types.
|
2015-01-31 17:23:42 +01:00
|
|
|
let _ = 0u32..10i32;
|
2016-01-13 01:29:39 -05:00
|
|
|
//~^ ERROR mismatched types
|
2014-12-15 14:23:00 +13:00
|
|
|
|
2015-03-19 23:42:18 -07:00
|
|
|
// Bool => does not implement iterator.
|
|
|
|
for i in false..true {}
|
2020-09-02 10:40:56 +03:00
|
|
|
//~^ ERROR `bool: Step` is not satisfied
|
2014-12-15 14:23:00 +13:00
|
|
|
|
|
|
|
// Unsized type.
|
2015-03-03 10:42:26 +02:00
|
|
|
let arr: &[_] = &[1, 2, 3];
|
2015-01-19 11:07:13 -05:00
|
|
|
let range = *arr..;
|
2018-07-10 23:10:13 +02:00
|
|
|
//~^ ERROR the size for values of type
|
2014-12-15 14:23:00 +13:00
|
|
|
}
|