about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
AgeCommit message (Collapse)AuthorLines
2023-01-12Feed `crate_name` queryOli Scherer-1/+2
2023-01-12Feed `resolutions` query instead of it being a thin wrapper around an ↵Oli Scherer-3/+3
untracked field
2023-01-12Harden the pre-tyctxt query system against accidental recomputationOli Scherer-48/+60
2023-01-12Add log-backtrace option to show backtraces along with loggingYuki Omoto-0/+1
2023-01-10Change type of box_noalias to boolTomasz Miąsko-1/+1
2023-01-10Change type of mutable_noalias to boolTomasz Miąsko-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-14/+11
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04Split `-Zchalk` flag into `-Ztrait-solver=(stock|chalk|next)` flagMichael Goulet-1/+2
2023-01-04Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqdMatthias Krüger-5/+7
Add JSON output to -Zdump-mono-stats Follow-up to https://github.com/rust-lang/rust/pull/105481 r? `@lqd` cc `@wesleywiser`
2023-01-02Add json output to `-Zdump-mono-stats`Joshua Nelson-5/+7
This allows analyzing the output programatically; for example, finding the item with the highest `total_estimate`. I also took the liberty of adding `untracked` tests to `rustc_session` and documentation to the unstable book for `dump-mono-items`.
2022-12-25Ignore span references from diagnostics.Camille GILLOT-2/+11
The diagnostics are replayed at the correct place anyway.
2022-12-25Mark incremental-ignore-spans as TRACKED.Camille GILLOT-1/+1
Using that options basically changes all stable hashes we may compute. Adding/removing as UNTRACKED it makes everything ICE (unstable fingerprint everywhere). As TRACKED, it can still do its job without ICEing.
2022-12-21Auto merge of #105812 - ojeda:no-jump-tables, r=nikicbors-0/+1
Add `-Zno-jump-tables` This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
2022-12-20Add `-Zno-jump-tables`Miguel Ojeda-0/+1
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-18don't clone Copy typesMatthias Krüger-1/+1
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-2/+0
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-0/+2
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-29/+32
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-29/+32
2022-12-06Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillotMatthias Krüger-0/+1
Add -Z maximal-hir-to-mir-coverage flag This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible. A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything. r? `@cjgillot` cc `@gavinleroy`
2022-12-06Auto merge of #105220 - oli-obk:feeding, r=cjgillotbors-12/+25
feed resolver_for_lowering instead of storing it in a field r? `@cjgillot` opening this as * a discussion for `no_hash` + `feedable` queries. I think we'll want those, but I don't quite understand why they are rejected beyond a double check of the stable hashes for situations where the query is fed but also read from incremental caches. * and a discussion on removing all untracked fields from TyCtxt and setting it up so that they are fed queries instead
2022-12-05feed resolver_for_lowering instead of storing it in a fieldOli Scherer-2/+15
2022-12-04Add -Z maximal-hir-to-mir-coverage flagWill Crichton-0/+1
2022-12-03Remove all but one call site of `prepare_outputs` and fetch the value from ↵Oli Scherer-10/+10
the TyCtxt instead
2022-12-02Remove `-Zno-interleave-lints`.Nicholas Nethercote-5/+1
Because it complicates lint implementation greatly.
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-1/+1
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-11/+4
2022-11-09Fix `rustdoc --version` when used with download-rustcJoshua Nelson-16/+7
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source. Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
2022-11-05Simplify codeNilstrieb-10/+5
2022-11-05Rollup merge of #103660 - ozkanonur:master, r=jyn514Dylan DPC-95/+2
improve `filesearch::get_or_default_sysroot` `fn get_or_default_sysroot` is now improved and used in `miri` and `clippy`, and tests are still passing as they should. So we no longer need to implement custom workarounds/hacks to find sysroot in tools like miri/clippy. Resolves https://github.com/rust-lang/rust/issues/98832 re-opened from #103581
2022-11-04improve `filesearch::get_or_default_sysroot` r=ozkanonurOnur Özkan-95/+2
Signed-off-by: Onur Özkan <work@onurozkan.dev>
2022-11-01Auto merge of #103217 - mejrs:track, r=eholkbors-0/+1
Track where diagnostics were created. This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`. For example, the following code... ```rust struct A; struct B; fn main(){ let _: A = B; } ``` ...now emits the following error message: ``` error[E0308]: mismatched types --> src\main.rs:5:16 | 5 | let _: A = B; | - ^ expected struct `A`, found struct `B` | | | expected due to this -Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31 ```
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-1/+1
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-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-1/+1
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-26fix tracking hash testmejrs-1/+1
2022-10-25rustc_middle: Rearrange resolver outputs structures slightlyVadim Petrochenkov-11/+3
2022-10-24Address some commentsmejrs-0/+1
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-0/+1
2022-10-23Migrate all diagnosticsNilstrieb-14/+14
2022-10-21Auto merge of #103310 - lcnr:rustc_hir_typeck, r=compiler-errorsbors-0/+1
move hir typeck into separate crate second part https://github.com/rust-lang/compiler-team/issues/529 I avoided pretty much anything that wasn't just a simple move + path adjustment. Left fixmes for methods which are at an odd place r? `@compiler-errors`
2022-10-20rustc_hir_typeck: fix paths and partially mv fileslcnr-0/+1
2022-10-19Add a comment to `Compiler`.Nicholas Nethercote-1/+4
It took me a while to work this out.
2022-10-19Clarify `run_in_thread_pool_with_globals`.Nicholas Nethercote-44/+45
- Make the structure of the two variants more similar. - Add some comments. - Move various conditional `use` items inside the function that uses them. - Inline some closures.
2022-10-19Replace a `spawn_unchecked` with `spawn_scoped`.Nicholas Nethercote-12/+16
2022-10-19Apply `Lrc` later to `sess` and `codegen_backend`.Nicholas Nethercote-10/+5
This avoids the need for a degenerate `Lrc::get_mut` call.
2022-10-19Inline and remove `create_compiler_and_run`.Nicholas Nethercote-53/+51
It has a single call site.
2022-10-19Reduce visibility of some functions.Nicholas Nethercote-3/+3
2022-10-19Inline and remove `scoped_thread`.Nicholas Nethercote-15/+9
It has a single call site, and removing it slightly improves the confusing tangle of nested closures present at startup.
2022-10-18Remove `RunCompiler::emitter`.Nicholas Nethercote-17/+4
It's no longer used.