summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/map
AgeCommit message (Collapse)AuthorLines
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-1/+1
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-06introduce `DynSend` and `DynSync` auto traitSparrowLii-8/+3
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-11Auto merge of #109778 - petrochenkov:allkind, r=cjgillotbors-3/+18
rustc_middle: Document which exactly `DefId`s don't have `DefKind`s I don't currently have time to investigate when and how to create these missing HIR nodes, but if someone else could do that it would be great.
2023-04-09Delete useless loopNilstrieb-9/+8
2023-03-30rustc_middle: Document which exactly `DefId`s don't have `DefKind`sVadim Petrochenkov-3/+18
2023-03-21RPITITs are DefKind::Opaque with new lowering strategyMichael Goulet-1/+1
2023-03-21LocalCrate keyMichael Goulet-1/+2
2023-03-21Use local key in providersMichael Goulet-3/+2
2023-03-14Remove some direct calls to local_def_id_to_hir_id on diagnosticsSantiago Pastorino-2/+2
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-1/+1
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-26Access upvars through a query.Camille GILLOT-0/+5
2023-02-19Add associated_items_for_impl_trait_in_trait querySantiago Pastorino-0/+7
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-1/+1
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-02-01Improve pretty-printing of `HirIdValidator` errorsArpad Borsos-15/+12
This now uses `node_to_string` for both missing and seen Ids, which includes the snippet of code for which the Id was allocated. Also removes the duplicated printing of `HirId`, as `node_to_string` includes that already. Similarly, changes all other users of `node_to_string` that do so, and changes the output of `node_to_string`, which is now "$hirid ($what `$span` in $path)".
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-40/+19
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-2/+2
2023-01-12fix fmt and blessDeadbeef-1/+3
2023-01-12attempt to make a minimal example workDeadbeef-1/+1
2023-01-04get_parent and find_parentMichael Goulet-5/+13
2023-01-04rename find_parent_node to opt_parent_idMichael Goulet-2/+2
2023-01-04rename get_parent_node to parent_idMichael Goulet-13/+13
2023-01-02Auto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkovbors-1/+1
Encode spans relative to the enclosing item -- enable on nightly Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default. This PR seeks to remove one of the main shortcomings of incremental: the handling of spans. Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed. Within one file: all the spans in HIR change, so typechecking had to be re-done. Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span). The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query. Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent. In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode: - the parent when the `SyntaxContext` is 0; - the `SyntaxContext` when the parent is `None`. Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans. The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required. Possible future directions: - validate that all spans are marked in HIR validation; - mark macro-expanded spans relative to the def-site and not the use-site.
2022-12-25Only enable relative span hashing on nightly.Camille GILLOT-1/+1
2022-12-25Enable relative span hashing.Camille GILLOT-1/+1
2022-12-25fix more clippy::style findingsMatthias Krüger-6/+4
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-2/+2
rustc: Remove needless lifetimes
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-20Some track_caller additionsOli Scherer-0/+8
2022-12-20Some hir cleanupsOli Scherer-2/+2
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-2/+2
2022-12-03Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillotMatthias Krüger-1/+1
Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-1/+1
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-1/+1
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-4/+4
2022-11-13Do not use `local_def_id` in `node_to_string`.Camille GILLOT-30/+24
2022-11-13Store a LocalDefId in hir::AnonConst.Camille GILLOT-1/+1
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-2/+2
2022-11-13Store LocalDefId in hir::Closure.Camille GILLOT-2/+2
2022-11-11Tweak signatures in rustc_middle::hir::map.Camille GILLOT-2/+9
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-8/+8
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2