Skip to content
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

minor changes to make method lookup diagnostic code easier to read #103937

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Nov 3, 2022

The end result of around 4 days of trying to understand this 1000+ line long function- a bunch of tiny nitpicks

r? @compiler-errors

@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 Nov 3, 2022
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 3, 2022

📌 Commit 3583f27 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 Nov 3, 2022
@@ -620,22 +611,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
match self.tcx.hir().get_if_local(impl_def_id) {
// Unmet obligation comes from a `derive` macro, point at it once to
// avoid multiple span labels pointing at the same place.
Some(Node::Item(hir::Item {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty convinced that this code will never be triggered, but if it is, someone will report it as an ICE 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this to be triggered, we need to have a nested obligation of a trait be reported as an unsatisfied predicate for a method to be applicable. We only construct nested trait obligations with ImplDerivedObligation causes for auto traits, which have no methods.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#105732 is here,
maybe we should add an delay_span_bug here for match with Some(node)?
@compiler-errors

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#103367 (Remove std's transitive dependency on cfg-if 0.1)
 - rust-lang#103397 (Port `dead_code` lints to be translatable.)
 - rust-lang#103681 (libtest: run all tests in their own thread, if supported by the host)
 - rust-lang#103792 (Migrate `codegen_ssa` to diagnostics structs - [Part 2])
 - rust-lang#103897 (asm: Work around LLVM bug on AArch64)
 - rust-lang#103937 (minor changes to make method lookup diagnostic code easier to read)
 - rust-lang#103958 (Test tidy should not count untracked paths towards entries limit)
 - rust-lang#103964 (Give a specific lint for unsafety not being inherited)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f7ed72d into rust-lang:master Nov 4, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 4, 2022
@@ -248,7 +248,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

match error {
MethodError::NoMatch(NoMatchData {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is tooo long, about 800 lines of code!
Is it worth to extract to a seperate sub-methods?
@compiler-errors

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.

5 participants