-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Clean fix for #96223 #97123
Clean fix for #96223 #97123
Conversation
- Modified `InferCtxt::mk_trait_obligation_with_new_self_ty` to take as argument a `Binder<(TraitPredicate, Ty)>` instead of a `Binder<TraitPredicate>` and a separate `Ty` with no bound vars. - Modified all call places to avoid calling `Binder::no_bounds_var` or `Binder::skip_binder` when it is not safe.
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
= help: the trait `Trait` is implemented for `&'a mut S` | ||
= note: `for<'b> Trait` is implemented for `&'b mut S`, but not for `&'b S` |
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 less than ideal, but I think it should be left for a separate PR.
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.
Yeah, but I was not really able to understand why line 7 is printing only not satisfied trait and a different name for the lifetime from the one use in the code ('a
instead of 'b
) and note due to change is using binder and the same name for lifetime than the one in the code.
@bors r+ |
📌 Commit ac5366b has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#94639 (Suggest dereferencing non-lval mutable reference on assignment) - rust-lang#95979 (update coherence docs, fix generator + opaque type ICE) - rust-lang#96378 (Mention traits and types involved in unstable trait upcasting) - rust-lang#96917 (Make HashMap fall back to RtlGenRandom if BCryptGenRandom fails) - rust-lang#97101 (Add tracking issue for ExitCode::exit_process) - rust-lang#97123 (Clean fix for rust-lang#96223) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Okay, so here we are (hopefully) 👍
Closes #96223
Thanks a lot to @jackh726 for your help and explanation 🙏
Modified
InferCtxt::mk_trait_obligation_with_new_self_ty
to take as argument aBinder<(TraitPredicate, Ty)>
instead of aBinder<TraitPredicate>
and a separateTy
with no bound vars.Modified all call places to avoid calling
Binder::no_bounds_var
orBinder::skip_binder
when it is not safe.r? @jackh726