-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 17 pull requests #93138
Rollup of 17 pull requests #93138
Commits on Jan 13, 2022
-
Fix errors on blanket impls by ignoring the children of their generat…
…ed implementations
Configuration menu - View commit details
-
Copy full SHA for aa523a9 - Browse repository at this point
Copy the full SHA aa523a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74f0e58 - Browse repository at this point
Copy the full SHA 74f0e58View commit details -
Configuration menu - View commit details
-
Copy full SHA for a6aa3cb - Browse repository at this point
Copy the full SHA a6aa3cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for aafcbf1 - Browse repository at this point
Copy the full SHA aafcbf1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 474e091 - Browse repository at this point
Copy the full SHA 474e091View commit details
Commits on Jan 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4be32f8 - Browse repository at this point
Copy the full SHA 4be32f8View commit details -
Track drop points in generator_interior
This change adds the basic infrastructure for tracking drop ranges in generator interior analysis, which allows us to exclude dropped types from the generator type. Not yet complete, but many of the async/await and generator tests pass. The main missing piece is tracking branching control flow (e.g. around an `if` expression). The patch does include support, however, for multiple yields in th e same block. Issue rust-lang#57478
Configuration menu - View commit details
-
Copy full SHA for f712df8 - Browse repository at this point
Copy the full SHA f712df8View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4dee40 - Browse repository at this point
Copy the full SHA c4dee40View commit details -
Make generator and async-await tests pass
The main change needed to make this work is to do a pessimistic over- approximation for AssignOps. The existing ScopeTree analysis in region.rs works by doing both left to right and right to left order and then choosing the most conservative ordering. This behavior is needed because AssignOp's evaluation order depends on whether it is a primitive type or an overloaded operator, which runs as a method call. This change mimics the same behavior as region.rs in generator_interior.rs. Issue rust-lang#57478
Configuration menu - View commit details
-
Copy full SHA for f664cfc - Browse repository at this point
Copy the full SHA f664cfcView commit details -
Attribute drop to parent expression of the consume point
This is needed to handle cases like `[a, b.await, c]`. `ExprUseVisitor` considers `a` to be consumed when it is passed to the array, but the array is not quite live yet at that point. This means we were missing the `a` value across the await point. Attributing drops to the parent expression means we do not consider the value consumed until the consuming expression has finished. Issue rust-lang#57478
Configuration menu - View commit details
-
Copy full SHA for f246c0b - Browse repository at this point
Copy the full SHA f246c0bView commit details -
This adds support for branching and merging control flow and uses this to correctly handle the case where a value is dropped in one branch of an if expression but not another. There are other cases we need to handle, which will come in follow up patches. Issue rust-lang#57478
Configuration menu - View commit details
-
Copy full SHA for aa029d4 - Browse repository at this point
Copy the full SHA aa029d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9611770 - Browse repository at this point
Copy the full SHA 9611770View commit details -
Configuration menu - View commit details
-
Copy full SHA for 298ca2f - Browse repository at this point
Copy the full SHA 298ca2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4574152 - Browse repository at this point
Copy the full SHA 4574152View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba7d127 - Browse repository at this point
Copy the full SHA ba7d127View commit details -
Revamped DropRange data structure
Not currently working. Need to flow drop information.
Configuration menu - View commit details
-
Copy full SHA for ff0e8f4 - Browse repository at this point
Copy the full SHA ff0e8f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for c7afaa1 - Browse repository at this point
Copy the full SHA c7afaa1View commit details -
Fix control flow handling in generator_interior
All tests pass now! The issue was that we weren't handling all edges correctly, but now they are handled consistently. This includes code to dump a graphviz file for the CFG we built for drop tracking. Also removes old DropRanges tests.
Configuration menu - View commit details
-
Copy full SHA for b39fb9b - Browse repository at this point
Copy the full SHA b39fb9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 904c270 - Browse repository at this point
Copy the full SHA 904c270View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5feb4d0 - Browse repository at this point
Copy the full SHA 5feb4d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46760b4 - Browse repository at this point
Copy the full SHA 46760b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 006f547 - Browse repository at this point
Copy the full SHA 006f547View commit details -
1. Add test case for partial drops 2. Simplify code in `propagate_to_fixpoint` and remove most clones 3. Clean up PostOrderIndex creation
Configuration menu - View commit details
-
Copy full SHA for 30e1b1e - Browse repository at this point
Copy the full SHA 30e1b1eView commit details -
Splits drop_ranges into drop_ranges::record_consumed_borrow, drop_ranges::cfg_build, and drop_ranges::cfg_propagate. The top level drop_ranges module has an entry point that does all the coordination of the other three phases, using code original in generator_interior.
Configuration menu - View commit details
-
Copy full SHA for f5f98d7 - Browse repository at this point
Copy the full SHA f5f98d7View commit details -
This cleans up the refactoring from the previous patch and cleans things up a bit. Each module has a clear entry point and everything else is private.
Configuration menu - View commit details
-
Copy full SHA for 9347bf4 - Browse repository at this point
Copy the full SHA 9347bf4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a28afb - Browse repository at this point
Copy the full SHA 6a28afbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d82e4f - Browse repository at this point
Copy the full SHA 7d82e4fView commit details -
The refactoring mainly keeps the separation between the modules clearer. For example, process_deferred_edges function moved to cfg_build.rs since that is really part of building the CFG, not finding the fixpoint. Also, we use PostOrderId instead of usize in a lot more places now.
Configuration menu - View commit details
-
Copy full SHA for 2af02cf - Browse repository at this point
Copy the full SHA 2af02cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a70de7 - Browse repository at this point
Copy the full SHA 4a70de7View commit details -
Explicitly list all ExprKinds in cfg_build
Also rearranges the existing arms to be more logical. For example, Break and Continue come closer to Loop now.
Configuration menu - View commit details
-
Copy full SHA for 6e281a7 - Browse repository at this point
Copy the full SHA 6e281a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7df4e8 - Browse repository at this point
Copy the full SHA a7df4e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d11b33 - Browse repository at this point
Copy the full SHA 7d11b33View commit details -
Track changed bitsets in CFG propagation
This reduces the amount of work done, especially in later iterations, by only processing nodes whose predecessors changed in the previous iteration, or earlier in the current iteration. This also has the side effect of completely ignoring all unreachable nodes.
Configuration menu - View commit details
-
Copy full SHA for f730bd0 - Browse repository at this point
Copy the full SHA f730bd0View commit details -
Handle uninhabited return types
This changes drop range analysis to handle uninhabited return types such as `!`. Since these calls to these functions do not return, we model them as ending in an infinite loop.
Configuration menu - View commit details
-
Copy full SHA for 787f4cb - Browse repository at this point
Copy the full SHA 787f4cbView commit details -
The previous commit made the non_sync_with_method_call case pass due to the await being unreachable. Unfortunately, this isn't actually the behavior the test was verifying. This change lifts the panic into a helper function so that the generator analysis still thinks the await is reachable, and therefore we preserve the same testing behavior.
Configuration menu - View commit details
-
Copy full SHA for 887e843 - Browse repository at this point
Copy the full SHA 887e843View commit details -
drop_ranges: Add TrackedValue enum
This makes it clearer what values we are tracking and why.
Configuration menu - View commit details
-
Copy full SHA for 78c5644 - Browse repository at this point
Copy the full SHA 78c5644View commit details -
We previously weren't tracking partial re-inits while being too aggressive around partial drops. With this change, we simply ignore partial drops, which is the safer, more conservative choice.
Configuration menu - View commit details
-
Copy full SHA for 32930d9 - Browse repository at this point
Copy the full SHA 32930d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0a5370 - Browse repository at this point
Copy the full SHA e0a5370View commit details -
Configuration menu - View commit details
-
Copy full SHA for d840d0c - Browse repository at this point
Copy the full SHA d840d0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 76f6b57 - Browse repository at this point
Copy the full SHA 76f6b57View commit details
Commits on Jan 19, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2938be6 - Browse repository at this point
Copy the full SHA 2938be6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06b00ad - Browse repository at this point
Copy the full SHA 06b00adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 017747f - Browse repository at this point
Copy the full SHA 017747fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 10858d2 - Browse repository at this point
Copy the full SHA 10858d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f491a9f - Browse repository at this point
Copy the full SHA f491a9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d27c28 - Browse repository at this point
Copy the full SHA 8d27c28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 801ac0e - Browse repository at this point
Copy the full SHA 801ac0eView commit details -
src/test/rustdoc-json: Check for
struct_field
s in `variant_tuple_st……ruct.rs` The presence of `struct_field`s is being checked for already in `variant_struct.rs`. We should also check for them in `variant_tuple_struct.rs`.
Configuration menu - View commit details
-
Copy full SHA for ab239cc - Browse repository at this point
Copy the full SHA ab239ccView commit details -
Show a more informative panic message when
DefPathHash
does not existThis should hopefully make it easier to debug incremental compilation bugs like rust-lang#93096 without affecting performance.
Configuration menu - View commit details
-
Copy full SHA for 70d36a0 - Browse repository at this point
Copy the full SHA 70d36a0View commit details
Commits on Jan 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for eec6016 - Browse repository at this point
Copy the full SHA eec6016View commit details -
Grow scan_stack in the conventional direction
The pretty printer algorithm involves 2 VecDeques: a ring-buffer of tokens and a deque of ring-buffer indices. Confusingly, those two deques were being grown in opposite directions for no good reason. Ring-buffer pushes would go on the "back" of the ring-buffer (i.e. higher indices) while scan_stack pushes would go on the "front" (i.e. lower indices). This commit flips the scan_stack accesses to grow the scan_stack and ring-buffer in the same direction, where push does the same operation as a Vec push i.e. inserting on the high-index end.
Configuration menu - View commit details
-
Copy full SHA for d81740e - Browse repository at this point
Copy the full SHA d81740eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d981c5b - Browse repository at this point
Copy the full SHA d981c5bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 351011e - Browse repository at this point
Copy the full SHA 351011eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2eb46c - Browse repository at this point
Copy the full SHA d2eb46cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae75ba6 - Browse repository at this point
Copy the full SHA ae75ba6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea23a1f - Browse repository at this point
Copy the full SHA ea23a1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d5f15a8 - Browse repository at this point
Copy the full SHA d5f15a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65dd670 - Browse repository at this point
Copy the full SHA 65dd670View commit details -
Eliminate offset number from Fits frames
PrintStackElems with pbreak=PrintStackBreak::Fits always carried a meaningless value offset=0. We can combine the two types PrintStackElem + PrintStackBreak into one PrintFrame enum that stores offset only for Broken frames.
Configuration menu - View commit details
-
Copy full SHA for 9e794d7 - Browse repository at this point
Copy the full SHA 9e794d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 224536f - Browse repository at this point
Copy the full SHA 224536fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51eeb82 - Browse repository at this point
Copy the full SHA 51eeb82View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21c1571 - Browse repository at this point
Copy the full SHA 21c1571View commit details -
Configuration menu - View commit details
-
Copy full SHA for dcb0721 - Browse repository at this point
Copy the full SHA dcb0721View commit details -
rustdoc: auto create output directory when "--output-format json"
This PR allows rustdoc to automatically create output directory in case it does not exist (when run with `--output-format json`). This fixes rustdoc crash: ```` $ rustdoc --output-format json -Z unstable-options src/main.rs error: couldn't generate documentation: No such file or directory (os error 2) | = note: failed to create or modify "doc/main.json" error: aborting due to previous error ```` With this fix behavior of `rustdoc --output-format json` becomes consistent with `rustdoc --output-format html` (which already auto-creates output directory if it's missing)
Configuration menu - View commit details
-
Copy full SHA for 4e17170 - Browse repository at this point
Copy the full SHA 4e17170View commit details -
Configuration menu - View commit details
-
Copy full SHA for c29b637 - Browse repository at this point
Copy the full SHA c29b637View commit details -
Configuration menu - View commit details
-
Copy full SHA for 855c176 - Browse repository at this point
Copy the full SHA 855c176View commit details -
Configuration menu - View commit details
-
Copy full SHA for 682ef4d - Browse repository at this point
Copy the full SHA 682ef4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd005f5 - Browse repository at this point
Copy the full SHA fd005f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for caec4a2 - Browse repository at this point
Copy the full SHA caec4a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0df765 - Browse repository at this point
Copy the full SHA b0df765View commit details -
Configuration menu - View commit details
-
Copy full SHA for 028a3e7 - Browse repository at this point
Copy the full SHA 028a3e7View commit details -
Rollup merge of rust-lang#91032 - eholk:generator-drop-tracking, r=ni…
…komatsakis Introduce drop range tracking to generator interior analysis This PR addresses cases such as this one from rust-lang#57478: ```rust struct Foo; impl !Send for Foo {} let _: impl Send = || { let guard = Foo; drop(guard); yield; }; ``` Previously, the `generator_interior` pass would unnecessarily include the type `Foo` in the generator because it was not aware of the behavior of `drop`. We fix this issue by introducing a drop range analysis that finds portions of the code where a value is guaranteed to be dropped. If a value is dropped at all suspend points, then it is no longer included in the generator type. Note that we are using "dropped" in a generic sense to include any case in which a value has been moved. That is, we do not only look at calls to the `drop` function. There are several phases to the drop tracking algorithm, and we'll go into more detail below. 1. Use `ExprUseVisitor` to find values that are consumed and borrowed. 2. `DropRangeVisitor` uses consume and borrow information to gather drop and reinitialization events, as well as build a control flow graph. 3. We then propagate drop and reinitialization information through the CFG until we reach a fix point (see `DropRanges::propagate_to_fixpoint`). 4. When recording a type (see `InteriorVisitor::record`), we check the computed drop ranges to see if that value is definitely dropped at the suspend point. If so, we skip including it in the type. ## 1. Use `ExprUseVisitor` to find values that are consumed and borrowed. We use `ExprUseVisitor` to identify the places where values are consumed. We track both the `hir_id` of the value, and the `hir_id` of the expression that consumes it. For example, in the expression `[Foo]`, the `Foo` is consumed by the array expression, so after the array expression we can consider the `Foo` temporary to be dropped. In this process, we also collect values that are borrowed. The reason is that the MIR transform for generators conservatively assumes anything borrowed is live across a suspend point (see `rustc_mir_transform::generator::locals_live_across_suspend_points`). We match this behavior here as well. ## 2. Gather drop events, reinitialization events, and control flow graph After finding the values of interest, we perform a post-order traversal over the HIR tree to find the points where these values are dropped or reinitialized. We use the post-order index of each event because this is how the existing generator interior analysis refers to the position of suspend points and the scopes of variables. During this traversal, we also record branching and merging information to handle control flow constructs such as `if`, `match`, and `loop`. This is necessary because values may be dropped along some control flow paths but not others. ## 3. Iterate to fixed point The previous pass found the interesting events and locations, but now we need to find the actual ranges where things are dropped. Upon entry, we have a list of nodes ordered by their position in the post-order traversal. Each node has a set of successors. For each node we additionally keep a bitfield with one bit per potentially consumed value. The bit is set if we the value is dropped along all paths entering this node. To compute the drop information, we first reverse the successor edges to find each node's predecessors. Then we iterate through each node, and for each node we set its dropped value bitfield to the intersection of all incoming dropped value bitfields. If any bitfield for any node changes, we re-run the propagation loop again. ## 4. Ignore dropped values across suspend points At this point we have a data structure where we can ask whether a value is guaranteed to be dropped at any post order index for the HIR tree. We use this information in `InteriorVisitor` to check whether a value in question is dropped at a particular suspend point. If it is, we do not include that value's type in the generator type. Note that we had to augment the region scope tree to include all yields in scope, rather than just the last one as we did before. r? `@nikomatsakis`
Configuration menu - View commit details
-
Copy full SHA for 3d10c64 - Browse repository at this point
Copy the full SHA 3d10c64View commit details -
Rollup merge of rust-lang#92856 - GuillaumeGomez:exclude-test-doc_aut…
…o_cfg, r=Nemo157 Exclude "test" from doc_auto_cfg Fixes rust-lang#91740. cc `@Nemo157` (you were the one suggesting this iirc) r? `@camelid`
Configuration menu - View commit details
-
Copy full SHA for 10a7204 - Browse repository at this point
Copy the full SHA 10a7204View commit details -
Rollup merge of rust-lang#92860 - CraftSpider:rustdoc-json-impl-ice, …
…r=jsha Fix errors on blanket impls by ignoring the children of generated impls Related to rust-lang#83718 We can safely skip the children, as they don't contain any new info, and may be subtly different for reasons hard to track down, in ways that are consistently worse than the actual generic impl.
Configuration menu - View commit details
-
Copy full SHA for 530c884 - Browse repository at this point
Copy the full SHA 530c884View commit details -
Rollup merge of rust-lang#93038 - GuillaumeGomez:block-doc-comments, …
…r=notriddle Fix star handling in block doc comments Fixes rust-lang#92872. Some extra explanation about this PR and why rust-lang#92357 created this regression: when we merge doc comment kinds for example in: ```rust /// he /** * hello */ #[doc = "boom"] ``` We don't want to remove the empty lines between them. However, to correctly compute the "horizontal trim", we still need it, so instead, I put back a part of the "vertical trim" directly in the "horizontal trim" computation so it doesn't impact the output buffer but allows us to correctly handle the stars. r? ``@camelid``
Configuration menu - View commit details
-
Copy full SHA for aa7f452 - Browse repository at this point
Copy the full SHA aa7f452View commit details -
Rollup merge of rust-lang#93061 - estebank:macr-suggestion, r=cjgillot
Only suggest adding `!` to expressions that can be macro invocation
Configuration menu - View commit details
-
Copy full SHA for dc393b2 - Browse repository at this point
Copy the full SHA dc393b2View commit details -
Rollup merge of rust-lang#93067 - jsha:fix-scroll-padding-top, r=Guil…
…laumeGomez rustdoc mobile: fix scroll offset when jumping to internal id Followup to rust-lang#92692. The semantics of `scroll-margin-top` are a little surprising - the attribute needs to be applied to the element that gets scrolled into the viewport, not the scrolling element. This fixes an issue where clicking on a method (or other item) from the sidebar takes you to a scroll position where the topbar covers up the method name. I'm interested in ideas for how to test this with browser-ui-test, but I think it doesn't yet have what I need. What I need is an assert that `<element>.getBoundingClientRect().y` is > 45. Demo: https://rustdoc.crud.net/jsha/fix-scroll-padding-top/std/string/struct.String.html#method.extend_from_within r? `@GuillaumeGomez`
Configuration menu - View commit details
-
Copy full SHA for 35a53b2 - Browse repository at this point
Copy the full SHA 35a53b2View commit details -
Rollup merge of rust-lang#93086 - c410-f3r:let-guard, r=Mark-Simulacrum
Add tests to ensure that `let_chains` works with `if_let_guard` The current machinery already makes such combination possible but lacks tests. cc `@matthewjasper`
Configuration menu - View commit details
-
Copy full SHA for 0a9aaec - Browse repository at this point
Copy the full SHA 0a9aaecView commit details -
Rollup merge of rust-lang#93087 - ricobbe:alt-calling-convention-test…
…-fix, r=Mark-Simulacrum Fix src/test/run-make/raw-dylib-alt-calling-convention Fix the test headers so that the test now runs on all intended platforms; it is currently ignored on all platforms because the headers are incorrect. Also comment out a couple of function calls that fail because of an unrelated problem, described in issue rust-lang#91167.
Configuration menu - View commit details
-
Copy full SHA for 894a867 - Browse repository at this point
Copy the full SHA 894a867View commit details -
Rollup merge of rust-lang#93091 - pierwill:chalk-0.76, r=jackh726
⬆ chalk to 0.76.0 This update contains rust-lang/chalk#740, which is needed for work on rust-lang#90317.
Configuration menu - View commit details
-
Copy full SHA for b1a405d - Browse repository at this point
Copy the full SHA b1a405dView commit details -
Rollup merge of rust-lang#93094 - Enselic:check-for-enum-tuple-struct…
…-fields, r=CraftSpider src/test/rustdoc-json: Check for `struct_field`s in `variant_tuple_struct.rs` The presence of `struct_field`s is being checked for already in `variant_struct.rs`. We should also check for them in `variant_tuple_struct.rs`. This PR is one small step towards resolving rust-lang#92945.
Configuration menu - View commit details
-
Copy full SHA for 6cdd2e5 - Browse repository at this point
Copy the full SHA 6cdd2e5View commit details -
Rollup merge of rust-lang#93098 - Aaron1011:def-path-hash-debug, r=ol…
…i-obk Show a more informative panic message when `DefPathHash` does not exist This should hopefully make it easier to debug incremental compilation bugs like rust-lang#93096 without affecting performance.
Configuration menu - View commit details
-
Copy full SHA for e901b24 - Browse repository at this point
Copy the full SHA e901b24View commit details -
Rollup merge of rust-lang#93099 - tomkris:rustdoc-fix, r=jsha
rustdoc: auto create output directory when "--output-format json" This PR allows rustdoc to automatically create output directory in case it does not exist (when run with `--output-format json`). This fixes rustdoc crash: ```` $ rustdoc --output-format json -Z unstable-options src/main.rs error: couldn't generate documentation: No such file or directory (os error 2) | = note: failed to create or modify "doc/main.json" error: aborting due to previous error ```` With this fix behavior of `rustdoc --output-format json` becomes consistent with `rustdoc --output-format html` (which already auto-creates output directory if it's missing)
Configuration menu - View commit details
-
Copy full SHA for 51fd48f - Browse repository at this point
Copy the full SHA 51fd48fView commit details -
Rollup merge of rust-lang#93102 - dtolnay:ringbuffer, r=lcnr
Pretty printer algorithm revamp step 3 This PR follows rust-lang#93065 as a third chunk of minor modernizations backported from https://github.com/dtolnay/prettyplease into rustc_ast_pretty. I've broken this up into atomic commits that hopefully are sensible in isolation. At every commit, the pretty printer is compilable and has runtime behavior that is identical to before and after the PR. None of the refactoring so far changes behavior. This PR is the last chunk of non-behavior-changing cleanup. After this the **next PR** will begin backporting behavior changes from `prettyplease`, starting with block indentation: ```rust macro_rules! print_expr { ($expr:expr) => { println!("{}", stringify!($expr)); }; } fn main() { print_expr!(Struct { x: 0, y: 0 }); print_expr!(Structtttttttttttttttttttttttttttttttttttttttttttttttttt { xxxxxxxxx: 0, yyyyyyyyy: 0 }); } ``` Output currently on master (nowhere near modern Rust style): ```console Struct{x: 0, y: 0,} Structtttttttttttttttttttttttttttttttttttttttttttttttttt{xxxxxxxxx: 0, yyyyyyyyy: 0,} ``` After the upcoming PR for block indentation (based on dtolnay/prettyplease@401d60c): ```console Struct { x: 0, y: 0, } Structtttttttttttttttttttttttttttttttttttttttttttttttttt { xxxxxxxxx: 0, yyyyyyyyy: 0, } ``` And the PR after that, for intelligent trailing commas (based on dtolnay/prettyplease@e2a0297): ```console Struct { x: 0, y: 0 } Structtttttttttttttttttttttttttttttttttttttttttttttttttt { xxxxxxxxx: 0, yyyyyyyyy: 0, } ```
Configuration menu - View commit details
-
Copy full SHA for d4ec464 - Browse repository at this point
Copy the full SHA d4ec464View commit details -
Rollup merge of rust-lang#93104 - dtolnay:ppbless, r=Mark-Simulacrum
Support --bless for pp-exact pretty printer tests I ran into this while working on the stack of PRs containing rust-lang#93102. `x.py test src/test/pretty --bless` previously would `fatal` instead of blessing the input files. Tested by making a silly pretty-printer tweak and running the above command: 98823c3929ebfe796786345c5ee713f63317d9c6
Configuration menu - View commit details
-
Copy full SHA for 5e46f7d - Browse repository at this point
Copy the full SHA 5e46f7dView commit details -
Rollup merge of rust-lang#93114 - lcnr:mk_array, r=RalfJung
update comment for `ensure_monomorphic_enough` r? `@RalfJung`
Configuration menu - View commit details
-
Copy full SHA for b8df581 - Browse repository at this point
Copy the full SHA b8df581View commit details -
Rollup merge of rust-lang#93128 - pietroalbini:pa-verify-stable-versi…
…on-number, r=Mark-Simulacrum Add script to prevent point releases with same number as existing ones This will hopefully prevent what happened today with rust-lang#93110 and rust-lang#93121, where we built point release artifacts without changing version numbers, thus requiring another PR to change the version number. r? `@Mark-Simulacrum`
Configuration menu - View commit details
-
Copy full SHA for 9ea966a - Browse repository at this point
Copy the full SHA 9ea966aView commit details -
Rollup merge of rust-lang#93136 - pietroalbini:pa-1.58.1-relnotes-mas…
…ter, r=pietroalbini Backport the 1.58.1 release notes to master r? `@ghost`
Configuration menu - View commit details
-
Copy full SHA for dd16431 - Browse repository at this point
Copy the full SHA dd16431View commit details