Skip to content

Conversation

Noratrieb
Copy link
Member

This correctly handles inference variables like {integer}. I had to move all of this note_and_explain code to rustc_infer, it made no sense for it to be in rustc_middle anyways.

The commits are reviewed separately.

Fixes #106968

@rustbot
Copy link
Collaborator

rustbot commented Jan 25, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 25, 2023
@Noratrieb Noratrieb force-pushed the ᐸTy as PartialEqᐳ::eq because what else are we gonna use in rustc_middle branch from 3e98b8f to 4ffd068 Compare January 25, 2023 19:30
@@ -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>> {
Copy link
Member Author

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.

@Noratrieb Noratrieb force-pushed the ᐸTy as PartialEqᐳ::eq because what else are we gonna use in rustc_middle branch from 4ffd068 to 35ce21b Compare January 25, 2023 19:43
This way we can properly deal with the types.
This works correctly with inference variables.
@Noratrieb Noratrieb force-pushed the ᐸTy as PartialEqᐳ::eq because what else are we gonna use in rustc_middle branch from 35ce21b to 943000f Compare January 25, 2023 20:25
@compiler-errors
Copy link
Member

r? @compiler-errors
@bors r+

Looks good to me!

@bors
Copy link
Collaborator

bors commented Jan 25, 2023

📌 Commit 943000f has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2023
…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
@bors bors merged commit 3aeafca into rust-lang:master Jan 26, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 26, 2023
@Noratrieb Noratrieb deleted the ᐸTy as PartialEqᐳ::eq because what else are we gonna use in rustc_middle branch January 26, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the return type of a default trait method returns an associated type (that has a default), there's always a mismatched type error
5 participants