-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Miscellaneous cleanups to borrowck related code #150550
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
Conversation
| /// Returns whether borrows represented by this kind are allowed to be split into separate | ||
| /// Reservation and Activation phases. | ||
| pub fn allows_two_phase_borrow(&self) -> bool { | ||
| pub fn is_two_phase_borrow(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in some sense its always a two phase borrow, just sometimes its activated at the same point its created I think?
The previous name confused me because it made it sound like a reference may or may not be a two phase borrow and then we went on to unconditionally treat it as two phase without ever checking if it "actually is".
| // and we know that `&'a T::Out` is WF, then we want to imply `U: 'a`. | ||
| let normalized_ty = ocx | ||
| .deeply_normalize(&ObligationCause::dummy_with_span(span), param_env, ty) | ||
| .map_err(|_| NoSolution)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you test removing the normalized_ty here and does that break anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it didn't break anything but I also didn't feel confident enough in our test suite to just yeet it 🤔 I guess the failure mode here is "less implied bounds" which is not unsound so it's probably quite safe to do, and it should be easy enough to bisect this PR from a crater regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah there were some weird diagnostic changes that I didn't want to spend the time investigating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifically, tests/ui/delegation/unsupported.rs has its cycles changed to "cycle detected when comparing an impl" and we lose the type annotations needed error. I have literally no idea how delegation works so don't intend to look into that xd
|
nits, then r=me |
f799e2f to
3705ebb
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ rollup |
…uwer Rollup of 15 pull requests Successful merges: - #148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing) - #150550 (Miscellaneous cleanups to borrowck related code) - #150879 (Remove the diagnostic lints) - #150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`) - #150987 (remote-test-server: Fix header in batch mode) - #151004 (std: implement `sleep_until` on Apple platforms) - #151045 (Simplify some literal-value negations with `u128::wrapping_neg`) - #151119 (Support pointers in type reflection) - #151171 (Do not recover from `Trait()` if generic list is unterminated) - #151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`) - #151249 (Parse ident with allowing recovery when trying to diagnose) - #151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`) - #151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`) - #151361 (add test for issue 61463) - #151371 (Add `S-blocked` to `labels_blocking_approval`) r? @ghost
Rollup merge of #150550 - borrowck_cleanup_2, r=lcnr Miscellaneous cleanups to borrowck related code r? lcnr
…uwer Rollup of 15 pull requests Successful merges: - rust-lang/rust#148623 (Ignore `#[doc(hidden)]` items when computing trimmed paths for printing) - rust-lang/rust#150550 (Miscellaneous cleanups to borrowck related code) - rust-lang/rust#150879 (Remove the diagnostic lints) - rust-lang/rust#150895 (rustc_errors: Add (heuristic) Syntax Highlighting for `rustc --explain`) - rust-lang/rust#150987 (remote-test-server: Fix header in batch mode) - rust-lang/rust#151004 (std: implement `sleep_until` on Apple platforms) - rust-lang/rust#151045 (Simplify some literal-value negations with `u128::wrapping_neg`) - rust-lang/rust#151119 (Support pointers in type reflection) - rust-lang/rust#151171 (Do not recover from `Trait()` if generic list is unterminated) - rust-lang/rust#151231 (HIR typeck cleanup: clarify and re-style `check_expr_unop`) - rust-lang/rust#151249 (Parse ident with allowing recovery when trying to diagnose) - rust-lang/rust#151295 (THIR patterns: Use `ty::Value` in more places throughout `const_to_pat`) - rust-lang/rust#151326 (Remove `DiagMessage::Translated` in favour of `DiagMessage::Str`) - rust-lang/rust#151361 (add test for issue 61463) - rust-lang/rust#151371 (Add `S-blocked` to `labels_blocking_approval`) r? @ghost
|
@rust-timer build f6790fd |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (f6790fd): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary 5.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.0%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 473.058s -> 475.899s (0.60%) |
r? lcnr