about summary refs log tree commit diff
path: root/src/driver.rs
AgeCommit message (Collapse)AuthorLines
2023-12-18Rename many `DiagCtxt` and `EarlyDiagCtxt` locals.Nicholas Nethercote-2/+2
2023-12-18Rename `EarlyErrorHandler` as `EarlyDiagCtxt`.Nicholas Nethercote-2/+2
2023-12-02Rename `*note_without_error` as `*note`.Nicholas Nethercote-1/+1
Because the variant name in `Level` is `Note`, and the `without_error` suffix is omitted in similar cases like `struct_allow` and `struct_help`.
2023-11-16Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyupPhilipp Krones-1/+1
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-4/+6
2023-10-26Auto merge of #116818 - Nilstrieb:stop-submitting-bug-reports, r=wesleywiserbors-3/+5
Stop telling people to submit bugs for internal feature ICEs This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. I thought about several ways to do this but now used the explicit threading of an `Arc<AtomicBool>` through `Session`. This is not exactly incremental-safe, but this is fine, as this is set during macro expansion, which is pre-incremental, and also only affects the output of ICEs, at which point incremental correctness doesn't matter much anyways. See [MCP 620.](https://github.com/rust-lang/compiler-team/issues/596) ![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
2023-10-25Stop telling people to submit bugs for internal feature ICEsNilstrieb-3/+5
This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. See MCP 620.
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-3/+3
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-27/+28
2023-07-31Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyupPhilipp Krones-1/+1
2023-07-17Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyupPhilipp Krones-0/+7
2023-07-02Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyupPhilipp Krones-1/+1
2023-06-27Provide more context for `rustc +nightly -Zunstable-options` on stable许杰友 Jieyou Xu (Joe)-1/+5
2023-06-02Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyupPhilipp Krones-12/+3
2023-05-01Make the BUG_REPORT_URL configurable by toolsjyn-61/+9
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt
2023-04-17Force -Zflatten-format-args=no in Clippy.Mara Bos-0/+3
2023-04-11Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyupPhilipp Krones-1/+1
2023-03-29Stabilize a portion of 'once_cell'Trevor Gross-1/+1
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-10Merge commit '3c06e0b1ce003912f8fe0536d3a7fe22558e38cf' into clippyupPhilipp Krones-1/+1
2023-02-25Merge commit '149392b0baa4730c68f3c3eadf5c6ed7b16b85a4' into clippyupJason Newcomb-4/+1
2023-02-22various: translation resources from cg backendDavid Wood-1/+4
Extend `CodegenBackend` trait with a function returning the translation resources from the codegen backend, which can be added to the complete list of resources provided to the emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22errors: generate typed identifiers in each crateDavid Wood-1/+1
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-09Introduce `-Zterminal-urls` to use OSC8 for error codesEsteban Küber-0/+1
Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-01-12Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyupPhilipp Krones-1/+4
2022-12-17Merge commit '4bdfb0741dbcecd5279a2635c3280726db0604b5' into clippyupPhilipp Krones-1/+0
2022-12-01Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyupPhilipp Krones-0/+5
2022-11-22Clippy: Workaround for let_chains issuePhilipp Krones-5/+6
2022-11-21Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyupPhilipp Krones-4/+51
2022-11-05Rollup merge of #103660 - ozkanonur:master, r=jyn514Dylan DPC-74/+5
improve `filesearch::get_or_default_sysroot` `fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy. Resolves https://github.com/rust-lang/rust/issues/98832 re-opened from #103581
2022-11-04improve `filesearch::get_or_default_sysroot` r=ozkanonurOnur Özkan-74/+5
Signed-off-by: Onur Özkan <work@onurozkan.dev>
2022-10-19Implement -Ztrack-diagnosticsmejrs-0/+1
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-3/+3
2022-08-12Adjust cfgsMark Rousskov-1/+1
2022-07-27lint: add bad opt access internal lintDavid Wood-0/+2
Some command-line options accessible through `sess.opts` are best accessed through wrapper functions on `Session`, `TyCtxt` or otherwise, rather than through field access on the option struct in the `Session`. Adds a new lint which triggers on those options that should be accessed through a wrapper function so that this is prohibited. Options are annotated with a new attribute `rustc_lint_opt_deny_field_access` which can specify the error message (i.e. "use this other function instead") to be emitted. A simpler alternative would be to simply rename the options in the option type so that it is clear they should not be used, however this doesn't prevent uses, just discourages them. Another alternative would be to make the option fields private, and adding accessor functions on the option types, however the wrapper functions sometimes rely on additional state from `Session` or `TyCtxt` which wouldn't be available in an function on the option type, so the accessor would simply make the field available and its use would be discouraged too. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-06-30Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyupPhilipp Krones-5/+5
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-3/+3
2022-05-05Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyupflip1995-2/+1
2022-04-13errors: lazily load fallback fluent bundleDavid Wood-1/+2
Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-08Merge commit '984330a6ee3c4d15626685d6dc8b7b759ff630bd' into clippyupflip1995-2/+1
2022-04-05session: opt for enabling directionality markersDavid Wood-1/+1
Add an option for enabling and disabling Fluent's directionality isolation markers in output. Disabled by default as these can render in some terminals and applications. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-05errors: implement sysroot/testing bundle loadingDavid Wood-1/+3
Extend loading of Fluent bundles so that bundles can be loaded from the sysroot based on the language requested by the user, or using a nightly flag. Sysroot bundles are loaded from `$sysroot/share/locale/$locale/*.ftl`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-05errors: implement fallback diagnostic translationDavid Wood-1/+3
This commit updates the signatures of all diagnostic functions to accept types that can be converted into a `DiagnosticMessage`. This enables existing diagnostic calls to continue to work as before and Fluent identifiers to be provided. The `SessionDiagnostic` derive just generates normal diagnostic calls, so these APIs had to be modified to accept Fluent identifiers. In addition, loading of the "fallback" Fluent bundle, which contains the built-in English messages, has been implemented. Each diagnostic now has "arguments" which correspond to variables in the Fluent messages (necessary to render a Fluent message) but no API for adding arguments has been added yet. Therefore, diagnostics (that do not require interpolation) can be converted to use Fluent identifiers and will be output as before.
2022-03-20Take &mut Diagnostic in emit_diagnostic.Camille GILLOT-2/+2
Taking a Diagnostic by move would break the usual pattern `diag.label(..).emit()`.
2022-01-27Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyupflip1995-2/+1
2021-12-06Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyupflip1995-1/+1
2021-05-06Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyupflip1995-1/+1
2021-04-27Switch `rustc::internal` from deny to warnJoshua Nelson-1/+1
These should still obey deny-warnings.
2021-04-08Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyupflip1995-6/+6
2021-03-15Use `rustc_interface::interface::Config::parse_sess_created` in Clippyhyd-dev-12/+8