]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0448.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0448.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 The `pub` keyword was used inside a public enum.
4
5 Erroneous code example:
6
7 ```compile_fail
8 pub enum Foo {
9     pub Bar, // error: unnecessary `pub` visibility
10 }
11 ```
12
13 Since the enum is already public, adding `pub` on one its elements is
14 unnecessary. Example:
15
16 ```compile_fail
17 enum Foo {
18     pub Bar, // not ok!
19 }
20 ```
21
22 This is the correct syntax:
23
24 ```
25 pub enum Foo {
26     Bar, // ok!
27 }
28 ```