blob: 1c0f73a37132c096a917fe20b42ca84038213254 [file] [log] [blame]
// Regression test for issue #813.
// This ensures that the unary negation operator `-` cannot be applied to an owned `String`.
// Previously, due to a type-checking bug, this was mistakenly accepted by the compiler.
fn main() {
-"foo".to_string(); //~ ERROR cannot apply unary operator `-` to type `String`
}