-
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
minor changes to make method lookup diagnostic code easier to read #103937
Conversation
@bors r+ |
@@ -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 { |
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.
I'm pretty convinced that this code will never be triggered, but if it is, someone will report it as an ICE 😅
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.
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.
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.
#105732 is here,
maybe we should add an delay_span_bug
here for match with Some(node)
?
@compiler-errors
…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
@@ -248,7 +248,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
|
|||
match error { | |||
MethodError::NoMatch(NoMatchData { |
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 block is tooo long, about 800 lines of code!
Is it worth to extract to a seperate sub-methods?
@compiler-errors
The end result of around 4 days of trying to understand this 1000+ line long function- a bunch of tiny nitpicks
r? @compiler-errors