5 matches across 1 files for func main lang:Markdown lang:Markdown path:compiler/rustc_error_codes/src/error_codes/E0572.md
snippet_mode: auto · sorted by relevance
compiler/rustc_error_codes/src/error_codes/E0572.md MARKDOWN 5 matches view file →
1A return statement was found outside of a function body.
2
3Erroneous code example:
· · ·
4
5```compile_fail,E0572
6const FOO: u32 = return 0; // error: return statement outside of function body
7
8fn main() {}
· · ·
8fn main() {}
9```
10
· · ·
11To fix this issue, just remove the return keyword or move the expression into a
12function. Example:
13
14```
· · ·
19}
20
21fn main() {
22 some_fn();
23}
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.