about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/errors.rs
AgeCommit message (Collapse)AuthorLines
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