]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0447.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0447.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 The `pub` keyword was used inside a function.
4
5 Erroneous code example:
6
7 ```
8 fn foo() {
9     pub struct Bar; // error: visibility has no effect inside functions
10 }
11 ```
12
13 Since we cannot access items defined inside a function, the visibility of its
14 items does not impact outer code. So using the `pub` keyword in this context
15 is invalid.