← Repo overview
/
rust-lang/ rust
/
search
@e95e732
2,420 matches across 25 files for error lang:Markdown lang:Markdown
snippet_mode: auto · sorted by relevance
1 ▶ % Error Handling in Rust
2
3 This content has moved into
· · ·
4 ▶ [the Rust Programming Language book](book/ch09-00-error-handling.html).
5
4
5 This flag will add `LintPass` to the start of the pipeline.
6 ▶ You can use it to check for common errors in the LLVM IR generated by `rustc`.
7 You can add `-Cllvm-args=-lint-abort-on-error` to abort the process if errors were found.
8
· · ·
7 ▶ You can add `-Cllvm-args=-lint-abort-on-error` to abort the process if errors were found.
8
1 ▶ #### Note: this error code is no longer emitted by the compiler
2
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
1 Formats the value using the given formatter.
2
3 ▶ # Errors
4
5 This function should return [`Err`] if, and only if, the provided [`Formatter`] returns [`Err`].
· · ·
6 String formatting is considered an infallible operation; this function only
7 returns a [`Result`] because writing to the underlying stream might fail and it must
8 ▶ provide a way to propagate the fact that an error has occurred back up the stack.
9
1 ▶ #### This error code is internal to the compiler and will not be emitted with normal Rust code.
2 #### Note: this error code is no longer emitted by the compiler.
3
· · ·
2 ▶ #### Note: this error code is no longer emitted by the compiler.
3
1 ▶ #### This error code is internal to the compiler and will not be emitted with normal Rust code.
2 #### Note: this error code is no longer emitted by the compiler.
3
· · ·
2 ▶ #### Note: this error code is no longer emitted by the compiler.
3
1 ▶ #### This error code is internal to the compiler and will not be emitted with normal Rust code.
2
5 ------------------------
6
7 ▶ This flag converts the selected error to a [`bug!`] call, exiting the compiler immediately and allowing you to generate a backtrace of where the error occurred.
8 For full documentation, see [the rustc-dev-guide][dev-guide-backtrace].
9
· · ·
11
12 [`bug!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/macro.bug.html
13 ▶ [dev-guide-backtrace]: https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#getting-a-backtrace-for-errors
14
4
5 ```compile_fail,E0763
6 ▶ let c = b'a; // error!
7 ```
8
· · ·
9 ▶ To fix this error, add the missing quote:
10
11 ```
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 This was triggered when multiple macro definitions used the same
· · ·
4 ▶ `#[rustc_builtin_macro(..)]`. This is no longer an error.
5
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 The `#[rustc_on_unimplemented]` attribute used to raise this error for various
· · ·
3 ▶ The `#[rustc_on_unimplemented]` attribute used to raise this error for various
4 misuses of the attribute; these are now warnings.
5
4
5 ```compile_fail,E0768
6 ▶ let s: i32 = 0b; // error!
7 ```
8
· · ·
9 ▶ To fix this error, add the missing digits:
10
11 ```
1 ---
2 ▶ name: Internal Compiler Error
3 about: Create a report for an internal compiler error in rustc.
4 labels: C-bug, I-ICE, T-compiler
· · ·
3 ▶ about: Create a report for an internal compiler error in rustc.
4 labels: C-bug, I-ICE, T-compiler
5 title: "[ICE]: "
· · ·
6 ---
7 <!--
8 ▶ Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide
9 a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
10 how to create smaller examples.
· · ·
30 ```
31
32 ▶ ### Error output
33
34 ```
1 ▶ # Reporting region errors
2
3 TODO: we should discuss how to generate errors from the results of these analyses.
· · ·
3 ▶ TODO: we should discuss how to generate errors from the results of these analyses.
4
4
5 ```compile_fail,E0762
6 ▶ static C: char = '●; // error!
7 ```
8
· · ·
9 ▶ To fix this error, add the missing quote:
10
11 ```
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 The `start` function was defined with a where clause.
4
5 ```compile_fail,E0765
6 ▶ let s = "; // error!
7 ```
8
· · ·
9 ▶ To fix this error, add the missing double quote at the end of the string:
10
11 ```
4
5 ```compile_fail,E0766
6 ▶ let s = b"; // error!
7 ```
8
· · ·
9 ▶ To fix this error, add the missing double quote at the end of the string:
10
11 ```
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 Const parameters cannot depend on type parameters.
· · ·
5
6 ```compile_fail,E0770
7 ▶ fn const_id<T, const N: T>() -> T { // error
8 N
9 }
30 ```
31
32 ▶ When that is compiled, the compiler will error with something like
33
34 ```text
· · ·
35 ▶ error: backend_repr: Aggregate { sized: true }
36 --> src/lib.rs:4:1
37 |
· · ·
42 | |_^
43
44 ▶ error: size: Size { raw: 16 }
45 --> src/lib.rs:4:1
46 |
· · ·
51 | |_^
52
53 ▶ error: aborting due to 2 previous errors
54 ```
55
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 More than one function was declared with the `#[start]` attribute.
4
5 ```compile_fail,E0770
6 ▶ fn foo<T, const N: T>() {} // error!
7 ```
8
· · ·
9 ▶ To fix this error, use a concrete type for the const parameter:
10
11 ```
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 You can't import a type or module when the name of the item being imported is
· · ·
4 the same as another type or submodule defined in the module.
5
6 ▶ An example of this error:
7
8 ```compile_fail
· · ·
9 ▶ use foo::Bar; // error
10
11 type Bar = u32;
1 ▶ #### Note: this error code is no longer emitted by the compiler.
2
3 A function with the `start` attribute was declared with type parameters.
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.