about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2024-05-28Create const block DefIds in typeck instead of ast loweringOli Scherer-4/+4
2024-02-20Stabilize `LazyCell` and `LazyLock` (`lazy_cell`)Peter Jaszkowiak-1/+0
2024-05-19Add and use generics.is_empty() and generics.is_own_empty, rather than using ↵Santiago Pastorino-1/+1
generics' attributes
2024-05-13Remove `extern crate rustc_middle` from `rustc_hir_analysis`.Nicholas Nethercote-3/+0
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-1/+1
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-04-13remove some ancient debug output, looks unused?klensy-1/+0
2024-04-08Ensure we do not accidentally insert new early aborts in the analysis passesOli Scherer-7/+4
2024-03-26Auto merge of #121387 - oli-obk:eager_const_failures_regression, r=lcnrbors-2/+8
Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from https://github.com/rust-lang/rust/pull/121087
2024-03-22Rename module astconv to hir_ty_loweringLeón Orell Valerian Liehr-2/+2
Split from the main renaming commit to make git generate a proper diff for ease of reviewing.
2024-03-22Update (doc) commentsLeón Orell Valerian Liehr-4/+12
Several (doc) comments were super outdated or didn't provide enough context. Some doc comments shoved everything in a single paragraph without respecting the fact that the first paragraph should be a single sentence because rustdoc treats these as item descriptions / synopses on module pages.
2024-03-22Rename AstConv to HIR ty loweringLeón Orell Valerian Liehr-2/+2
This includes updating astconv-related items and a few local variables.
2024-03-20step cfgsMark Rousskov-1/+0
2024-03-19Avoid computing generic params or a param env for free const itemsOli Scherer-2/+8
2024-03-15Rollup merge of #122527 - fmease:clean-up-hir-ty-lowering, r=compiler-errorsMatthias Krüger-33/+4
Clean up AstConv Split off from #120926 to make it only contain the renaming & (doc) comment updates. Any changes other than that which have accumulated over time are now part of this PR. Let's be disciplined ;) Inspired by https://github.com/rust-lang/rust/pull/120926#issuecomment-1997984483. --- * Remove `hir_trait_to_predicates` * Unused since #113671 * Inline `create_args_for_ast_trait_ref` * Only had a single call site * Having it as a separate method didn't gain us anything * Use an if-let guard somewhere to avoid unwrapping * Avoid explicit trait object lifetimes * More legible, stylistic-only (the updated code is 100% semantically identical) * Use explicitly elided lifetimes in impl headers, they get elaborated to distinct lifetimes * Make use of [object lifetime defaulting](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) for a trait object type inside of a reference type somewhere * Use preexisting dedicated method `ItemCtxt::to_ty` over `<dyn AstConv<'_>>::ast_ty_to_ty` * Use preexisting dedicated method `AstConv::astconv` over explicit coercions * Simplify the function signature of `create_args_for_ast_path` and of `check_generic_arg_count` * In both cases redundant information was passed rendering the call sites verbose and confusing * No perf impact (tested in [#120926](https://github.com/rust-lang/rust/pull/120926)) * Move diagnostic method `report_ambiguous_associated_type` from `astconv` to `astconv::errors` * The submodule `errors` exists specifically for that purpose * Use it to keep the main module clean & short
2024-03-15Clean up AstConvLeón Orell Valerian Liehr-33/+4
2024-03-14Auto merge of #122347 - oli-obk:track_errors13, r=compiler-errorsbors-4/+26
Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco" This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd. reverts https://github.com/rust-lang/rust/pull/122140 It was a large regression in wall time due to trashing CPU caches
2024-03-12Change `DefKind::Static` to a struct variantOli Scherer-1/+1
2024-03-11Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco"Oli Scherer-4/+26
This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd.
2024-03-11Run a single huge `par_body_owners` instead of many small ones after each other.Oli Scherer-13/+0
This improves parallel rustc parallelism by avoiding the bottleneck after each individual `par_body_owners` (because it needs to wait for queries to finish, so if there is one long running one, a lot of cores will be idle while waiting for the single query).
2024-03-11Merge various rustc_attr based testsOli Scherer-8/+2
2024-03-11Never bail out early while running all the type check queriesOli Scherer-7/+4
2024-03-07Merge collect_mod_item_types query into check_well_formedOli Scherer-6/+0
2024-03-07Merge `check_mod_impl_wf` and `check_mod_type_wf`Oli Scherer-12/+4
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-0/+11
2024-02-16Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnaybors-0/+1
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
2024-02-15Use generic `NonZero` internally.Markus Reiter-0/+1
2024-02-14Continue compilation even if inherent impl checks failOli Scherer-2/+3
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-2/+4
2024-02-10Remove unnecessary `min_specialization` after bootstrapZalathar-1/+1
These crates all needed specialization for `newtype_index!`, which will no longer be necessary when the current nightly eventually becomes the next bootstrap compiler.
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-0/+2
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-1/+1
2024-02-06Invert diagnostic lints.Nicholas Nethercote-0/+2
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-05Stop bailing out from compilation just because there were incoherent traitsOli Scherer-2/+2
2024-01-25Remove unused featuresclubby789-3/+0
2024-01-23Remove track_errors entirelyOli Scherer-10/+6
2024-01-21Auto merge of #120100 - oli-obk:astconv_lifetimes, r=BoxyUwUbors-2/+2
Don't forget that the lifetime on hir types is `'tcx` This PR just tracks the `'tcx` lifetime to wherever the original objects actually have that lifetime. This code is needed for https://github.com/rust-lang/rust/pull/107606 (now #120131) so that `ast_ty_to_ty` can invoke `lit_to_const` on an argument passed to it. Currently the argument is `&hir::Ty<'_>`, but after this PR it is `&'tcx hir::Ty<'tcx>`.
2024-01-18Don't forget that the lifetime on hir types is `'tcx`Oli Scherer-2/+2
2024-01-17Make crate_inherent_impls fallible and stop using `track_errors` for itOli Scherer-3/+2
2024-01-17Make crate_inherent_impls_overlap_check bubble up its errorsOli Scherer-1/+1
2024-01-17Move `check_mod_impl_wf` query call out of track_errors and bubble errors up ↵Oli Scherer-7/+8
instead.
2024-01-17Stop using track_errors for some forever unstable rustc_attr analysesOli Scherer-7/+3
2024-01-13Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, ↵bors-7/+2
r=Nilstrieb Suggest Upgrading Compiler for Gated Features This PR addresses #117318 I have a few questions: 1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag a. How can I handle the changing message in the tests? 3. Do we want to only show this message when the compiler is old? a. How can we determine when the compiler is old? I'll wait until we figure out the message to bless the tests
2024-01-13Add check for ui_testing via promoting parameters from `ParseSess` to `Session`George-lewis-7/+2
2024-01-13Rollup merge of #119587 - beepster4096:system_varargs, r=petrochenkovMatthias Krüger-1/+2
Varargs support for system ABI This PR allows functions with the `system` ABI to be variadic (under the `extended_varargs_abi_support` feature tracked in #100189). On x86 windows, the `system` ABI is equivalent to `C` for variadic functions. On other platforms, `system` is already equivalent to `C`. Fixes #110505
2024-01-12allow system abi to be variadicbeepster4096-1/+2
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-6/+5
2024-01-02Merge check_for_entry_fn fully into check_mod_type_wfOli Scherer-7/+2
2024-01-02Reorder `check_item_type` diagnostics so they occur next to the ↵Oli Scherer-6/+2
corresponding `check_well_formed` diagnostics
2023-12-24Remove more `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1