about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src/ich
AgeCommit message (Collapse)AuthorLines
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-3/+2
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-15Add hir::AttributeJonathan Dönszelmann-18/+10
2024-10-25Introduce `Enabled{Lang,Lib}Feature`许杰友 Jieyou Xu (Joe)-0/+17
Instead of passing around random n-tuples of e.g. `(gate_name, attr_sp, since)`.
2024-10-23stop hashing compile-time constantRalf Jung-6/+1
2024-10-23rename lang feature lists to include LANGRalf Jung-1/+1
2024-10-23remove no longer needd UnstableFeature typeRalf Jung-1/+1
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-1/+1
2024-10-22make some rustc_feature internals private, and ensure invariants with debug ↵Ralf Jung-2/+2
assertions
2024-10-22terminology: #[feature] *enables* a feature (instead of "declaring" or ↵Ralf Jung-3/+3
"activating" it)
2024-10-01add unstable support for outputting file checksums for use in cargoJacob Kiesel-0/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-18Be more accurate about calculating `display_col` from a `BytePos`Esteban Küber-6/+0
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter. This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2): ``` error: this file contains an unclosed delimiter --> $DIR/issue-68629.rs:5:17 | LL | ␜␟ts␀![{i | -- unclosed delimiter | | | unclosed delimiter LL | ␀␀ fn rݻoa>rݻm | ^ ```
2024-01-16Simplify BodyId hashing.Camille GILLOT-58/+2
2023-12-19Unify SourceFile::name_hash and StableSourceFileIdMichael Woerister-3/+3
2023-11-26Cut code size for feature hashingMark Rousskov-4/+4
This locally cuts ~32 kB of .text instructions.
2023-11-21Add HashStable_NoContext to simplify HashStable implementations in rustc_type_irMichael Goulet-2/+0
2023-11-16Reduce exposure of things.Nicholas Nethercote-1/+1
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-4/+5
2023-09-03Use relative positions inside a SourceFile.Camille GILLOT-33/+7
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-2/+2
2023-04-16Remove some unnecessary hash truncationsBen Kimock-1/+1
2023-02-21Use a lock-free datastructure for `source_span`Oli Scherer-1/+1
2023-02-20Make untracked.source_span lockable so that resolution can still write to it ↵Oli Scherer-1/+1
when using TyCtxt
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-1/+1
using TyCtxt
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-5/+3
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-14/+6
2022-11-11Hash spans when interning.Camille GILLOT-37/+2
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-2/+2
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-2/+5
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-07Use HashStable_Generic in rustc_type_irEric Holk-0/+2
A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate. This doesn't update all the types, because some would require `I: Interner + HashStable`.
2022-08-16Auto merge of #100441 - nnethercote:shrink-ast-Attribute, r=petrochenkovbors-3/+3
Shrink `ast::Attribute`. r? `@ghost`
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-3/+3
2022-08-07Remove unused hashing infra.Camille GILLOT-22/+7
2022-08-07Derive HashStable for HIR Expr and Ty.Camille GILLOT-14/+0
2022-08-07Stop forcing the hashing of bodies in types and expressions.Camille GILLOT-14/+8
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-4/+4
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-06Make AST lowering a query.Camille GILLOT-6/+6
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-0/+1
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-2/+9
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-2/+9
2022-06-14Remove thread-local `IGNORED_ATTRIBUTES`.Nicholas Nethercote-10/+1
It's just a copy of the read-only global `ich::IGNORED_ATTRIBUTES`, and can be removed without any effect.
2022-06-02Address review comments.Nicholas Nethercote-14/+11
2022-06-01Lazify `SourceFile::lines`.Nicholas Nethercote-5/+12
`SourceFile::lines` is a big part of metadata. It's stored in a compressed form (a difference list) to save disk space. Decoding it is a big fraction of compile time for very small crates/programs. This commit introduces a new type `SourceFileLines` which has a `Lines` form and a `Diffs` form. The latter is used when the metadata is first read, and it is only decoded into the `Lines` form when line data is actually needed. This avoids the decoding cost for many files, especially in `std`. It's a performance win of up to 15% for tiny crates/programs where metadata decoding is a high part of compilation costs. A `Lock` is needed because the methods that access lines data (which can trigger decoding) take `&self` rather than `&mut self`. To allow for this, `SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather than returning the lines slice.
2022-04-12Remove NodeIdHashingMode.Camille GILLOT-107/+8
2022-03-31Move stable hash from TyS into a datastructure that can be shared with other ↵Oli Scherer-0/+8
interned types.
2022-01-05Address review commentsAaron Hill-3/+6
2022-01-05Adjust assert_default_hashing_controlsAaron Hill-0/+7
2022-01-05Ensure that `Fingerprint` caching respects hashing configurationAaron Hill-23/+28
Fixes #92266 In some `HashStable` impls, we use a cache to avoid re-computing the same `Fingerprint` from the same structure (e.g. an `AdtDef`). However, the `StableHashingContext` used can be configured to perform hashing in different ways (e.g. skipping `Span`s). This configuration information is not included in the cache key, which will cause an incorrect `Fingerprint` to be used if we hash the same structure with different `StableHashingContext` settings. To fix this, the configuration settings of `StableHashingContext` are split out into a separate `HashingControls` struct. This struct is used as part of the cache key, ensuring that our caches always produce the correct result for the given settings. With this in place, we now turn off `Span` hashing during the entire process of computing the hash included in legacy symbols. This current has no effect, but will matter when a future PR starts hashing more `Span`s that we currently skip.
2021-12-24Remove special-cased stable hashing for HIR moduleAaron Hill-24/+1
All other 'containers' (e.g. `impl` blocks) hashed their contents in the normal, order-dependent way. However, `Mod` was hashing its contents in a (sort-of) order-independent way. However, the exact order is exposed to consumers through `Mod.item_ids`, and through query results like `hir_module_items`. Therefore, stable hashing needs to take the order of items into account, to avoid fingerprint ICEs. Unforuntately, I was unable to directly build a reproducer for the ICE, due to the behavior of `Fingerprint::combine_commutative`. This operation swaps the upper and lower `u64` when constructing the result, which makes the function non-associative. Since we start the hashing of module items by combining `Fingerprint::ZERO` with the first item, it's difficult to actually build an example where changing the order of module items leaves the final hash unchanged. However, this appears to have been hit in practice in #92218 While we're not able to reproduce it, the fact that proc-macros are involved (which can give an entire module the same span, preventing any span-related invalidations) makes me confident that the root cause of that issue is our method of hashing module items. This PR removes all of the special handling for `Mod`, instead deriving a `HashStable` implementation. This makes `Mod` consistent with other 'contains' like `Impl`, which hash their contents through the typical derive of `HashStable`.