-
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
Use can_eq
to compare types for default assoc type error
#107304
The head ref may contain hidden characters: "\u1438Ty\u2000as\u2000PartialEq\u1433\uFF1A\uFF1Aeq\u2000because\u2000what\u2000else\u2000are\u2000we\u2000gonna\u2000use\u2000in\u2000rustc_middle"
Use can_eq
to compare types for default assoc type error
#107304
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
3e98b8f
to
4ffd068
Compare
@@ -441,6 +441,10 @@ impl<'tcx> TyCtxt<'tcx> { | |||
self.opt_def_kind(def_id) | |||
.unwrap_or_else(|| bug!("def_kind: unsupported node: {:?}", def_id)) | |||
} | |||
|
|||
pub fn bound_type_of(self, def_id: impl IntoQueryParam<DefId>) -> ty::EarlyBinder<Ty<'tcx>> { |
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.
Moving this here so it can use IntoQueryParam
just like def_kind
above.
4ffd068
to
35ce21b
Compare
This way we can properly deal with the types.
This works correctly with inference variables.
35ce21b
to
943000f
Compare
r? @compiler-errors Looks good to me! |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#97373 (impl DispatchFromDyn for Cell and UnsafeCell) - rust-lang#106625 (Remove backwards compat for LLVM 12 coverage format) - rust-lang#106779 (Avoid __cxa_thread_atexit_impl on Emscripten) - rust-lang#106811 (Append .dwp to the binary filename instead of replacing the existing extension.) - rust-lang#106836 (Remove optimistic spinning from `mpsc::SyncSender`) - rust-lang#106946 (implement Hash for proc_macro::LineColumn) - rust-lang#107074 (remove unnecessary check for opaque types) - rust-lang#107287 (Improve fn pointer notes) - rust-lang#107304 (Use `can_eq` to compare types for default assoc type error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This correctly handles inference variables like
{integer}
. I had to move all of thisnote_and_explain
code torustc_infer
, it made no sense for it to be inrustc_middle
anyways.The commits are reviewed separately.
Fixes #106968