about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir
AgeCommit message (Collapse)AuthorLines
2023-12-18resolve: Replace visibility table in resolver outputs with query feedingVadim Petrochenkov-1/+4
Also feed missing visibilities for import stems and trait impl items, which were previously evaluated lazily.
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-50/+60
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-11Auto merge of #118661 - fee1-dead-contrib:restore-const-partialEq, ↵bors-9/+7
r=compiler-errors Restore `const PartialEq` And thus fixes a number of tests. There is a bug that still needs to be fixed, so WIP for now. r? `@compiler-errors`
2023-12-10fix clippyDeadbeef-9/+7
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-11-28resolve: Feed the `def_kind` query immediately on `DefId` creationVadim Petrochenkov-94/+1
2023-11-26Rollup merge of #118311 - bvanjoi:merge_coroutinue_into_closure, r=petrochenkovGuillaume Gomez-3/+2
merge `DefKind::Coroutine` into `Defkind::Closure` Related to #118188 We no longer need to be concerned about the precise type whether it's `DefKind::Closure` or `DefKind::Coroutine`. Furthermore, thanks for the great work done by `@petrochenkov` on investigating https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Why.20does.20it.20hang.20when.20querying.20.EF.BB.BF.60opt_def_kind.60.3F r? `@petrochenkov`
2023-11-26merge `DefKind::Coroutine` into `DefKind::Closure`bohan-3/+2
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-12/+7
cleanup
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-12/+8
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-7/+5
`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-10-23Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillotbors-12/+35
Avoid a `track_errors` by bubbling up most errors from `check_well_formed` I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them. This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`) cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-12/+35
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-4/+7
2023-09-26Don't store lazyness in DefKindMichael Goulet-3/+1
2023-09-21Prevent promotion of const fn calls in inline constsOli Scherer-3/+4
2023-09-07Enable incremental-relative-spans by default.Camille GILLOT-1/+1
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-1/+1
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-1/+0
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-08-30Make get_return_block() return Some only for HIR nodes in bodyGurinder Singh-1/+12
Fixes # 114918
2023-08-19remove redundant var rebindingsMatthias Krüger-5/+2
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-18/+20
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+1
Removes a piece of mutable state. Follow up to #114578.
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-1/+3
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-1/+3
2023-08-05parent_module_from_def_id does not need to be a query.Camille GILLOT-16/+15
2023-08-04Rollup merge of #114022 - oli-obk:tait_ice_alias_field_projection, r=cjgillotMatthias Krüger-0/+4
Perform OpaqueCast field projection on HIR, too. fixes #105819 This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field). See https://github.com/rust-lang/rust/pull/99806 for when and why we added OpaqueCast to MIR.
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-1/+0
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-1/+1
2023-07-28Lower generic const items to HIRLeón Orell Valerian Liehr-1/+1
2023-07-24Perform OpaqueCast field projection on HIR, too.Oli Scherer-0/+4
This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).
2023-07-14fix the issue of shorthand in suggest_cloningyukang-0/+27
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-7/+1
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-9/+10
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-2/+2
2023-05-19Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillotbors-0/+16
Fix dependency tracking for debugger visualizers This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves. TODO: - [x] perf.rlo - [x] Needs a bit more documentation in some places - [x] Needs regression test for the incr. comp. case Fixes https://github.com/rust-lang/rust/issues/111226 Fixes https://github.com/rust-lang/rust/issues/111227 Fixes https://github.com/rust-lang/rust/issues/111295 r? `@wesleywiser` cc `@gibbyfree`
2023-05-17Retire is_foreign_item query.Camille GILLOT-0/+7
2023-05-16Move DebuggerVisualizerFile types from rustc_span to rustc_middleMichael Woerister-1/+2
2023-05-16Turn debugger_visualizers from feed- into regular query.Michael Woerister-0/+5
2023-05-16Fix dependency tracking for debugger visualizersMichael Woerister-1/+11
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-06introduce `DynSend` and `DynSync` auto traitSparrowLii-13/+8
2023-04-26Remove unused `TypeFoldable`/`TypeVisitable` impls.Nicholas Nethercote-1/+0
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-21Allow `LocalDefId` as the argument to `def_path_str`Oli Scherer-1/+1
2023-04-16Remove some unnecessary hash truncationsBen Kimock-1/+1
2023-04-13make impl_subject more readableKyle Matsuda-6/+4
2023-04-13make tcx.impl_subject return EarlyBinder, remove bound_impl_subject, rename ↵Kyle Matsuda-6/+8
usages of bound_impl_subject to impl_subject