summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/errors.rs
AgeCommit message (Collapse)AuthorLines
2023-01-03Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514bors-0/+8
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes https://github.com/rust-lang/rust/issues/103538
2022-12-31Add help for the error message when missing rustc_driverbjorn3-0/+8
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-12/+2
2022-12-16Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obkbors-8/+0
Stabilize default_alloc_error_handler Tracking issue: #66741 This turns `feature(default_alloc_error_handler)` on by default, which causes the compiler to automatically generate a default OOM handler which panics if `#[alloc_error_handler]` is not provided. The FCP completed over 2 years ago but the stabilization was blocked due to an issue with unwinding. This was fixed by #88098 so stabilization can be unblocked. Closes #66741
2022-11-20Fix CrateLocationUnknownType errorSteven Tang-0/+1
2022-11-03Stabilize default_alloc_error_handlerAmanieu d'Antras-8/+0
Closes #66741
2022-11-01Auto merge of #103217 - mejrs:track, r=eholkbors-0/+2
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-10-31Rewrite implementation of `#[alloc_error_handler]`Amanieu d'Antras-0/+25
The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`. The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic. This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called. This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-10-31Add more track_callermejrs-0/+2
2022-10-23Migrate all diagnosticsNilstrieb-93/+93
2022-10-13Add suggestion to the "missing native library" errorWesley Wiser-1/+35
If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-1/+1
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-77/+77
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-79/+79
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-2/+2
2022-09-12change rlib format to discern native dependenciesDaniil Belov-0/+6
2022-09-11Add diagnostic arg 'current_crate'Jan Niehusmann-0/+1
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-6/+6
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-08-31port 5 new diagnostics that appeared in masterNathan Stocks-0/+36
2022-08-31respond to review feedback: mainly eliminate as many conversions as possible...Nathan Stocks-103/+112
- ... when creating diagnostics in rustc_metadata - use the error_code! macro - pass macro output to diag.code() - use fluent from within manual implementation of SessionDiagnostic - emit the untested errors in case they occur in the wild - stop panicking in the probably-not-dead code, add fixme to write test
2022-08-31port of locator.rs to SessionDiagnostics, fix some of the errorsNathan Stocks-5/+252
revealed by tests, manually add a panic to test for dead code
2022-08-31port fs.rs to SessionDiagnosticsNathan Stocks-0/+26
2022-08-31port creader.rs to SessionDiagnosticsNathan Stocks-0/+52
2022-08-31port encoder.rs to SessionDiagnosticsNathan Stocks-0/+18
2022-08-31port native_libs.rs to SessionDiagnosticsNathan Stocks-0/+232
2022-08-31set up rustc_metadata for SessionDiagnostics, port dependency_format.rsNathan Stocks-0/+52