about summary refs log tree commit diff
path: root/compiler/rustc_session/src/search_paths.rs
AgeCommit message (Collapse)AuthorLines
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-6/+5
2025-02-08Rustfmtbjorn3-4/+4
2024-11-15rustc_metadata: Preprocess search paths for better performancePiotr Osiewicz-9/+50
Over in Zed we've noticed that loading crates for a large-ish workspace can take almost 200ms. We've pinned it down to how rustc searches for paths, as it performs a linear search over the list of candidate paths. In our case the candidate list had about 20k entries which we had to iterate over for each dependency being loaded. This commit introduces a simple FilesIndex that's just a sorted Vec under the hood. Since crates are looked up by both prefix and suffix, we perform a range search on said Vec (which constraints the search space based on prefix) and follow up with a linear scan of entries with matching suffixes. FilesIndex is also pre-filtered before any queries are performed using available target information; query prefixes/sufixes are based on the target we are compiling for, so we can remove entries that can never match up front. Overall, this commit brings down build time for us in dev scenarios by about 6%. 100ms might not seem like much, but this is a constant cost that each of our workspace crates has to pay, even when said crate is miniscule.
2024-11-02Rename target triple to target tuple in many places in the compilerNoratrieb-3/+3
This changes the naming to the new naming, used by `--print target-tuple`. It does not change all locations, but many.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-11Make SearchPath::new publicVetle Rasmussen-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-0/+1
2024-04-23Mark @RUSTC_BUILTIN search path usage as unstableLukas Wirth-0/+9
2024-03-25Replace implementation with @RUSTC_BUILTIN prefix substitution varLukas Wirth-14/+7
2024-03-25Make sysroot mandatory for rustdocLukas Wirth-12/+3
2024-03-25Implement `-L builtin:$path`Lukas Wirth-1/+28
2024-03-06Rewrite the `untranslatable_diagnostic` lint.Nicholas Nethercote-0/+1
Currently it only checks calls to functions marked with `#[rustc_lint_diagnostics]`. This commit changes it to check calls to any function with an `impl Into<{D,Subd}iagMessage>` parameter. This greatly improves its coverage and doesn't rely on people remembering to add `#[rustc_lint_diagnostics]`. The commit also adds `#[allow(rustc::untranslatable_diagnostic)`] attributes to places that need it that are caught by the improved lint. These places that might be easy to convert to translatable diagnostics. Finally, it also: - Expands and corrects some comments. - Does some minor formatting improvements. - Adds missing `DecorateLint` cases to `tests/ui-fulldeps/internal-lints/diagnostics.rs`.
2023-12-23Rename `EarlyDiagCtxt` methods to match `DiagCtxt`.Nicholas Nethercote-1/+1
- `early_error_no_abort` -> `early_err` - `early_error` -> `early_fatal` - `early_struct_error` -> `early_struct_fatal`
2023-12-18Rename many `EarlyDiagCtxt` arguments.Nicholas Nethercote-2/+2
2023-12-18Rename `EarlyErrorHandler` as `EarlyDiagCtxt`.Nicholas Nethercote-2/+2
2023-06-27Provide more context for `rustc +nightly -Zunstable-options` on stable许杰友 Jieyou Xu (Joe)-3/+3
2022-04-19incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.Michael Woerister-3/+1
2022-02-02Make `SearchPathFile::file_name_str` non-optional.Nicholas Nethercote-13/+13
Currently, it can be `None` if the conversion from `OsString` fails, in which case all searches will skip over the `SearchPathFile`. The commit changes things so that the `SearchPathFile` just doesn't get created in the first place. Same behaviour, but slightly simpler code.
2021-09-08Doc commentsbjorn3-11/+11
2020-09-17use strip_prefix over starts_with and manual slicing based on pattern length ↵Matthias Krüger-10/+10
(clippy::manual_strip)
2020-08-30mv compiler to compiler/mark-0/+95