about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
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-25rustc_middle: Rearrange resolver outputs structures slightlyVadim Petrochenkov-11/+3
2022-10-20rustc_hir_typeck: fix paths and partially mv fileslcnr-0/+1
2022-10-10Move lifetime resolution module to rustc_hir_analysis.Camille GILLOT-1/+0
2022-09-27rustc_typeck to rustc_hir_analysislcnr-3/+2
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-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-3/+2
by module
2022-08-29Track PGO profiles in depinfoJakub Beránek-3/+14
2022-08-29Add prefix to every line of `-Zhir-stats` output.Nicholas Nethercote-2/+2
This is based on `-Zprint-type-sizes` which does the same thing. It makes the output provenance clearer, and helps with post-processing. E.g. if you have `-Zhir-stats` output from numerous compiler invocations you can now easily extract the pre-expansion stats separately from the post-expansion stats.
2022-08-25Rollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, ↵Yuki Okushi-51/+20
r=davidtwco Migrate `rustc_interface` diagnostics ``@rustbot`` label +A-translation r? rust-lang/diagnostics cc #100717
2022-08-23Use par_body_owners for livenessSeo Sanghyeon-3/+3
2022-08-22Remove use of DiagnosticArgFromDisplayGiacomo Stevanato-14/+8
2022-08-22Move rustc_interface diagnostics to struct SessionDiagnostic derivesGiacomo Stevanato-31/+23
2022-08-22Move existing diagnostic struct to a new errors moduleGiacomo Stevanato-19/+2
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-2/+2
2022-08-17Migrate emoji identifier diagnostics to `SessionDiagnostic`finalchild-18/+22
2022-07-27session: disable internal lints for rustdocDavid Wood-1/+1
If an internal lint uses `typeck_results` or similar queries then that can result in rustdoc checking code that it shouldn't (e.g. from other platforms) and emit compilation errors. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-14Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillotbors-70/+4
Stop keeping metadata in memory before writing it to disk Fixes #96358 I created this PR according with the instruction given in the issue except for the following points: - While the issue says "Write metadata into the temporary file in `encode_and_write_metadata` even if `!need_metadata_file`", I could not do that. That is because though I tried to do that and run `x.py test`, I got a lot of test failures as follows. <details> <summary>List of failed tests</summary> <pre> <code> failures: [ui] src/test/ui/json-multiple.rs [ui] src/test/ui/json-options.rs [ui] src/test/ui/rmeta/rmeta-rpass.rs [ui] src/test/ui/save-analysis/emit-notifications.rs [ui] src/test/ui/svh/changing-crates.rs [ui] src/test/ui/svh/svh-change-lit.rs [ui] src/test/ui/svh/svh-change-significant-cfg.rs [ui] src/test/ui/svh/svh-change-trait-bound.rs [ui] src/test/ui/svh/svh-change-type-arg.rs [ui] src/test/ui/svh/svh-change-type-ret.rs [ui] src/test/ui/svh/svh-change-type-static.rs [ui] src/test/ui/svh/svh-use-trait.rs test result: FAILED. 12915 passed; 12 failed; 100 ignored; 0 measured; 0 filtered out; finished in 71.41s Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu Build completed unsuccessfully in 0:01:58 </code> </pre> </details> - I could not resolve the extra tasks about `create_rmeta_file` and `create_compressed_metadata_file` for my lack of ability.
2022-07-14Rollup merge of #98580 - PrestonFrom:issue_98466, r=estebankDylan DPC-2/+5
Emit warning when named arguments are used positionally in format Addresses Issue 98466 by emitting an error if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-13/+13
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13Emit warning when named arguments are used positionally in formatPreston From-2/+5
Addresses Issue 98466 by emitting a warning if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-06Make AST lowering a query.Camille GILLOT-47/+6
2022-07-02Auto merge of #97235 - nbdd0121:unwind, r=Amanieubors-0/+1
Fix FFI-unwind unsoundness with mixed panic mode UB maybe introduced when an FFI exception happens in a `C-unwind` foreign function and it propagates through a crate compiled with `-C panic=unwind` into a crate compiled with `-C panic=abort` (#96926). To prevent this unsoundness from happening, we will disallow a crate compiled with `-C panic=unwind` to be linked into `panic-abort` *if* it contains a call to `C-unwind` foreign function or function pointer. If no such call exists, then we continue to allow such mixed panic mode linking because it's sound (and stable). In fact we still need the ability to do mixed panic mode linking for std, because we only compile std once with `-C panic=unwind` and link it regardless panic strategy. For libraries that wish to remain compile-once-and-linkable-to-both-panic-runtimes, a `ffi_unwind_calls` lint is added (gated under `c_unwind` feature gate) to flag any FFI unwind calls that will cause the linkable panic runtime be restricted. In summary: ```rust #![warn(ffi_unwind_calls)] mod foo { #[no_mangle] pub extern "C-unwind" fn foo() {} } extern "C-unwind" { fn foo(); } fn main() { // Call to Rust function is fine regardless ABI. foo::foo(); // Call to foreign function, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. unsafe { foo(); } //~^ WARNING call to foreign function with FFI-unwind ABI let ptr: extern "C-unwind" fn() = foo::foo; // Call to function pointer, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. ptr(); //~^ WARNING call to function pointer with FFI-unwind ABI } ``` Fix #96926 `@rustbot` label: T-compiler F-c_unwind
2022-07-02move encode_and_write_metadata to rustc_metadata::fsYoshiki Matsuda-70/+4
2022-07-02move emit_metadata to rustc_metadata::fsYoshiki Matsuda-1/+1
2022-06-19Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-seMatthias Krüger-3/+3
once cell renamings This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128 - Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}` - Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}` (I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc) ```@rustbot``` label +T-libs-api -T-libs
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-3/+3
2022-06-15Consume resolutions for lowering separately.Camille GILLOT-8/+24
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-6/+13
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-3/+8
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-1/+1
2022-06-08Fix FFI-unwind unsoundness with mixed panic modeGary Guo-0/+1
2022-06-03Remove support for -Zast-json and -Zast-json-noexpandbjorn3-9/+0
2022-05-24Remove the check_mod_intrinsics queryOli Scherer-1/+0
2022-05-22rustc_parse: Move AST -> TokenStream conversion logic to `rustc_ast`Vadim Petrochenkov-7/+1
2022-05-08Move lint expectation checking into a separate query (RFC 2383)xFrednet-0/+4
2022-04-16Rollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelixDylan DPC-4/+8
Only add codegen backend to dep info if -Zbinary-dep-depinfo is used I am currently migrating the cg_clif build system from using a binary linked to the codegen backend as rustc replacement to passing `-Zcodegen-backend` instead. Without this PR this would force cargo to rebuild the sysroot on any change to the codegen backend even if I explicitly specify that I want it to be preserved, which would make development of cg_clif a lot slower. If you still want to have changes to the codegen backend invalidate the cargo build cache you can explicitly specify `-Zbinary-dep-depinfo`. cc ``@eddyb`` as the codegen backend was initially added to the depinfo for rust-gpu.
2022-04-09expand: Remove `ParseSess::missing_fragment_specifiers`Vadim Petrochenkov-16/+0
It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff.
2022-04-05span: move `MultiSpan`David Wood-2/+2
`MultiSpan` contains labels, which are more complicated with the introduction of diagnostic translation and will use types from `rustc_errors` - however, `rustc_errors` depends on `rustc_span` so `rustc_span` cannot use types like `DiagnosticMessage` without dependency cycles. Introduce a new `rustc_error_messages` crate that can contain `DiagnosticMessage` and `MultiSpan`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-03-31Stop emitting lints during lowering.Camille GILLOT-17/+15
2022-03-30Spellchecking compiler commentsYuri Astrakhan-1/+1
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-24Don't include invalid paths in the depinfo for builtin backendsbjorn3-1/+5
2022-03-24Only add codegen backend to dep info if -Zbinary-dep-depinfo is usedbjorn3-4/+4
2022-03-16rustc_error: make ErrorReported impossible to constructmark-12/+14
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-04Auto merge of #94096 - cjgillot:ensure-stability, r=lcnrbors-5/+6
Ensure stability directives are checked in all cases Split off #93017 Stability and deprecation were not checked in all cases, for instance if a type error happened. This PR moves the check earlier in the pipeline to ensure the errors are emitted in all cases. r? `@lcnr`
2022-03-03Cleanup feature gates.Camille GILLOT-5/+5
2022-03-03Remove the everybody loops passbjorn3-19/+7
It isn't used anymore by rustdoc
2022-03-03Force ensure stability_index.Camille GILLOT-0/+1
2022-03-03Rollup merge of #94433 - Urgau:check-cfg-allowness, r=petrochenkovDylan DPC-1/+2
Improve allowness of the unexpected_cfgs lint This pull-request improve the allowness (`#[allow(...)]`) of the `unexpected_cfgs` lint. Before this PR only crate level `#![allow(unexpected_cfgs)]` worked, now with this PR it also work when put around `cfg!` or if it is in a upper level. Making it work ~for the attributes `cfg`, `cfg_attr`, ...~ for the same level is awkward as the current code is design to give "Some parent node that is close to this macro call" (cf. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/base/struct.ExpansionData.html) meaning that allow on the same line as an attribute won't work. I'm note even sure if this would be possible. Found while working on https://github.com/rust-lang/rust/pull/94298. r? ````````@petrochenkov````````