PathNotFound(ref path) =>
write!(f, "Cannot find path {:?}", path),
MachineError(ref inner) =>
- write!(f, "machine error: {}", inner),
+ write!(f, "{}", inner),
IncorrectAllocationInformation(size, size2, align, align2) =>
write!(f, "incorrect alloc info: expected size {} and align {}, got size {} and align {}", size, align, size2, align2),
_ => write!(f, "{}", self.description()),
let n = n as i128;
let oflo = val > max - n;
let val = if oflo {
- min + (n - (max - val))
+ min + (n - (max - val) - 1)
} else {
val + n
};
let val = self.val;
let oflo = val > max - n;
let val = if oflo {
- min + (n - (max - val))
+ min + (n - (max - val) - 1)
} else {
val + n
};
msg
)
}
- NotConst(ref msg) => write!(f, "Cannot evaluate within constants: \"{}\"", msg),
+ NotConst(ref msg) => write!(f, "{}", msg),
}
}
}
write(|| format_args!("{}", String::from("Hello world")));
//~^ ERROR borrowed value does not live long enough
//~| ERROR borrowed value does not live long enough
- //~| ERROR borrowed value does not live long enough
}
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo(_: &'static [&'static str]) {}
+fn bar(_: &'static [&'static str; 3]) {}
+
+fn main() {
+ foo(&["a", "b", "c"]);
+ bar(&["d", "e", "f"]);
+}
Ok = u16::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
- //~| overflowed on value after 65535u16
+ //~| overflowed on value after 65535
}
let x = A::Ok;
Ok = i32::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
- //~| overflowed on value after 2147483647i32
+ //~| overflowed on value after 2147483647
}
let x = A::Ok;
Ok = u32::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
- //~| overflowed on value after 4294967295u32
+ //~| overflowed on value after 4294967295
}
let x = A::Ok;
Ok = i64::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
- //~| overflowed on value after 9223372036854775807i64
+ //~| overflowed on value after 9223372036854775807
}
let x = A::Ok;
Ok = u64::MAX - 1,
Ok2,
OhNo, //~ ERROR enum discriminant overflowed [E0370]
- //~| overflowed on value after 18446744073709551615u64
+ //~| overflowed on value after 18446744073709551615
}
let x = A::Ok;
enum Enum {
P = 3,
X = 3,
- //~^ ERROR discriminant value `3isize` already exists
+ //~^ ERROR discriminant value `3` already exists
Y = 5
}