about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/pretty.rs
AgeCommit message (Collapse)AuthorLines
2024-04-15Fix pretty hir for anon consts in diagnosticsMichael Goulet-18/+1
2024-04-08Ensure we do not accidentally insert new early aborts in the analysis passesOli Scherer-2/+4
2024-03-11Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco"Oli Scherer-4/+2
This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd.
2024-03-11Never bail out early while running all the type check queriesOli Scherer-2/+4
2024-03-07Rollup merge of #121089 - oli-obk:create_def_feed, r=petrochenkovGuillaume Gomez-2/+2
Remove `feed_local_def_id` best reviewed commit by commit Basically I returned `TyCtxtFeed` from `create_def` and then preserved that in the local caches based on https://github.com/rust-lang/rust/pull/121084 r? ````@petrochenkov````
2024-03-05Avoid using feed_unit_query from within queriesOli Scherer-2/+2
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-3/+3
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-02-22Inline and remove `abort_on_err`.Nicholas Nethercote-4/+10
It's clumsy and doesn't improve readability.
2023-12-19rename to verbose-internalsjyn-1/+1
2023-11-17change smir to StableMirOğuz Ağcayazı-1/+1
2023-11-17emit basic smirOğuz Ağcayazı-0/+6
2023-11-05Don't steal the parse query when using --prettybjorn3-1/+1
This is the only place aside from the global_ctxt query where it is stolen.
2023-10-13Split and rename the annotation structs.Nicholas Nethercote-27/+36
`NoAnn` and `IdentifiedAnnotation` impl both `pprust_ast::PpAnn` and `pprust_hir::PpAnn`, which is a bit confusing, because the optional `tcx` is only needed for the HIR cases. (Currently the `tcx` is unnecessarily provided in the `expanded` AST cases.) This commit splits each one into `Ast` and `Hir` versions, which makes things clear about where the `tcx` is needed. The commit also renames all the traits so they consistently end with `Ann`.
2023-10-13Make `needs_analysis` true for `PpHirMode::Typed`.Nicholas Nethercote-1/+0
This avoids the need for a bespoke `tcx.analysis()` call.
2023-10-13Rename some `'hir` lifetimes as `'tcx`.Nicholas Nethercote-8/+8
Because they all end up within a `TyCtxt`.
2023-10-13Remove pretty-printing traits.Nicholas Nethercote-129/+52
`call_with_pp_support_ast` and `call_with_pp_support_hir` how each have a single call site. This commit inlines and removes them, which also removes the need for all the supporting traits: `Sess`, `AstPrinterSupport`, and `HirPrinterSupport`. The `sess` member is also removed from several structs.
2023-10-13Merge `print_*` functions.Nicholas Nethercote-68/+50
The handling of the `PpMode` variants is currently spread across three functions: `print_after_parsing`, `print_after_hir_lowering`, and `print_with_analysis`. Each one handles some of the variants. This split is primarily because `print_after_parsing` has slightly different arguments to the other two. This commit changes the structure. It merges the three functions into a single `print` function, and encapsulates the different arguments in a new enum `PrintExtra`. Benefits: - The code is a little shorter. - All the `PpMode` variants are handled in a single `match`, with no need for `unreachable!` arms. - It enables the trait removal in the subsequent commit by reducing the number of `call_with_pp_support_ast` call sites from two to one.
2023-10-13Simplify support traits.Nicholas Nethercote-68/+27
First, both `AstPrinterSupport` and `HirPrinterSupport` have a `sess` method. This commit introduces a `Sess` trait and makes the support traits be subtraits of `Sess`, to avoid some duplication. Second, both support traits have a `pp_ann` method that isn't needed if we enable `trait_upcasting`. This commit removes those methods. (Both of these traits will be removed in a subsequent commit, as will the `trait_upcasting` use.)
2023-10-13Remove unused `PrinterSupport::hir_map` method.Nicholas Nethercote-16/+0
2023-10-13Remove PpAstTreeMode.Nicholas Nethercote-3/+3
It's simpler to distinguish the two AST modes directly in `PpMode`.
2023-10-13Remove an outdated comment.Nicholas Nethercote-4/+0
`phase_3_run_analysis_passes` no longer exists, and AFAICT this code has been refactored so much since this comment was written that it no longer has any useful meaning.
2023-10-13Remove unnecessary call to `call_with_pp_support_hir`.Nicholas Nethercote-4/+2
The callback is trivial and no pp support is actually needed. This makes the `HirTree` case more like the `AstTree` case above.
2023-10-13Rename some things.Nicholas Nethercote-35/+35
- Rename `pprust` as `pprust_ast`, to align with `pprust_hir`. - Rename `PrinterSupport` as `AstPrinterSupport`, to align with `HirPrinterSupport`.
2023-07-20Move OutFileName writing into rustc_sessionDavid Tolnay-12/+1
2023-06-06Write to stdout if `-` is given as output fileJing Peng-3/+3
If `-o -` or `--emit KIND=-` is provided, output will be written to stdout instead. Binary output (`obj`, `llvm-bc`, `link` and `metadata`) being written this way will result in an error unless stdout is not a tty. Multiple output types going to stdout will trigger an error too, as they will all be mixded together.
2023-04-20Remove WithOptconstParam.Camille GILLOT-12/+2
2023-02-02Rename rustc_driver to rustc_driver_implJohn Kåre Alsaker-0/+522