From 7d2fd2302d75eaa76028719f88c8dc759b3ec277 Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Thu, 16 Apr 2015 00:46:41 -0500 Subject: [PATCH 1/2] Add long diagnostics for E0020 --- src/librustc/diagnostics.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index e1eb8d7418695..9885cc1a8ff16 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -112,6 +112,11 @@ reference when using guards or refactor the entire expression, perhaps by putting the condition inside the body of the arm. "##, +E0020: r##" +This error indicates that an attempt was made to divide by zero (or take the +remainder of a zero divisor) in a static or constant expression. +"##, + E0152: r##" Lang items are already implemented in the standard library. Unless you are writing a free-standing application (e.g. a kernel), you do not need to provide @@ -319,7 +324,6 @@ register_diagnostics! { E0017, E0018, E0019, - E0020, E0022, E0079, // enum variant: expected signed integer constant E0080, // enum variant: constant evaluation error From 8d795ef04544b7aba2e113c00ba9e628615c2d55 Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Thu, 16 Apr 2015 00:47:31 -0500 Subject: [PATCH 2/2] Add long diagnostics for E0015 --- src/librustc/diagnostics.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 9885cc1a8ff16..5755c69fdf57b 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -112,6 +112,12 @@ reference when using guards or refactor the entire expression, perhaps by putting the condition inside the body of the arm. "##, +E0015: r##" +The only function calls allowed in static or constant expressions are enum +variant constructors or struct constructors (for unit or tuple structs). This +is because Rust currently does not support compile-time function execution. +"##, + E0020: r##" This error indicates that an attempt was made to divide by zero (or take the remainder of a zero divisor) in a static or constant expression. @@ -319,7 +325,6 @@ register_diagnostics! { E0012, E0013, E0014, - E0015, E0016, E0017, E0018,