about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
2025-09-28Do not validate MIR if code does not type-check.Camille Gillot-12/+14
2025-09-21Add panic=immediate-abortBen Kimock-2/+1
2025-09-19fixes for numerous clippy warningsMarijn Schouten-6/+6
2025-09-10Rollup merge of #146340 - fmease:frontmatter-containment, r=fee1-dead,UrgauMatthias Krüger-4/+13
Strip frontmatter in fewer places * Stop stripping frontmatter in `proc_macro::Literal::from_str` (RUST-146132) * Stop stripping frontmatter in expr-ctxt (but not item-ctxt!) `include`s (RUST-145945) * Stop stripping shebang (!) in `proc_macro::Literal::from_str` * Not a breaking change because it did compare spans already to ensure there wasn't extra whitespace or comments (`Literal::from_str("#!\n0")` already yields `Err(_)` thankfully!) * Stop stripping frontmatter+shebang inside some rustdoc code where it doesn't make any observable difference (see self review comments) * (Stop stripping frontmatter+shebang inside internal test code) Fixes https://github.com/rust-lang/rust/issues/145945. Fixes https://github.com/rust-lang/rust/issues/146132. r? fee1-dead
2025-09-09Strip frontmatter in fewer placesLeón Orell Valerian Liehr-4/+13
2025-09-08fixup limit handling codeJana Dönszelmann-35/+19
2025-08-29cleanup proof tree implementation and add cachelcnr-1/+2
2025-08-24Port crate name to the new attribute systemJana Dönszelmann-3/+25
2025-08-22Separate transmute checking from typeck.Camille Gillot-1/+2
2025-08-22Move validate_attr to `rustc_attr_parsing`Jonathan Brouwer-3/+2
2025-08-09Auto merge of #145146 - fee1-dead-contrib:push-zmqrkurlzrxy, r=nnethercotebors-1/+1
remove `P` Previous work: rust-lang/rust#141603 MCP: https://github.com/rust-lang/compiler-team/issues/878 cc `@nnethercote`
2025-08-09remove `P`Deadbeef-1/+1
2025-08-08Fix some bad formatting in `-Zmacro-stats` output.Nicholas Nethercote-1/+1
I also double-checked that everything looks good on some real-world crates.
2025-08-02Auto merge of #144479 - cjgillot:incr-privacy-mod, r=petrochenkovbors-1/+3
Perform check_private_in_public by module. Based on https://github.com/rust-lang/rust/pull/116316
2025-07-31Move `ResolverOutputs` out of `rustc_middle`.Nicholas Nethercote-2/+2
It's not used in `rustc_middle`, and `rustc_resolve` is a better place for it.
2025-07-26Perform check_private_in_public by module.Camille GILLOT-1/+3
2025-07-25Stop compilation if macro expansion failedGuillaume Gomez-0/+4
2025-07-17Integrate stable feature checking into a query.Camille GILLOT-5/+0
2025-07-17Retire stability_index query.Camille GILLOT-1/+0
2025-07-04Auto merge of #143247 - cjgillot:metadata-no-red, r=petrochenkovbors-2/+1
Avoid depending on forever-red DepNode when encoding metadata. Split from https://github.com/rust-lang/rust/pull/114669 for perf r? `@petrochenkov`
2025-07-02Hash resolutions.Camille GILLOT-2/+1
2025-06-30Rollup merge of #143228 - nnethercote:macro-stats-build-scripts, r=KobzolMatthias Krüger-1/+11
Handle build scripts better in `-Zmacro-stats` output. Currently all build scripts are listed as `build_script_build` in the stats header. This commit uses `CARGO_PKG_NAME` to improve that. I tried it on Bevy, it works well, giving output like this on the build script: ``` MACRO EXPANSION STATS: serde build script ``` and this on the crate itself: ``` MACRO EXPANSION STATS: serde ``` r? `@Kobzol`
2025-06-30Handle build scripts better in `-Zmacro-stats` output.Nicholas Nethercote-1/+11
Currently all build scripts are listed as `build_script_build` in the stats header. This commit uses `CARGO_PKG_NAME` to improve that. I tried it on Bevy, it works well, giving output like this on the build script: ``` MACRO EXPANSION STATS: serde build script ``` and this on the crate itself: ``` MACRO EXPANSION STATS: serde ```
2025-06-30Improve macro-stats printing.Nicholas Nethercote-6/+16
By allowing long names to overlap with the "Uses" field when it has spare space. This avoids unnecessary line breaks in the output.
2025-06-24Rollup merge of #142934 - nnethercote:tweak-macro-stats, r=petrochenkovJubilee-2/+2
Tweak `-Zmacro-stats` measurement. It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1. r? ```@petrochenkov```
2025-06-24Rollup merge of #142944 - nnethercote:stats-tweaks, r=lqdGuillaume Gomez-1/+1
Stats output tweaks Some improvements to `-Zinput-stats` and `-Zmeta-stat` inspired by the new `-Zmacro-stats`. r? `@lqd`
2025-06-24Tweak `-Zinput-stats` and `-Zmeta-stats` output.Nicholas Nethercote-1/+1
To make it match `-Zmacro-stats`, and work better if you have enabled it for multiple crates. - Print each crate's name. - Print a `===` banner at the start and end for separation.
2025-06-24Make stats code nicer.Nicholas Nethercote-1/+1
Taking inspiration from `-Zmacro-stats`: - Use "{prefix}" consistently. - Use names for column widths. - Write output in a single `eprint!` call, in an attempt to minimize interleaving of output from different rustc processes. - Use `repeat` for the long `---` banners.
2025-06-24Tweak `-Zmacro-stats` measurement.Nicholas Nethercote-2/+2
It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1.
2025-06-23Rollup merge of #142784 - Kobzol:timings-codegen, r=nnethercoteJubilee-0/+3
Add codegen timing section And since we now start and end the sections also using separate functions, also add some light checking if we're generating the sections correctly. I'm integrating `--timings` into Cargo, and I realized that the codegen timings would be quite useful for that. Frontend can be computed simply as `[start of compilation, start of codegen]` for now. r? `@nnethercote`
2025-06-23Add codegen timing sectionJakub Beránek-0/+3
2025-06-20Rollup merge of #142767 - nnethercote:symbol-cleanups, r=petrochenkovJakub Beránek-1/+1
Some symbol and PathRoot cleanups I'm looking into unifying how we join and print paths. Here are some preliminary cleanups. r? ``@petrochenkov``
2025-06-20Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obkTrevor Gross-2/+2
Reduce uses of `hir_crate`. I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely. The second commit is a drive-by cleanup. It can be pulled into its own PR. r? ````@oli-obk````
2025-06-20Use a symbol for `ExpansionConfig::crate_name`.Nicholas Nethercote-1/+1
This avoids some symbol interning and `to_string` conversions.
2025-06-19Update compiler/rustc_interface/src/passes.rsCamille Gillot-1/+1
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2025-06-18Reduce uses of `hir_crate`.Camille GILLOT-1/+1
2025-06-15Rollup merge of #141769 - bjorn3:codegen_metadata_module_rework, ↵León Orell Valerian Liehr-6/+5
r=workingjubilee,saethlin Move metadata object generation for dylibs to the linker code This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time. Prerequisite of https://github.com/rust-lang/rust/issues/96708.
2025-06-12Introduce `-Zmacro-stats`.Nicholas Nethercote-3/+78
It collects data about macro expansions and prints them in a table after expansion finishes. It's very useful for detecting macro bloat, especially for proc macros. Details: - It measures code snippets by pretty-printing them and then measuring lines and bytes. This required a bunch of additional pretty-printing plumbing, in `rustc_ast_pretty` and `rustc_expand`. - The measurement is done in `MacroExpander::expand_invoc`. - The measurements are stored in `ExtCtxt::macro_stats`.
2025-06-10Remove check_mod_loops query and run the checks per-body insteadOli Scherer-1/+0
2025-06-07Auto merge of #141950 - oli-obk:big-body-owner-loop, r=compiler-errorsbors-7/+0
Move coroutine_by_move_body_def_id into the big check_crate body owner loop This avoids starting a parallel loop in sequence and instead runs all the queries for a specific DefId together.
2025-06-06Auto merge of #141774 - oli-obk:naked-fn-queries, r=petrochenkovbors-1/+0
Change per-module naked fn checks to happen during typeck instead cc `@Lokathor` `@Amanieu` `@folkertdev` just seems nicer this way
2025-06-03Rollup merge of #141943 - nnethercote:rm-pre-expansion-ast-stats, ↵Matthias Krüger-5/+1
r=compiler-errors Remove pre-expansion AST stats. They're very little value, because they only measure the top-level `main.rs` or `lib.rs` file. (Other `.rs` files don't get read and parsed until expansion occurs.) I saw an example recently where the pre-expansion AST was 3KB in size and the post-expansion AST was 66MB. I kept the "POST EXPANSION" in the output header, I think that's useful information to avoid possible confusion about when the measurement happens. r? `@davidtwco`
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-5/+2
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-06-03Only borrow EncodedMetadata in codegen_cratebjorn3-4/+6
And move passing it to the linker to the driver code.
2025-06-03Move coroutine_by_move_body_def_id into the big check_crate body owner loopOli Scherer-7/+0
2025-06-03Remove pre-expansion AST stats.Nicholas Nethercote-5/+1
They're very little value, because they only measure the top-level `main.rs` or `lib.rs` file. (Other `.rs` files don't get read and parsed until expansion occurs.) I saw an example recently where the pre-expansion AST was 3KB in size and the post-expansion AST was 66MB. I kept the "POST EXPANSION" in the output header, I think that's useful information to avoid possible confusion about when the measurement happens.
2025-05-30Change a per-module query to just run on the items it internally filters forOli Scherer-1/+0
2025-05-30Merge coroutine obligation checking into borrowck parallel loopOli Scherer-4/+0
2025-05-21Move -Zcrate-attr injection to just after crate root parsingbjorn3-8/+8
This way after_crate_root_parsing and -Zpretty will see them.
2025-05-19Warning added when dependency crate has async drop types, and the feature is ↵Andrew Zhogin-0/+1
disabled