| Age | Commit message (Collapse) | Author | Lines |
|
Optimize position adjustments
A small improvement.
r? `@bjorn3`
|
|
`imported_source_files` adjusts lots of file positions, and then calls
`new_imported_source_file`, which then adjust them all again. This
commit combines the two adjustments into one, for a small perf win.
|
|
rustc: Fix ICE in native library error reporting
Fixes https://github.com/rust-lang/rust/issues/97299
|
|
Fix metadata stats.
This commit:
- Counts some things that weren't being counted previously, and adds
an assertion that ensure everything is counted.
- Reorders things so the `eprintln`s order matches the code order.
- Adds percentages, and makes clear that the zero bytes count is orthogonal to
the other measurements.
Example of the new output:
```
55463779 metadata bytes, of which 18054531 bytes (32.6%) are zero
preamble: 30 bytes ( 0.0%)
dep: 0 bytes ( 0.0%)
lib feature: 17458 bytes ( 0.0%)
lang item: 337 bytes ( 0.0%)
diagnostic item: 1788 bytes ( 0.0%)
native lib: 0 bytes ( 0.0%)
foreign modules: 5113 bytes ( 0.0%)
def-path table: 720180 bytes ( 1.3%)
traits: 359 bytes ( 0.0%)
impls: 64624 bytes ( 0.1%)
incoherent_impls: 130 bytes ( 0.0%)
mir: 16137354 bytes (29.1%)
item: 23773099 bytes (42.9%)
interpret_alloc_index: 599 bytes ( 0.0%)
proc-macro-data: 0 bytes ( 0.0%)
tables: 10081135 bytes (18.2%)
debugger visualizers: 0 bytes ( 0.0%)
exported symbols: 5666 bytes ( 0.0%)
hygiene: 1539390 bytes ( 2.8%)
def-path hashes: 2752564 bytes ( 5.0%)
source_map: 363540 bytes ( 0.7%)
final: 413 bytes ( 0.0%)
```
r? `@bjorn3`
|
|
This commit:
- Counts some things that weren't being counted previously, and adds
an assertion that ensure everything is counted.
- Reorders things so the `eprintln`s order matches the code order.
- Adds percentages, and makes clear that the zero bytes count is orthogonal to
the other measurements.
Example of the new output:
```
55463779 metadata bytes, of which 18054531 bytes (32.6%) are zero
preamble: 30 bytes ( 0.0%)
dep: 0 bytes ( 0.0%)
lib feature: 17458 bytes ( 0.0%)
lang item: 337 bytes ( 0.0%)
diagnostic item: 1788 bytes ( 0.0%)
native lib: 0 bytes ( 0.0%)
foreign modules: 5113 bytes ( 0.0%)
def-path table: 720180 bytes ( 1.3%)
traits: 359 bytes ( 0.0%)
impls: 64624 bytes ( 0.1%)
incoherent_impls: 130 bytes ( 0.0%)
mir: 16137354 bytes (29.1%)
item: 23773099 bytes (42.9%)
interpret_alloc_index: 599 bytes ( 0.0%)
proc-macro-data: 0 bytes ( 0.0%)
tables: 10081135 bytes (18.2%)
debugger visualizers: 0 bytes ( 0.0%)
exported symbols: 5666 bytes ( 0.0%)
hygiene: 1539390 bytes ( 2.8%)
def-path hashes: 2752564 bytes ( 5.0%)
source_map: 363540 bytes ( 0.7%)
final: 413 bytes ( 0.0%)
```
|
|
|
|
|
|
|
|
|
|
|
|
Remove `crate` visibility modifier
FCP to remove this syntax is just about complete in #53120. Once it completes, this should be merged ASAP to avoid merge conflicts.
The first two commits remove usage of the feature in this repository, while the last removes the feature itself.
|
|
|
|
Cache more queries on disk
One of the principles of incremental compilation is to allow saving results on disk to avoid recomputing them.
This PR investigates persisting a lot of queries whose result are to be saved into metadata.
Some of the queries are cheap reads from HIR, but we may also want to get rid of these reads for incremental lowering.
|
|
`simplify_type` improvements and cursed docs
the existing `TreatParams` enum pretty much mixes everything up. Not sure why this looked right to me in #94057
This also includes two changes which impact perf:
- `ty::Projection` with inference vars shouldn't be treated as a rigid type, even if fully normalized
- `ty::Placeholder` only unifies with itself, so actually return `Some` for them
r? `@nikomatsakis`
|
|
|
|
|
|
|
|
Add a query for checking whether a function is an intrinsic.
work towards #93145
This will reduce churn when we add more ways to declare intrinsics
r? `@scottmcm`
|
|
Retire `ItemLikeVisitor` trait
Issue #95004
cc `@cjgillot`
|
|
|
|
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
embedding debugger visualizers into a generated PDB.
Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries.
Merge the queries for debugger visualizers into a single query.
Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`.
Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate.
Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature.
Respond to PR comments and minor cleanups.
|
|
|
|
Since Cargo wants to do its own fatal error handling for unused
dependencies, add the option `--json unused-externs-silent` which
has the original behaviour of not indicating non-zero exit status for
`deny`/`forbid`-level unused dependencies.
|
|
|
|
Generate synthetic object file to ensure all exported and used symbols participate in the linking
Fix #50007 and #47384
This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed.
Related #93791, #95363
r? `@petrochenkov`
cc `@carbotaniuman`
|
|
This adds `nounused` to the set of extern flags:
`--extern nounused:core=/path/to/core/libcore.rlib`.
The effect of this flag is to suppress `unused-crate-dependencies`
warnings relating to the crate.
|
|
|
|
its attributes
This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily
|
|
Stop using CRATE_DEF_INDEX outside of metadata encoding.
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want. We should not manipulate raw `DefIndex` outside of metadata encoding.
|
|
Remove `--extern-location` and all associated code
`--extern-location` was an experiment to investigate the best way to
generate useful diagnostics for unused dependency warnings by enabling a
build system to identify the corresponding build config.
While I did successfully use this, I've since been convinced the
alternative `--json unused-externs` mechanism is the way to go, and
there's no point in having two mechanisms with basically the same
functionality.
This effectively reverts https://github.com/rust-lang/rust/pull/72603
|
|
oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco
Improved diagnostic on failure to meet send bound on future in a foreign crate
Provide a better diagnostic on failure to meet send bound on futures in a foreign crate.
fixes #78543
|
|
This is currently a wrapper to `SymbolExportLevel` but it allows
later addition of extra information.
|
|
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
|
|
Refactor HIR item-like traversal (part 1)
Issue #95004
- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel;
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
cc `@cjgillot`
|
|
rustc_metadata: Do not encode unnecessary module children
This should remove the syntax context shift and the special case for `ExternCrate` in decoder in https://github.com/rust-lang/rust/pull/95880.
This PR also shifts some work from decoding to encoding, which is typically useful for performance (but probably not much in this case).
r? `@cjgillot`
|
|
foreign crate
Adding diagnostic data on generators to the crate metadata and using it to provide
a better diagnostic on failure to meet send bound on futures originated from a foreign crate
|
|
`--extern-location` was an experiment to investigate the best way to
generate useful diagnostics for unused dependency warnings by enabling a
build system to identify the corresponding build config.
While I did successfully use this, I've since been convinced the
alternative `--json unused-externs` mechanism is the way to go, and
there's no point in having two mechanisms with basically the same
functionality.
This effectively reverts https://github.com/rust-lang/rust/pull/72603
|
|
|
|
|