Skip to content

Commit 017bc44

Browse files
Nick Hamannmichaelsproul
authored andcommitted
Add long diagnostics for E0015
1 parent 22ce069 commit 017bc44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc/diagnostics.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ reference when using guards or refactor the entire expression, perhaps by
114114
putting the condition inside the body of the arm.
115115
"##,
116116

117+
E0015: r##"
118+
The only function calls allowed in static or constant expressions are enum
119+
variant constructors or struct constructors (for unit or tuple structs). This
120+
is because Rust currently does not support compile-time function execution.
121+
"##,
122+
117123
E0020: r##"
118124
This error indicates that an attempt was made to divide by zero (or take the
119125
remainder of a zero divisor) in a static or constant expression.
@@ -343,7 +349,6 @@ register_diagnostics! {
343349
E0012,
344350
E0013,
345351
E0014,
346-
E0015,
347352
E0016,
348353
E0017,
349354
E0018,

0 commit comments

Comments
 (0)