From 906df51241613a70d05a08e0fdcde004a686f367 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Thu, 14 Jul 2022 13:05:14 -0700 Subject: [PATCH] More error cleanup --- errors/src/errors/flattener/flattener_errors.rs | 2 +- .../compiler/compiler/flatten/double_negate_min_fail.out | 2 +- .../expectations/compiler/compiler/integers/i128/negate_min.out | 2 +- .../compiler/compiler/integers/i128/negate_min_fail.out | 2 +- .../compiler/compiler/integers/i16/negate_min_fail.out | 2 +- .../expectations/compiler/compiler/integers/i32/negate_min.out | 2 +- .../compiler/compiler/integers/i32/negate_min_fail.out | 2 +- .../expectations/compiler/compiler/integers/i64/negate_min.out | 2 +- .../compiler/compiler/integers/i64/negate_min_fail.out | 2 +- tests/expectations/compiler/compiler/integers/i8/negate_min.out | 2 +- .../compiler/compiler/integers/i8/negate_min_fail.out | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/errors/src/errors/flattener/flattener_errors.rs b/errors/src/errors/flattener/flattener_errors.rs index a17bc3a406..78e51d3afb 100644 --- a/errors/src/errors/flattener/flattener_errors.rs +++ b/errors/src/errors/flattener/flattener_errors.rs @@ -40,7 +40,7 @@ create_messages!( @formatted unary_overflow { args: (left: impl Display, op: impl Display), - msg: format!("The const operation `({op} {left}{}` causes an overflow.", type_name(&left)), + msg: format!("The const operation `({op} {left}{})` causes an overflow.", type_name(&left)), help: None, } diff --git a/tests/expectations/compiler/compiler/flatten/double_negate_min_fail.out b/tests/expectations/compiler/compiler/flatten/double_negate_min_fail.out index 0db5613880..ade8f2164d 100644 --- a/tests/expectations/compiler/compiler/flatten/double_negate_min_fail.out +++ b/tests/expectations/compiler/compiler/flatten/double_negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_min.out b/tests/expectations/compiler/compiler/integers/i128/negate_min.out index 15116b15ac..0d1374d07c 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_min.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i128/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i128/negate_min_fail.out index 15116b15ac..0d1374d07c 100644 --- a/tests/expectations/compiler/compiler/integers/i128/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i128/negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i128 = -a;\n | ^^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -170141183460469231731687303715884105728i128)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out index bea1fcb5fe..f60596ebf9 100644 --- a/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i16/negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -32768i16` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i16 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -32768i16` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -32768i16)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i16 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -32768i16)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_min.out b/tests/expectations/compiler/compiler/integers/i32/negate_min.out index 7605e36776..9271056530 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_min.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i32/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i32/negate_min_fail.out index 7605e36776..9271056530 100644 --- a/tests/expectations/compiler/compiler/integers/i32/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i32/negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i32 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -2147483648i32)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_min.out b/tests/expectations/compiler/compiler/integers/i64/negate_min.out index 38373143bb..20d1db7c5d 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_min.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i64/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i64/negate_min_fail.out index 38373143bb..20d1db7c5d 100644 --- a/tests/expectations/compiler/compiler/integers/i64/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i64/negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i64 = -a;\n | ^^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -9223372036854775808i64)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_min.out b/tests/expectations/compiler/compiler/integers/i8/negate_min.out index e78defc2dc..15101c129f 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_min.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_min.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" diff --git a/tests/expectations/compiler/compiler/integers/i8/negate_min_fail.out b/tests/expectations/compiler/compiler/integers/i8/negate_min_fail.out index e78defc2dc..15101c129f 100644 --- a/tests/expectations/compiler/compiler/integers/i8/negate_min_fail.out +++ b/tests/expectations/compiler/compiler/integers/i8/negate_min_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n" + - "Error [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \nError [ETYC0372002]: Cannot assign a non-const or invalid expression `(neg a)` to const variable `b`\n --> compiler-test:5:5\n |\n 5 | const b: i8 = -a;\n | ^^^^^^^^^^^^^^^^\nError [EFLA0373001]: The const operation `(neg -128i8)` causes an overflow.\n --> compiler-test:1:1\n |\n 1 | \n | \n"