-
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
Rename can_coerce
to may_coerce
, and then structurally resolve correctly in the probe
#131751
Conversation
@@ -0,0 +1,21 @@ | |||
error[E0308]: arguments to this function are incorrect |
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.
This is one test I could invent that demonstrated the change. I could make morel, but they're kinda annoying lol
let cause = self.cause(DUMMY_SP, ObligationCauseCode::ExprAssignable); | ||
// We don't ever need two-phase here since we throw out the result of the coercion. | ||
// We also just always set `coerce_never` to true, since this is a heuristic. | ||
let coerce = Coerce::new(self, cause, AllowTwoPhase::No, true); | ||
let coerce = Coerce::new(self, cause.clone(), AllowTwoPhase::No, true); |
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.
is this hot enough that it may cause perf issues? Probably not, as this is only used in error paths
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.
Yah, probably not.
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.
r=me after nit
07ec258
to
9070aba
Compare
@bors r=lcnr |
…ve, r=lcnr Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe We need to structurally resolve the lhs and rhs of the coercion. Also, renaming the method so it's less ambiguous about what it's doing... the word "may" gives more clear signal that it has false positives imo. r? lcnr
…ve, r=lcnr Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe We need to structurally resolve the lhs and rhs of the coercion. Also, renaming the method so it's less ambiguous about what it's doing... the word "may" gives more clear signal that it has false positives imo. r? lcnr
Rollup of 10 pull requests Successful merges: - rust-lang#129181 (Pass end position of span through inline ASM cookie) - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain) - rust-lang#131657 (Rustfmt `for<'a> async` correctly) - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated) - rust-lang#131730 (Refactor some `core::fmt` macros) - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe) - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`) - rust-lang#131776 (Emscripten: Xfail backtrace ui tests) - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir) - rust-lang#131778 (Fix needless_lifetimes in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain) - rust-lang#131657 (Rustfmt `for<'a> async` correctly) - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated) - rust-lang#131730 (Refactor some `core::fmt` macros) - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe) - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`) - rust-lang#131776 (Emscripten: Xfail backtrace ui tests) - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir) - rust-lang#131778 (Fix needless_lifetimes in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131751 - compiler-errors:structurally-resolve, r=lcnr Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe We need to structurally resolve the lhs and rhs of the coercion. Also, renaming the method so it's less ambiguous about what it's doing... the word "may" gives more clear signal that it has false positives imo. r? lcnr
We need to structurally resolve the lhs and rhs of the coercion. Also, renaming the method so it's less ambiguous about what it's doing... the word "may" gives more clear signal that it has false positives imo.
r? lcnr