-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Emits E0599 when meeting MyTrait::missing_method
#111588
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
9ffdc3e
to
db64512
Compare
@bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#110930 (Don't expect normalization to succeed in elaborate_drops) - rust-lang#111557 (Revert "Validate resolution for SelfCtor too.") - rust-lang#111565 (rustdoc-json: Add tests for visibility of impls) - rust-lang#111588 (Emits E0599 when meeting `MyTrait::missing_method`) - rust-lang#111625 (Move rustc_middle/src/ty/query.rs to rustc_middle/src/query/plumbing.rs) - rust-lang#111674 (Add missing backslash in HTML string) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
diag.emit(); | ||
} | ||
Ok(r) | ||
}) |
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.
Isn't this redundant with the code below?
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 don't think so. This code emits steal and emit the diag when it is able to find the target method for dyn MyTrait
. The code below is executed only when it is not able to find such a method.
diag.emit(); | ||
} | ||
} | ||
|
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.
Should this code be in report_method_error
?
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 think it is good to pass only trait_missing_method
to report_method_error
. There are two reasons for this: first, the diag for the bare traits will only be emitted or cancelled here; and second, the diag for bare traits is not a method error. Putting this code in report_method_error
will lead to logical dispersion.
Fixes #111312