about summary refs log tree commit diff
path: root/compiler/rustc_incremental
AgeCommit message (Collapse)AuthorLines
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-1/+1
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-10remove redundant importssurechen-1/+0
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-02Rename `HandlerInner::delayed_span_bugs` as `HandlerInner::span_delayed_bugs`.Nicholas Nethercote-3/+3
For reasons similar to the previous commit.
2023-12-01Remove unused field from `IncrCompSession`.Nicholas Nethercote-2/+2
2023-11-26Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkinbors-5/+2
Call FileEncoder::finish in rmeta encoding Fixes https://github.com/rust-lang/rust/issues/117254 The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out. I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths. I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing. r? `@WaffleLapkin`
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-1/+1
cleanup
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-3/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-22Call FileEncoder::finish in rmeta encodingBen Kimock-5/+2
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-13/+13
`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-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-04Remove unused LoadResult::DecodeIncrCache variantbjorn3-18/+1
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-3/+3
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
2023-10-26Reduce some function exposure.Nicholas Nethercote-5/+8
2023-10-26Tiny comment fixes.Nicholas Nethercote-3/+4
2023-10-26Move a `use` to a more sensible spot.Nicholas Nethercote-2/+2
I.e. in the source file where it's used.
2023-10-26Reduce exposure of three functions used only within `rustc_incremental`.Nicholas Nethercote-9/+3
2023-10-26Remove unused `never_type` feature.Nicholas Nethercote-1/+0
2023-10-13Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillotbors-236/+0
Remove cgu_reuse_tracker from Session This removes a bit of global mutable state. It will now miss post-lto cgu reuse when ThinLTO determines that a cgu doesn't get changed, but there weren't any tests for this anyway and a test for it would be fragile to the exact implementation of ThinLTO in LLVM.
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-236/+0
This removes a bit of global mutable state
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-09-24Don't use a thread to load the dep graphJohn Kåre Alsaker-74/+65
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-4/+4
2023-09-08Avoid a `source_span` query when encoding Spans into query resultsJohn Kåre Alsaker-12/+14
2023-08-18Ignore unexpected incr-comp session dirsMartin Nordholts-3/+7
Clearly the code path can be hit without the presence of a compiler bug. All it takes is mischief. See 71698. Ignore problematic directories instead of ICE:ing. `continue`ing is already done for problematic dirs in the code block above us.
2023-08-18More error details upon unexpected incr-comp session dirMartin Nordholts-7/+7
2023-08-13Pass WorkProductMap to build_dep_graph instead of FxIndexMapbjorn3-6/+6
Constructing an FxIndexMap is useless work as the iteration order never matters.
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-11/+9
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-7/+7
2023-06-11Applied nitsAndrew Xie-12/+9
2023-06-08Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few ↵Andrew Xie-30/+15
misc issues, added collect to UnordItems
2023-06-05Fixed to_sorted => to_sorted_stable_ordAndrew Xie-37/+49
2023-06-04Fixed unord mistakeAndrew Xie-21/+23
2023-06-04Fixed failing test + minor cleanupAndrew Xie-17/+13
2023-06-04Sorted a FxIndexSet for consistent iteration orderAndrew Xie-0/+1
2023-06-04Switched some uses to UnordMapAndrew Xie-134/+139
2023-06-04Removed use of iteration through a HashMap/HashSet in rustc_incremental and ↵Andrew Xie-35/+34
replaced with IndexMap/IndexSet
2023-05-25Ensure Fluent messages are in alphabetical orderclubby789-70/+70
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-33/+36
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-04Rollup merge of #111024 - saethlin:stringify-full-svh, r=oli-obkMatthias Krüger-1/+1
Use the full Fingerprint when stringifying Svh Finally circling back, per https://github.com/rust-lang/rust/pull/110367#discussion_r1168340739 r? `@oli-obk`
2023-04-30Use the full Fingerprint when stringifying SvhBen Kimock-1/+1
2023-04-26Remove QueryEngine traitJohn Kåre Alsaker-5/+7
2023-04-19Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwcobors-1/+2
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillotbors-1/+1
Encode hashes as bytes, not varint In a few places, we store hashes as `u64` or `u128` and then apply `derive(Decodable, Encodable)` to the enclosing struct/enum. It is more efficient to encode hashes directly than try to apply some varint encoding. This PR adds two new types `Hash64` and `Hash128` which are produced by `StableHasher` and replace every use of storing a `u64` or `u128` that represents a hash. Distribution of the byte lengths of leb128 encodings, from `x build --stage 2` with `incremental = true` Before: ``` ( 1) 373418203 (53.7%, 53.7%): 1 ( 2) 196240113 (28.2%, 81.9%): 3 ( 3) 108157958 (15.6%, 97.5%): 2 ( 4) 17213120 ( 2.5%, 99.9%): 4 ( 5) 223614 ( 0.0%,100.0%): 9 ( 6) 216262 ( 0.0%,100.0%): 10 ( 7) 15447 ( 0.0%,100.0%): 5 ( 8) 3633 ( 0.0%,100.0%): 19 ( 9) 3030 ( 0.0%,100.0%): 8 ( 10) 1167 ( 0.0%,100.0%): 18 ( 11) 1032 ( 0.0%,100.0%): 7 ( 12) 1003 ( 0.0%,100.0%): 6 ( 13) 10 ( 0.0%,100.0%): 16 ( 14) 10 ( 0.0%,100.0%): 17 ( 15) 5 ( 0.0%,100.0%): 12 ( 16) 4 ( 0.0%,100.0%): 14 ``` After: ``` ( 1) 372939136 (53.7%, 53.7%): 1 ( 2) 196240140 (28.3%, 82.0%): 3 ( 3) 108014969 (15.6%, 97.5%): 2 ( 4) 17192375 ( 2.5%,100.0%): 4 ( 5) 435 ( 0.0%,100.0%): 5 ( 6) 83 ( 0.0%,100.0%): 18 ( 7) 79 ( 0.0%,100.0%): 10 ( 8) 50 ( 0.0%,100.0%): 9 ( 9) 6 ( 0.0%,100.0%): 19 ``` The remaining 9 or 10 and 18 or 19 are `u64` and `u128` respectively that have the high bits set. As far as I can tell these are coming primarily from `SwitchTargets`.
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+2
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-1/+1
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-03-29Check for escape sequences in Fluent resourcesclubby789-1/+1
2023-03-23Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholkMatthias Krüger-4/+4
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize` This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.