1
Fork 0
rust/compiler/rustc_errors/src
bors 11ebe6512b Auto merge of #103217 - mejrs:track, r=eholk
Track where diagnostics were created.

This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`.

For example, the following code...

```rust
struct A;
struct B;

fn main(){
    let _: A = B;
}
```
...now emits the following error message:

```
error[E0308]: mismatched types
 --> src\main.rs:5:16
  |
5 |     let _: A = B;
  |            -   ^ expected struct `A`, found struct `B`
  |            |
  |            expected due to this
-Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31
```
2022-11-01 21:09:45 +00:00
..
json Implement -Ztrack-diagnostics 2022-10-19 00:08:20 +02:00
annotate_snippet_emitter_writer.rs errors: use HashMap to store diagnostic args 2022-10-10 14:20:16 +01:00
diagnostic.rs Auto merge of #103217 - mejrs:track, r=eholk 2022-11-01 21:09:45 +00:00
diagnostic_builder.rs Implement -Ztrack-diagnostics 2022-10-19 00:08:20 +02:00
diagnostic_impls.rs Migrate all diagnostics 2022-10-23 10:09:44 +02:00
emitter.rs Address some comments 2022-10-24 20:52:51 +02:00
json.rs Implement -Ztrack-diagnostics 2022-10-19 00:08:20 +02:00
lib.rs Auto merge of #103217 - mejrs:track, r=eholk 2022-11-01 21:09:45 +00:00
lock.rs
registry.rs Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
snippet.rs Compute most of Public/Exported access level in rustc_resolve 2022-01-09 21:33:14 +00:00
styled_buffer.rs Spellchecking some comments 2022-03-30 01:39:38 -04:00
translation.rs errors: DiagnosticMessage::Eager 2022-10-10 14:20:16 +01:00