summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
2024-01-10Rename `{create,emit}_warning` as `{create,emit}_warn`.Nicholas Nethercote-1/+1
For consistency with `warn`/`struct_warn`, and also `{create,emit}_err`, all of which use an abbreviated form.
2024-01-05Stabilize THIR unsafeckMatthew Jasper-3/+3
2023-12-24Remove more `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-4/+5
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-11/+11
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-3/+3
2023-12-10remove redundant importssurechen-1/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-05rustc_interface: Address all `rustc::potential_query_instability` lintsMartin Nordholts-0/+7
Instead of allowing `rustc::potential_query_instability` on the whole crate we go over each lint and allow it individually if it is safe to do. Turns out all instances were safe to allow in this crate.
2023-12-02Use `Session::diagnostic` in more places.Nicholas Nethercote-3/+1
2023-11-27Auto merge of #117584 - bjorn3:eager_output_filenames, r=b-naberbors-8/+9
Eagerly compute output_filenames It can be computed before creating TyCtxt. Previously the query would also write the dep info file, which meant that the output filenames couldn't be accessed before macro expansion is done. The dep info file writing is now done as a separate non-query function. The old query was always executed again anyways due to depending on the HIR. Also encode the output_filenames in rlink files to ensure `#![crate_name]` affects the linking stage when doing separate compiling and linking using `-Zno-link`/`-Zlink-only`.
2023-11-26Turn write_dep_info into a regular functionbjorn3-2/+1
It has side-effects and as such can't be cached.
2023-11-26Ensure macro expansion runs before writing the dep infobjorn3-0/+5
2023-11-26Feed the output filenames into the TyCtxtbjorn3-7/+5
Since the introduction of the crate attribute pre-expansion pass we don't need access to the TyCtxt to compute it.
2023-11-26Accept crate name instead of attributes in build_output_filenamesbjorn3-2/+1
2023-11-26merge `DefKind::Coroutine` into `DefKind::Closure`bohan-1/+1
2023-11-22Auto merge of #118086 - nnethercote:queries-cleanups, r=bjorn3bors-2/+2
Queries cleanups r? `@bjorn3`
2023-11-22Auto merge of #117928 - nnethercote:rustc_ast_pretty, r=fee1-deadbors-1/+1
`rustc_ast_pretty` cleanups Some improvements I found while looking at this code. r? `@fee1-dead`
2023-11-22Make `Compiler::{sess,codegen_backend}` public.Nicholas Nethercote-2/+2
And remove the relevant getters on `Compiler` and `Queries`.
2023-11-22Remove outdated reference to compiler plugins.Nicholas Nethercote-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-10/+10
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-17Move `lint_store` from `GlobalCtxt` to `Session`.Nicholas Nethercote-4/+2
This was made possible by the removal of plugin support, which simplified lint store creation. This simplifies the places in rustc and rustdoc that call `describe_lints`, which are early on. The lint store is now built before those places, so they don't have to create their own lint store for temporary use, they can just use the main one.
2023-11-17Inline and remove `create_lint_store`.Nicholas Nethercote-11/+0
2023-11-04Remove support for compiler plugins.Nicholas Nethercote-15/+1
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
2023-10-30Remove `check_output`.Nicholas Nethercote-21/+3
Using `find` and `any` from `std` makes the code shorter and clearer.
2023-10-30Wrap some overlong comments.Nicholas Nethercote-10/+12
2023-10-30Remove out-of-date comment.Nicholas Nethercote-2/+0
It was added in 51938c61f6f1b26e463f9071716f543543486e72, a commit with a 7,720 line diff and a one line commit message. Even then the comment was incorrect; there was a removed a `build_output_filenames` call with a `&[]` argument in rustdoc, but the commit removed that call. In such a large commit, it's easy for small errors to occur.
2023-10-25Make `Iterator` a lang itemOli Scherer-0/+5
2023-10-25Auto merge of #116482 - matthewjasper:thir-unsafeck-inline-constants, r=b-naberbors-2/+6
Fix inline const pattern unsafety checking in THIR Fix THIR unsafety checking of inline constants. - Steal THIR in THIR unsafety checking (if enabled) instead of MIR lowering. - Represent inline constants in THIR patterns.
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-16Fix inline const pattern unsafety checking in THIRMatthew Jasper-2/+6
THIR unsafety checking was getting a cycle of function unsafety checking -> building THIR for the function -> evaluating pattern inline constants in the function -> building MIR for the inline constant -> checking unsafety of functions (so that THIR can be stolen) This is fixed by not stealing THIR when generating MIR but instead when unsafety checking. This leaves an issue with pattern inline constants not being unsafety checked because they are evaluated away when generating THIR. To fix that we now represent inline constants in THIR patterns and visit them in THIR unsafety checking.
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-2/+1
This removes a bit of global mutable state
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-8/+6
2023-09-22Merge `ExternProviders` into the general `Providers` structOli Scherer-13/+2
2023-09-22Have a single struct for queries and hookOli Scherer-11/+10
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-5/+8
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-1/+1
2023-09-01Use `OnceLock` for `SingleCache`John Kåre Alsaker-2/+2
2023-08-30Auto merge of #114908 - cjgillot:no-let-under, r=compiler-errorsbors-3/+2
Do not compute unneeded query results. r? `@ghost`
2023-08-27add rustc_abi debugging attributeRalf Jung-1/+2
2023-08-19Do not compute unneeded results.Camille GILLOT-3/+2
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-8/+27
Removes two pieces of mutable state. Follow up to #114622.
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+3
Removes a piece of mutable state. Follow up to #114578.
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-4/+7
Removes a piece of mutable state. Follow up to #114578.
2023-08-07rustc_interface: Dismantle `register_plugins` queryVadim Petrochenkov-37/+10
2023-08-04Make MissingDoc a module lint.Camille GILLOT-3/+1
2023-08-04Querify clashing_extern_declarations lint.Camille GILLOT-0/+3
2023-06-21Remove Queries::ongoing_codegen.Nicholas Nethercote-2/+2
There's no need to store it in `Queries`. We can just use a local variable, because it's always used shortly after it's produced. The commit also removes the `tcx.analysis()` call in `ongoing_codegen`, because it's easy to ensure that's done beforehand. All this makes the dataflow within `run_compiler` easier to follow, at the cost of making one test slightly more verbose, which I think is a good tradeoff.
2023-06-13Tweak names and docs for vtable statsMaybe Waffle-10/+12
2023-06-13Simplify code as suggested by the reviewMaybe Waffle-15/+6
2023-06-12Collect VTable stats & add `-Zprint-vtable-sizes`Maybe Waffle-0/+94