about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
AgeCommit message (Collapse)AuthorLines
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.
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-11/+16
2022-10-10Move lifetime resolution module to rustc_hir_analysis.Camille GILLOT-1/+0
2022-10-06Remove `-Ztime` option.Nicholas Nethercote-1/+0
The compiler currently has `-Ztime` and `-Ztime-passes`. I've used `-Ztime-passes` for years but only recently learned about `-Ztime`. What's the difference? Let's look at the `-Zhelp` output: ``` -Z time=val -- measure time of rustc processes (default: no) -Z time-passes=val -- measure time of each rustc pass (default: no) ``` The `-Ztime-passes` description is clear, but the `-Ztime` one is less so. Sounds like it measures the time for the entire process? No. The real difference is that `-Ztime-passes` prints out info about passes, and `-Ztime` does the same, but only for a subset of those passes. More specifically, there is a distinction in the profiling code between a "verbose generic activity" and an "extra verbose generic activity". `-Ztime-passes` prints both kinds, while `-Ztime` only prints the first one. (It took me a close reading of the source code to determine this difference.) In practice this distinction has low value. Perhaps in the past the "extra verbose" output was more voluminous, but now that we only print stats for a pass if it exceeds 5ms or alters the RSS, `-Ztime-passes` is less spammy. Also, a lot of the "extra verbose" cases are for individual lint passes, and you need to also use `-Zno-interleave-lints` to see those anyway. Therefore, this commit removes `-Ztime` and the associated machinery. One thing to note is that the existing "extra verbose" activities all have an extra string argument, so the commit adds the ability to accept an extra argument to the "verbose" activities.
2022-09-30Fix typonils-1/+1
2022-09-30Update compiler/rustc_interface/src/queries.rsCamille Gillot-1/+1
2022-09-30Add comment explaining why we flush delayed bugs before codegennils-0/+2
2022-09-27Flush delayed bugs before codegenNilstrieb-0/+2
Sometimes it can happen that invalid code like a TyKind::Error makes its way through the compiler without triggering any errors (this is always a bug in rustc but bugs do happen sometimes :)). These ICEs will manifest in the backend like as cg_llvm not being able to get the layout of `[type error]`, which makes it hard to debug. By flushing before codegen, we display all the delayed bugs, making it easier to trace it to the root of the problem.
2022-09-27rustc_typeck to rustc_hir_analysislcnr-3/+2
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-25Rollup merge of #101997 - cuviper:drop-legacy-pm, r=nikicfee1-dead-1/+0
Remove support for legacy PM This removes support for optimizing with LLVM's legacy pass manager, as well as the unstable `-Znew-llvm-pass-manager` option. We have been defaulting to the new PM since LLVM 13 (except for s390x that waited for 14), and LLVM 15 removed support altogether. The only place we still use the legacy PM is for writing the output file, just like `llc` does. cc #74705 r? ``@nikic``
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-3/+2
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-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-15/+15
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-15/+15
2022-09-18Remove -Znew-llvm-pass-managerJosh Stone-1/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-12change rlib format to discern native dependenciesDaniil Belov-0/+1
2022-09-07Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoeristerbors-3/+14
Track PGO profiles in depinfo This PR makes sure that PGO profiles (`-Cprofile-use` and `-Cprofile-sample-use`) are tracked in depinfo, so that when they change, the compilation session will be invalidated. This approach was discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Tracking.20PGO.20profile.20files.20in.20cargo). I tried it locally and it seems that the code is recompiled just with this change, and https://github.com/rust-lang/rust/pull/100413 is not even needed. But it's possible that not everything required is recompiled, so we will probably want to land both changes. Another approach to implement this could be to store the PGO profiles in `sess.parse_sess.file_depinfo` when the session is being created, but then the paths would have to be converted to a string and then to a symbol, which seemed unnecessarily complicated. CC `@michaelwoerister` r? `@Eh2406`
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-2/+2
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-02Rollup merge of #100552 - petrochenkov:flavorcompat, r=lqdGuillaume Gomez-5/+3
rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (https://github.com/rust-lang/rust/pull/96827). This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.) The second commit does some light refactoring of internal linker flavors (applies changes from https://github.com/petrochenkov/rust/commit/53eca42973b7e379b9fa0469c33f08680b57c35f that don't require mass-editing target specs).
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-6/+8
by module
2022-09-01rustc_target: Refactor internal linker flavors slightlyVadim Petrochenkov-5/+3
Remove one unstable user-facing linker flavor (l4-bender)
2022-08-31Fix a bunch of typoDezhi Wu-2/+2
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-29Track PGO profiles in depinfoJakub Beránek-3/+14