5 matches across 1 files for func main lang:Markdown lang:Markdown path:compiler/rustc_error_codes/src/error_codes/E0764.md
snippet_mode: grep · sorted by relevance
compiler/rustc_error_codes/src/error_codes/E0764.md MARKDOWN 5 matches view file →
4
5```compile_fail,E0764
6fn main() {
7 const OH_NO: &'static mut usize = &mut 1; // error!
8}
· · ·
9```
10
11Mutable references (`&mut`) can only be used in constant functions, not statics
12or constants. This limitation exists to prevent the creation of constants that
13have a mutable reference in their final value. If you had a constant of
· · ·
21references.
22
23Remember: you cannot use a function call inside a constant or static. However,
24you can totally use it in constant functions:
25
· · ·
24you can totally use it in constant functions:
25
26```
· · ·
32}
33
34fn main() {
35 const FOO: usize = foo(10); // ok!
36}
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.