blob: ba096f9e984ae73ef9bdf19737d7dfab469926a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#### Note: this error code is no longer emitted by the compiler.
The `pub` keyword was used inside a public enum.
Erroneous code example:
```compile_fail
pub enum Foo {
pub Bar, // error: unnecessary `pub` visibility
}
```
Since the enum is already public, adding `pub` on one its elements is
unnecessary. Example:
```compile_fail
enum Foo {
pub Bar, // not ok!
}
```
This is the correct syntax:
```
pub enum Foo {
Bar, // ok!
}
```
|